Skip to content

Commit

Permalink
Only emit TokenRemoved event when a token is actually removed
Browse files Browse the repository at this point in the history
  • Loading branch information
MickdeGraaf committed Dec 7, 2020
1 parent edeee96 commit d7eb866
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions contracts/facets/Basket/BasketFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ contract BasketFacet is ReentryProtection, CallProtection, IBasketFacet {
bs.inPool[_token] = false;

// remove token from array
// TODO consider limiting max amount of tokens to mitigate running out of gas.
for(uint256 i; i < bs.tokens.length; i ++) {
if(address(bs.tokens[i]) == _token) {
bs.tokens[i] = bs.tokens[bs.tokens.length - 1];
bs.tokens.pop();
emit TokenRemoved(_token);
break;
}
}

emit TokenRemoved(_token);
}

function setEntryFee(uint256 _fee) external override protectedCall {
Expand Down

0 comments on commit d7eb866

Please sign in to comment.