Skip to content
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

Merged

Conversation

robsecord
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Sep 10, 2020

@robsecord robsecord changed the title Feature/pool 481 as an owner i want to remove external Feature/pool 481 as an owner i want to remove external ERC20 awards Sep 10, 2020
/// @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");
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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..

@robsecord robsecord merged commit dc7e12e into version-3 Sep 11, 2020
@robsecord robsecord deleted the feature/pool-481-as-an-owner-i-want-to-remove-external branch September 11, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants