Hello Folks. I have a smart contract that has a ‘whitelist of addresses’ which is a mapping address -> uint. When i deploy my smart contract, with truffle, i want to populate the mapping. What is the most gas efficient way to do this? There are about 30k addresses that i want to add. Passing the entire array doesn’t seem to work in truffle tests. Passing batches of 1000 works in test but not in deploy Rinkeby. Examples welcome.
Mar 16, 2022, 6:07 AM
https://ethereum.stackexchange.com/questions/5812/what-is-the-difference-between-transaction-cost-and-execution-cost-in-remix
Anyone understand the signature answer at the bottom?
Mar 16, 2022, 6:15 AM
is this on ethereum? Storing 30k values into a mapping is going to be quite expensive...roughly $47000 at 30 gwei!
Instead, you should use a merkle tree or a set of signed coupons to accomplish the whitelist (both will cost you only a few dollars)
Instead, you should use a merkle tree or a set of signed coupons to accomplish the whitelist (both will cost you only a few dollars)
Mar 16, 2022, 6:32 AM
I think HEX did a really job on this particular issue!
Caching is very goood
chunking not so good :)
Mar 16, 2022, 6:42 AM
caching in solidity? What do you mean?
Mar 16, 2022, 6:46 AM
very cheap transactions
Mar 16, 2022, 6:47 AM
no, i mean, what do you mean by caching in solidity?
Mar 16, 2022, 6:47 AM
Hex does it. Don't you remember when you guys were copy pasting that code?
:)
Mar 16, 2022, 6:47 AM
lol
no code was copied, if you actually go look.
and "caching" is what exactly, in solidity?
which answer?
Mar 16, 2022, 6:49 AM
The lst one r.e hash.recover
Mar 16, 2022, 7:09 AM
hmm I don't see anything about hash recover there...
Mar 16, 2022, 7:23 AM
You’re right. Wrong link. I’m a dummy.
https://ethereum.stackexchange.com/questions/23945/how-to-whitelist-up-to-50k-addresses-in-a-single-contract
https://luizhamilton29.medium.com/whitelist-553358559658
Trying to figure this out…..
Mar 16, 2022, 9:54 AM