From 507afb4ec8dda61fadd0c46137a7e808bbc320a2 Mon Sep 17 00:00:00 2001 From: Urix <43704209+uri-99@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:13:52 -0300 Subject: [PATCH] feat: add_multiple and remove_multiple on whitelist.sol --- src/Whitelist.sol | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Whitelist.sol b/src/Whitelist.sol index 52e9f5cd..6bbaa20a 100644 --- a/src/Whitelist.sol +++ b/src/Whitelist.sol @@ -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]; }