Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presale whitelisting using maps #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Presale whitelisting using maps #27

wants to merge 1 commit into from

Conversation

Murf
Copy link

@Murf Murf commented Jan 15, 2022

This is a better way of implementing a pre-sale whitelist using maps.
Also has a function to add an array into the list.

@Murf
Copy link
Author

Murf commented Jan 23, 2022 via email

@Murf
Copy link
Author

Murf commented Jan 24, 2022 via email

@4x13
Copy link

4x13 commented Jan 24, 2022

Will this be merged soon? Would like to try this out

@DEXExchange
Copy link

DEXExchange commented Jan 25, 2022

@liarco I was wondering if you have any input into this implementation or feedback as well of whitelisting using mapping to retain gas fee efficiency throughout the mint loop.

@liarco
Copy link
Contributor

liarco commented Jan 26, 2022

Hi @DEXExchange, thank you for reaching out to us.

In my opinion implementing whitelists by managing the addresses one by one always leads to poor gas efficiency.

We (@HashLips and I) are working on something new to be released soon that allows everyone to manage whitelists without any back end (full on-chain solution) and being able to change from 1 to hundreds of addresses in the list with just a few bucks in gas fees.

Please stay tuned for that, it will be huge! 😉

@laygir
Copy link

laygir commented Jan 26, 2022

Hey @liarco

Are you guys working on a Merkle tree approach? I am implementing a merkle approach myself I thought if you are already working on it, I might as well wait for a bit and discard my work if the timing allows it 😎

If that's the case do you have any ETA for a release?

@liarco
Copy link
Contributor

liarco commented Jan 26, 2022

Hi @laygir, I'm really happy to hear that you are working on this kind of solution.

First answer is: yes! But we are not gonna stop with a basic Merkle Tree implementation on the contract side, we are gonna provide the whole community with really cool tools to manage the whole stuff. Can't say too much at the moment because we are still picking the best features that we think are ready for the first release, but I'm pretty sure you are gonna love it! 😃

As far as the ETA, can't really give it for sure (testing and doing fine-tuning takes it's time), but I hope it's not gonna take long... maybe 2 weeks at most? 🤐

@jaydeebow
Copy link

jaydeebow commented Jan 26, 2022

Hi @laygir, I'm really happy to hear that you are working on this kind of solution.

First answer is: yes! But we are not gonna stop with a basic Merkle Tree implementation on the contract side, we are gonna provide the whole community with really cool tools to manage the whole stuff. Can't say too much at the moment because we are still picking the best features that we think are ready for the first release, but I'm pretty sure you are gonna love it! 😃

As far as the ETA, can't really give it for sure (testing and doing fine-tuning takes it's time), but I hope it's not gonna take long... maybe 2 weeks at most? 🤐

OMG I'm so happy to hear this. I really hope it only takes about 2 weeks. 🤞🤞 Can we also get something like firebase for metamask authentication so you can only connect to the dapp if your address is on our db.

@DEXExchange
Copy link

Hi @DEXExchange, thank you for reaching out to us.

In my opinion implementing whitelists by managing the addresses one by one always leads to poor gas efficiency.

We (@HashLips and I) are working on something new to be released soon that allows everyone to manage whitelists without any back end (full on-chain solution) and being able to change from 1 to hundreds of addresses in the list with just a few bucks in gas fees.

Please stay tuned for that, it will be huge! 😉

I have implemented this contract build based off the SimpleNFTLowerGas contract with @Murf whitelist map commit: https://github.com/DEXExchange/ERC721-NFT-OptmizedGas-WhitelistMapping/blob/main/BAACGenesis.sol

May I kindly ask your input/criticisms in any capacity about if this contract build with mapping is sufficient for gas efficiency retention due to the whitelist parameters? I did place reentrancy guard as well into the contract. Any input i greatly appreciate to learn from.

Best regards,

-KinToshiGG

(I look forward to learning from your Merkle Tree implementations and utilities, as I have been often hearing about this approach to better gas efficiency retention during presale whitelist events.)

