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

feat: add_multiple and remove_multiple on whitelist.sol #5

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/Whitelist.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,25 @@ contract Whitelist is OwnableUpgradeable {
emit AddedToWhiteList(_address);
}

function add_multiple(address[] memory _addresses) public onlyOwner {
for (uint256 i = 0; i < _addresses.length; i++) {
whitelist[_addresses[i]] = true;
emit AddedToWhiteList(_addresses[i]);
}
}

function remove(address _address) public onlyOwner {
whitelist[_address] = false;
emit RemovedFromWhiteList(_address);
}

function remove_multiple(address[] memory _addresses) public onlyOwner {
for (uint256 i = 0; i < _addresses.length; i++) {
whitelist[_addresses[i]] = false;
emit RemovedFromWhiteList(_addresses[i]);
}
}

function isWhitelisted(address _address) public view returns (bool) {
return whitelist[_address];
}
Expand Down