anyone know how to bulk add users to whitelist in an efficient way? i have a list of wallet addresses i need to add to a mapping

Mar 29, 2022, 9:57 PM
I can't think of anything more efficient than passing an array of addresses and looping through them to update your map.
Mar 29, 2022, 11:37 PM
Yup same
On Eth might be pretty costly
How does everyone else do it? Unless they're doing it through the front end only
Mar 29, 2022, 11:38 PM
Use a merkle tree or a set of signed coupons, super cheap
Mar 29, 2022, 11:39 PM
Never heard of that. Wait lemme google
Mar 29, 2022, 11:40 PM
Sounds interesting... can you link to any code examples of using a merkle tree/signed coupons in a solidity contract? I've never seen anything like that...
Mar 29, 2022, 11:41 PM
Super common for NFT mint whitelists, I've used several Merkle trees in my NFT contracts
Mar 29, 2022, 11:41 PM
This makes creating the whitelist cheaper but checking it more expensive tho, so that might depend on how he uses that and how big is the list of addresses to be whitelisted
Mar 29, 2022, 11:42 PM
Yeah, as long as you're using a list that is longer than like tens of items, it should make good gas sense
Once the list gets beyond like 150 or so, signed coupons become more efficient to check
Mar 29, 2022, 11:43 PM
I've never heard of signed coupons but you can find a merkle tree also on uniswap's github
Signed coupons is that centralized system where user signs a message and you check it offchain?
Mar 29, 2022, 11:43 PM
thanks, I'll check it out
Mar 29, 2022, 11:43 PM
Signed coupon just meaning a signed message that grants some permission
No, checking on chain
Message signed by a trusted wallet, details of the message and signature passed to contract and verified there with ecrecover
Mar 29, 2022, 11:44 PM
https://github.com/Uniswap/merkle-distributor
Mar 29, 2022, 11:44 PM
Yep, exactly
I can post a couple gists I wrote showing the typical usage of Merkle trees and signed coupons for mint whitelists
Mar 29, 2022, 11:45 PM
I'd appreciate it, thanks!
Mar 29, 2022, 11:46 PM
Ah right got confused, but yeah you need centralization as you need centralization cause you rely on the trusted wallet
💪🏻
Mar 29, 2022, 11:46 PM
Right but the list is centralized info anyways, same with Merkle tree, you have to trust the person who generated it offline
The important thing is they both get verified on chain
Mar 29, 2022, 11:47 PM
Good point
Mar 29, 2022, 11:47 PM
https://medium.com/@ItsCuzzo/using-merkle-trees-for-nft-whitelists-523b58ada3f9
you are the man! thanks dude
Mar 29, 2022, 11:48 PM
No prob, hit me up if you wanna see any of my NFT Merkle trees in the wild...I used one to accomplish verifying off chain trait data on chain, for combining NFTs by burning into a new NFT
That was for Monster Satoshibles
Mar 29, 2022, 11:49 PM
So, now I think the question is, does it use more gas to verify a signed message, or to verify a merkle proof? I would assume the former.
Mar 30, 2022, 12:12 AM
Depends on the size of the Merkle tree. Above about 150 items or so, Merkle tree verification is more expensive
Mar 30, 2022, 12:24 AM
Thanks again... you're a pro!
Mar 30, 2022, 12:36 AM
I wouldnt say pro, learning like everyone else! But I'm happy to help
Mar 30, 2022, 12:40 AM
https://medium.com/donkeverse/hardcore-gas-savings-in-nft-minting-part-2-signatures-vs-merkle-trees-917c43c59b07
Mar 30, 2022, 8:13 AM
Thanks
Mar 30, 2022, 9:02 AM
then check for token vesting
hi
Mar 30, 2022, 9:48 AM

© 2024 Draquery.com All rights reserved.