Skip to content

simple-whitelist#2

Open
simon-something wants to merge 4 commits intomainfrom
whitelist-naive
Open

simple-whitelist#2
simon-something wants to merge 4 commits intomainfrom
whitelist-naive

Conversation

@simon-something
Copy link
Copy Markdown
Member

@simon-something simon-something commented Jun 22, 2022

Provide a simple whitelisting possibility, via a datasource. The whitelist is managed by the project owner. Anyone can reuse the whitelist (by adding this datasource as funding cycle datasource).

This implementation uses a mapping of whitelisted addresses, and might therefore not be able to handle large whitelist (where other solutions might be more gas efficients, Merkle tree of the addresses for instance)

@simon-something simon-something changed the title code simple-whitelist Jun 27, 2022
@notice Add a single address to the whitelist
@param _address the address to whitelist
*/
function addToWhitelist(address _address) external onlyProjectOwner {
Copy link
Copy Markdown
Member

@xBA5ED xBA5ED Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea: remove the single add/remove methods in favor of the multiple add/remove, the gas saved when deploying a version without those methods might outweigh the overhead of looping if you are just adding 1 address

}

function supportsInterface(bytes4 _interfaceId) external pure override returns (bool) {
return _interfaceId == type(IJBFundingCycleDataSource).interfaceId;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure it also reflects implementing the ERC165 standard itself by returning true for the ERC165 interfaceId (Example OZ)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I forgot to || super

@simon-something simon-something added the pending todo's still some changes to make label Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending todo's still some changes to make

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants