New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/pool 481 as an owner i want to remove external ERC20 awards #151
Feature/pool 481 as an owner i want to remove external ERC20 awards #151
Conversation
/// @param _prevExternalErc20 The address of the previous ERC20 token in the `externalErc20s` list. | ||
/// If the ERC20 is the first address, then the previous address is the SENTINEL address: 0x0000000000000000000000000000000000000001 | ||
function removeExternalErc20Award(address _externalErc20, address _prevExternalErc20) external onlyOwner { | ||
require(externalErc20s.contains(_externalErc20), "PrizeStrategy/invalid-external-award"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition is already indirectly enforced by this line in MappedSinglyLinkedList#removeAddress:
require(self.addressMap[prevAddress] == addr, "Invalid prevAddress");
I think we can remove the above require to save gas. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is enforced already, I agree. But the require statement is misleading in that case since 'addr' could be the invalid value. I guess we could update the require statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I see what you did here -- it is assumed that the addr
is known, and therefore it would be prevAddress
that is incorrect..
… of github.com:pooltogether/pooltogether-pool-contracts into feature/pool-481-as-an-owner-i-want-to-remove-external
No description provided.