@liarco
Copy link
Contributor

liarco commented Jan 26, 2022

Hi @DEXExchange,
Thank you for your question and I hope you will find the following considerations useful. By the way, it would be really interesting to discuss this kind of things together in the future and try to improve these contracts all together.

I may be wrong, but there are a few things that I would probably handle differently from the solution you are sharing here.

Even gas efficiency, in example, can be very subjective here... I think you can get a more efficient implementation with small tweaks (at least from the buyer side), but the problem I see is that this solution can be a nightmare for the owner. The management cost for this solution can be an issue even before you start thinking about the minting cost.

Code complexity is also another possible issue. The mint(...) method, in example, does really a lot of things, and many of them are not even necessary for most of the method lifecycle (e.g. as soon as the whitelist sale ends, there is no need to spend gas checking stuff about that specific sale).

Those are just the first things that came to my mind looking at the code, but unfortunately I don't have time to get deep in each line at the moment... and with Solidity each single line really matters in terms of gas efficiency.

I strongly suggest waiting for the upcoming solution so maybe we can run some benchmarks.

@DEXExchange
Copy link

I greatly appreciate your feedbacks. Thank you.

@andrewzourob
Copy link

hello guys! was curious as to when the contract with Merkle tree (i think that is what you are implementing) is coming out! I have been working on implementing it and have been stuck for quite some time now and something to compare to would be amazing! you guys are awesome! hopefully i can be of some help and contribute when i am more proficient!

@liarco
Copy link
Contributor

liarco commented Feb 11, 2022

hello guys! was curious as to when the contract with Merkle tree (i think that is what you are implementing) is coming out! I have been working on implementing it and have been stuck for quite some time now and something to compare to would be amazing! you guys are awesome! hopefully i can be of some help and contribute when i am more proficient!

Hi @andrewzourob, we are almost there and I can finally say that the new project is going to be released next week. :)

It's going to be announced on HashLips' YouTube channel.

@Skellyfish
Copy link

Awesome news!! Will this be the Merkle Tree on the new low gas contract or on the original contract?

@liarco
Copy link
Contributor

liarco commented Feb 14, 2022

Awesome news!! Will this be the Merkle Tree on the new low gas contract or on the original contract?

The new solution is going to combine all the features from the lower gas contract plus the new stuff, all in one single package. 😉

@Skellyfish
Copy link

wohoooo thank you! :)

@simira911
Copy link

@liarco thank you so much :)

@Skellyfish
Copy link

Hi Liarco! Saw Hashlips just dropped a video. Is that the all in on solution you were referring to? Can that contract be used efficiently for the collection drop or shall I still wait for a different release?

@liarco
Copy link
Contributor

liarco commented Feb 17, 2022

Hi Liarco! Saw Hashlips just dropped a video. Is that the all in on solution you were referring to? Can that contract be used efficiently for the collection drop or shall I still wait for a different release?

Yes, it is: https://www.youtube.com/watch?v=ynZzPNkS1nk 😃
The code you find on our repository is the stable version of our first release. That is tested and verified at the best of our possibilities so it's basically the same as any other code by HashLips and me. (everything is explained inside the README and LICENSE files)

More videos are coming since there are many features to show.

@Skellyfish
Copy link

Amazing! Thanks so much going to follow that video step by step! So that Merkle Tree method that is implemented, do you know about how much each address will cost to add? I know the old method was expensive so just want to be sure before offering X amount of whitelist spots and getting a huge bill lol

@liarco
Copy link
Contributor

liarco commented Feb 17, 2022

Amazing! Thanks so much going to follow that video step by step! So that Merkle Tree method that is implemented, do you know about how much each address will cost to add? I know the old method was expensive so just want to be sure before offering X amount of whitelist spots and getting a huge bill lol

Would you like it if I tell you that it costs the same no matter the size of your list? 😊
That's the power of the Merkle Tree solution.
Adding or changing a complete whitelist (even 100k) will cost you under 20$ average (I reached down to 8$).

