Giter Club home page Giter Club logo

dixel-contract's Introduction

Dixel

A single NFT canvas where users overwrite the previous edition with price-compounded pixels.

  1. There is an universal art canvas with 16x16 pixels that anyone can overwrite
  2. Whenever a user overwrites a pixel, the price of the pixel increases by 5% (Initial pixel price: 1 DIXEL)
  3. A new NFT edition with the current canvas state will be minted to the updater (image data is encoded as SVG, 100% on-chain)
  4. Total cost that user paid to overwrite pixels goes to:
    • 10% -> all contributors proportional to their contribution count (total pixel count a user has updated so far)
    • 90% -> reserve for refund when the NFT gets burned
  5. If a user burn a NFT they own, reserve amount (DIXEL tokens) gets refunded to the user (90% of total minting cost)

Run Tests

npx hardhat test

Contracts

BSC Testnet

  • Test DIXEL token: 0x596b3f42C39aACbB405810D2011BB35b9142c330
  • DixelAirdrop: 0x7B0f17dC4A3Bb4AE1880fc195139B5d705e31224
  • DixelArt NFT: 0xebb0Ce00EBFAd67180a256aa9592E1a36A61a726
  • Dixel contract: 0x0737Ee66D587baB42b42D608C4Fe712B13bbC9f2

Deploy

npx hardhat compile

HARDHAT_NETWORK=bscmain node scripts/deploy.js

# Verify source code on Etherscan
npx hardhat verify --network bscmain {contract address} "parameter 1" "parameter 2"

Gas Consumption

·-------------------------------------------------|---------------------------|--------------|-----------------------------·
|              Solc version: 0.8.10               ·  Optimizer enabled: true  ·  Runs: 1500  ·  Block limit: 60000000 gas  │
··················································|···························|··············|······························
|  Methods                                        ·                1 gwei/gas                ·       3119.53 usd/eth       │
····························|·····················|·············|·············|··············|···············|··············
|  Contract                 ·  Method             ·  Min        ·  Max        ·  Avg         ·  # calls      ·  usd (avg)  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelAirdrop             ·  addTokens          ·      69381  ·      91305  ·       80343  ·           46  ·       0.25  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelAirdrop             ·  claim              ·          -  ·          -  ·       85131  ·            9  ·       0.27  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelAirdrop             ·  closeAirdrop       ·          -  ·          -  ·       59736  ·            3  ·       0.19  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelAirdrop             ·  startAirdrop       ·          -  ·          -  ·       56037  ·            9  ·       0.17  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelAirdrop             ·  whitelist          ·          -  ·          -  ·      201854  ·           23  ·       0.63  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelArt                 ·  burn               ·          -  ·          -  ·       67688  ·            6  ·       0.21  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelArt                 ·  transferOwnership  ·      28608  ·      28620  ·       28619  ·           58  ·       0.09  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelMock                ·  claimReward        ·      56335  ·      73435  ·       67735  ·            6  ·       0.21  │
····························|·····················|·············|·············|··············|···············|··············
|  DixelMock                ·  updatePixels       ·    1232462  ·    1257340  ·     1251424  ·          100  ·       3.90  │
····························|·····················|·············|·············|··············|···············|··············
|  ERC20PresetMinterPauser  ·  approve            ·      46608  ·      46620  ·       46619  ·          123  ·       0.15  │
····························|·····················|·············|·············|··············|···············|··············
|  ERC20PresetMinterPauser  ·  mint               ·      55830  ·      72954  ·       63456  ·          182  ·       0.20  │
····························|·····················|·············|·············|··············|···············|··············
|  Deployments                                    ·                                          ·  % of limit   ·             │
··················································|·············|·············|··············|···············|··············
|  ColorUtilsMock                                 ·          -  ·          -  ·      298677  ·        0.5 %  ·       0.93  │
··················································|·············|·············|··············|···············|··············
|  DixelAirdrop                                   ·    1339634  ·    1339646  ·     1339645  ·        2.2 %  ·       4.18  │
··················································|·············|·············|··············|···············|··············
|  DixelArt                                       ·    2822083  ·    2822107  ·     2822106  ·        4.7 %  ·       8.80  │
··················································|·············|·············|··············|···············|··············
|  DixelMock                                      ·    7750764  ·    7750788  ·     7750786  ·       12.9 %  ·      24.18  │
··················································|·············|·············|··············|···············|··············
|  ERC20PresetMinterPauser                        ·          -  ·          -  ·     1951544  ·        3.3 %  ·       6.09  │
·-------------------------------------------------|-------------|-------------|--------------|---------------|-------------·

dixel-contract's People

Contributors

sydneyitguy avatar

Watchers

 avatar

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.