Comments (3)
Note: as now the each pixel is uint8, the pixels array accepts values that are bigger than 15.
This means that if the user for example submits a pixel with color value 20, it will succeed in creating the contract, but then the contract will revert when trying to create the metadata or SVG, because there will be an out of bounds exception, as the contract will try to read pallete[20], but pallete only goes up to 15.
So the user would have spent funds for deployment, but the contract will not work.
I am not sure if it worthy to mitigate this by checking the input, as this is unlikely to happen.
But thought it's worth bringing it to your attention.
If we use the packed array method I detailed above, this problem will also be fixed, because then the user couldn't submit a pixel with a color larger than 15.
from dixel-v2-contract.
Implemented in PR #17.
from dixel-v2-contract.
This is brilliant!
Thanks a lot for your effort on looking at the code deeply. 🙏🏻
Your PR is merged and our front-end dev is working on changes on his end.
from dixel-v2-contract.
Related Issues (20)
- Recommendation: Add a Burn event in a similar way to the Mint. HOT 1
- Mint and burn are missing nonReentrant modifier HOT 4
- The owner of the NFT contract must not be the contract address. HOT 2
- Improper minting starts date validation. HOT 3
- Receive function in DixelClubV2NFT might get users ether stuck in the contract HOT 1
- SVGGenerator generates extra horizontal pixel - image dimensions becomes 24*25 HOT 2
- The minting starts date can be changed even after minting.
- Consider using mapping instead of array HOT 17
- Split updateBeneficiary() in DixelClubV2Factory.sol HOT 1
- Optimize gas cost in for loop.
- _initializedAt bool instead of uint40 HOT 2
- Community Audit - Reward Distribution! 💸 HOT 15
- Withdraw? HOT 5
- backslash character (0x5c) can also be used to create invalid JSON HOT 3
- Test submission
- No need to traverse whitelist array twice when minting HOT 1
- There is no Ownable Contact in this project. HOT 1
- Pass position in whitelist when minting to save lots of gas HOT 2
- Whiltelisting logic should be fixed. HOT 11
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 dixel-v2-contract.