Code Monkey home page Code Monkey logo

Comments (3)

assafom avatar assafom commented on September 6, 2024 1

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.

assafom avatar assafom commented on September 6, 2024 1

Implemented in PR #17.

from dixel-v2-contract.

sydneyitguy avatar sydneyitguy commented on September 6, 2024 1

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)

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.