Hi guys
I need to modify whitelist code in my smart contract such that I will not upload whitelist addresses to my mint site using the transaction like its done here
function addToWhitelist(address[] calldata addresses) external onlyOwner {
for (uint256 i = 0; i < addresses.length; i++) {
require(addresses[i] != address(0), "Cannot add null address");
_presaleAddresses[addresses[i]] = true;
}
}
but instead I will write the directly to smart contract in fomr of static array and then deploy to save transaction cost.
Here is my smart contract address on ethereum: 0x91094bC91e7A3B86a69980433d0bEe55a1D6CBb3
Jan 16, 2022, 1:11 AM
something like this? :
address[3] whitelist = [ 0x7FDf721e952EE6C8B94357432eFa862471F04130, 0x7FDf721e952EE6C8B94357432eFa862471F04130, 0x7FDf721e952EE6C8B94357432eFa862471F04130
];
address[3] whitelist = [ 0x7FDf721e952EE6C8B94357432eFa862471F04130, 0x7FDf721e952EE6C8B94357432eFa862471F04130, 0x7FDf721e952EE6C8B94357432eFa862471F04130
];
Jan 16, 2022, 1:20 AM
Um, you verify white list like that?
Only array and check an address on it?
Is it safe?
Jan 16, 2022, 1:22 AM
you say you want to write it directly into the smart contract right? thats what I did there
Jan 16, 2022, 1:24 AM
Yes I think work.
Jan 16, 2022, 1:24 AM
if you dont change it in another function, yes
Jan 16, 2022, 1:24 AM
Why would it not be?
Jan 16, 2022, 1:24 AM