Git Product home page Git Product logo

Comments (6)

Vectorized avatar Vectorized commented on July 20, 2024

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.

from dn404.

abitocodes avatar abitocodes commented on July 20, 2024

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

from dn404.

Vectorized avatar Vectorized commented on July 20, 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.

from dn404.

abitocodes avatar abitocodes commented on July 20, 2024

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

from dn404.

Vectorized avatar Vectorized commented on July 20, 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.

from dn404.

abitocodes avatar abitocodes commented on July 20, 2024

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

from dn404.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.