I've mapping of addresses and need to somehow set bulk data at contract deployment or able to update it later
mapping (address => bool) private accounts;
this is current solution to set addresses
function setAccounts(address[] memory _accounts) public onlyOwner {
for(uint i=0; i< _accounts.length; i++){
accounts[_accounts[i]] = true;
}
}
The problem is that I need to set about 10,000 addresses and doing it with loop requires lots of gas and too expensive. Probably, it's not possible to pass an array directly, but what could be a solution to get 10K list of addresses in 1 transaction without loop (or decrease gas fee)
Should I use array instead and keep the address index to filter it later? Please advise Thanks in advance