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

Enhancing Liquidity for Existing NFTs: Implementing Lock-up Mechanism to Return DN404 Tokens with Matching Token IDs #110

Open
abitocodes opened this issue Mar 7, 2024 · 6 comments

Comments

@abitocodes
Copy link

Hello DN404 community and developers,

I'm reaching out to propose an enhancement aimed at increasing the liquidity of already minted NFTs through the DN404 protocol. Specifically, I believe there is a significant opportunity to extend the utility and accessibility of our existing NFT assets by implementing a mechanism that allows for the locking up of an NFT in exchange for DN404 tokens that carry the identical token ID as the original NFT.

The current scope of DN404, which primarily focuses on tokens minted after 2024, seems to target a rather narrow market and community. By broadening this approach to encompass existing NFTs, we could significantly expand our reach and impact within the broader NFT ecosystem.

However, as I attempt to draft a contract to realize this functionality, I've encountered challenges in devising a robust logic that accurately matches the token IDs of the locked-up ERC721 tokens with the DN404 tokens returned to the user. This issue is crucial for ensuring that users can reclaim their original NFTs upon returning the DN404 tokens, thereby maintaining a seamless and secure exchange process.

I'm opening this issue to solicit feedback, suggestions, and potential collaborations from the DN404 community and developers. Our goal is to refine this concept further and explore viable implementations that could bring this idea to fruition. I believe that by working together, we can overcome the technical hurdles and create a more fluid and dynamic NFT market that benefits all stakeholders involved.

I don't know if this idea has already been addressed or if it's impossible, but I'll raise an issue. Thanks.

@Vectorized
Copy link
Owner

Rough idea: fill in all 10k bits in the exists bitmap.

Then whenever a token is wrapped, we will directly mint on the exact ID.

When it's burned in DN404, unset the bit in the exists bitmap.

@abitocodes
Copy link
Author

Thanks, I've written a contract based on your idea and will start testing it soon, I'll update and come here again.

https://github.com/abitofdots/convertERC721toDN404

@Vectorized
Copy link
Owner

Vectorized commented Mar 17, 2024

@abitofdots You gotta prefill all 10k bits in exists bitmap too. It will cost some gas on deploy, but your customers won't need to pay that much gas.

Also, for _isTokenLocked, use Solady's LibBitmap, or the built-in bitmap in DN404. To save more gas.

@abitocodes
Copy link
Author

Thnks you really ! Following what you said, I prefilled the existing bitmap with all 10,000 bits and replaced the existing bitmap with solady's LibBitmap.

Could you check the revised contract one more? Even if it's rough, It'd be very helpful for me.

https://github.com/abitofdots/convertERC721toDN404/blob/main/contracts/convertERC721toDN404.sol

@Vectorized
Copy link
Owner

Vectorized commented Mar 18, 2024

@abitofdots Can you write some tests to ensure that only the original owner of the token can unwrap the token?

Don't take my word for an approval of safety. I'm only 10% alert right now.

Something we will need to account for the edge case of collection where the token IDs start from 0 instead of 1. But this is homework for another day.

@abitocodes
Copy link
Author

Sure. I'll have the tests ready and share it with you soon. Thanks for your fast feedback always.

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

No branches or pull requests

2 participants