@Skellyfish
Copy link

Oh my goodness that's amazing! lol I was contemplating doing 250 WL spots because it was going to cost too much, now I can do even more! And in that repo all the Merkle code is complete so we just have to add addresses after deploy! This also completely takes out the Remix way, correct?

@liarco
Copy link
Contributor

liarco commented Feb 17, 2022

You can never use remix again, but I'm gonna make a video about how to use it anyway, for all the people that prefer not to input their private keys into the .env file. ⚠️ Please always keep safe and make sure you understand what you are doing! ⚠️😉

@Skellyfish
Copy link

Sweet! Please share your YouTube as well would love to check it out! Thanks again for all your help!

@liarco
Copy link
Contributor

liarco commented Feb 17, 2022

Thank you, here it is: https://www.youtube.com/channel/UCsNUSP49XDIhxaZoZlLwnyw
It's brand new, but the content about this new solution is coming soon. I was just focused on releasing the code, but now I'm gonna work on the videos 😅

@Skellyfish
Copy link

https://www.youtube.com/channel/UCsNUSP49XDIhxaZoZlLwnyw

just subbed ✌️

@stevenbenmoha
Copy link

stevenbenmoha commented Feb 18, 2022

Amazing! Thanks so much going to follow that video step by step! So that Merkle Tree method that is implemented, do you know about how much each address will cost to add? I know the old method was expensive so just want to be sure before offering X amount of whitelist spots and getting a huge bill lol

Would you like it if I tell you that it costs the same no matter the size of your list? 😊 That's the power of the Merkle Tree solution. Adding or changing a complete whitelist (even 100k) will cost you under 20$ average (I reached down to 8$).

@liarco
Is this for Ethereum mainnet or for Polygon? And I'm assuming it's this same gas fee (~$20, depending on network congestion) every time you make an update to the whitelist? Thanks in advance, and great work!

@liarco
Copy link
Contributor

liarco commented Feb 18, 2022

Amazing! Thanks so much going to follow that video step by step! So that Merkle Tree method that is implemented, do you know about how much each address will cost to add? I know the old method was expensive so just want to be sure before offering X amount of whitelist spots and getting a huge bill lol

Would you like it if I tell you that it costs the same no matter the size of your list? 😊 That's the power of the Merkle Tree solution. Adding or changing a complete whitelist (even 100k) will cost you under 20$ average (I reached down to 8$).

@liarco Is this for Ethereum mainnet or for Polygon? And I'm assuming it's this same gas fee (~$20, depending on network congestion) every time you make an update to the whitelist? Thanks in advance, and great work!

Hi @stevenbenmoha, my reference is always the ethereum network, so you have to make some proportion for other networks depending on their prices. :)

@Skellyfish
Copy link

Hi Liarco, sorry to keep bugging you here. Last question, in the previous low gas contract the owner was able to mint while the contract was paused to allow us to get the necessary NFTs for our marketing/us. Is this still an option on the new version or what would be the best way for the owner to mint their say 100 NFTs from the collection?

@liarco
Copy link
Contributor

liarco commented Feb 18, 2022

@Skellyfish the new contract is directly based on the LowerGas one, so you should find all the same features in it, as well as the mintForAddress function: https://github.com/hashlips-lab/nft-erc721-collection/blob/eed2fcf049ffd5b14c2ab14382fdb0de6f4ae59f/smart-contract/contracts/YourNftToken.sol#L79

@dhararughani
Copy link

You can never use remix again, but I'm gonna make a video about how to use it anyway, for all the people that prefer not to input their private keys into the .env file. ⚠️ Please always keep safe and make sure you understand what you are doing! ⚠️😉

I am eagerly waiting for that. When are you going to release the video and on which channel ?

@liarco
Copy link
Contributor

liarco commented Feb 23, 2022

Hi @dhararughani, the video will be released on my youtube channel. I already started publishing some content about the tool but there are many topics to cover so it will take me some time to record all the stuff, but stay tuned! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.