Comments (6)
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.
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.
@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.
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.
@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.
Sure. I'll have the tests ready and share it with you soon. Thanks for your fast feedback always.
from dn404.
Related Issues (20)
- EIP-2612 support HOT 8
- DoS Vector: Transfering relatively large amounts of DN404 always `oog`s HOT 6
- 🐞 At example contract **NFTMintDN404** the minting checking allows to mint only once. HOT 3
- Get the NFT inventory of the wallet. HOT 1
- Revert on dn404Fallback if fn selector is not recognized. HOT 1
- ✨ Overrideable _msgSender() HOT 1
- Inquiry on Potential Gas or Security Issues for Large Supply Collections HOT 1
- I've completely rebuilt ERC404 to fix all issues(?)
- Problem for configuration setbaseuri tokenuri HOT 7
- Batch Minting like 721A's HOT 2
- ⚡️ Make tokenURI into internal _tokenURI
- Transfer on/off HOT 2
- Dosn't work with SafeTransferLib ? HOT 1
- ⚡️ Use updated FindFirstSet formulation
- ✨ Overrideable option to safe transfer NFTs
- 📢 Audit fixes incoming
- Set log handlers as internal virtual instead of private HOT 2
- ✨ Zero Indexed optionality
- ✨Omnichain compatibility using LayerZero
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dn404.