Giter VIP home page Giter VIP logo

hash-contract's Introduction

Commit-and-Reveal Scheme in Solidity

  • solc: 0.6.12

Test

$ npx hardhat node
$ npx hardhat test benchmark/CommitReveal.js --network localhost

  CommitReveal
    Normal
Tester:  0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 (10000 ETH)
Deploy CommitReveal:     0x129955157BE2622EbB0a7bEBC990216C63069973
      ✓ Commit Hash (38734054 gas)
      ✓ Reveal Hash (71372250 gas)
    Hashed
      ✓ Commit Hash (36884859 gas)
      ✓ Reveal Hash (38856806 gas)

·----------------------------------|---------------------------|-------------|----------------------------·
|       Solc version: 0.6.12       ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 6718946 gas  │
···································|···························|·············|·····························
|  Methods                                                                                                │
·················|·················|·············|·············|·············|··············|··············
|  Contract      ·  Method         ·  Min        ·  Max        ·  Avg        ·  # calls     ·  usd (avg)  │
·················|·················|·············|·············|·············|··············|··············
|  CommitReveal  ·  commit         ·      44825  ·      62072  ·      45732  ·         820  ·          -  │
·················|·················|·············|·············|·············|··············|··············
|  CommitReveal  ·  commit_hashed  ·      44861  ·      44897  ·      44895  ·         820  ·          -  │
·················|·················|·············|·············|·············|··············|··············
|  CommitReveal  ·  reveal         ·      27831  ·     796620  ·      87124  ·         820  ·          -  │
·················|·················|·············|·············|·············|··············|··············
|  CommitReveal  ·  reveal_hashed  ·      47355  ·      47391  ·      47389  ·         819  ·          -  │
·················|·················|·············|·············|·············|··············|··············
|  Deployments                     ·                                         ·  % of limit  ·             │
···································|·············|·············|·············|··············|··············
|  CommitReveal                    ·          -  ·          -  ·     691625  ·      10.3 %  ·          -  │
·----------------------------------|-------------|-------------|-------------|--------------|-------------·

  4 passing (7m)

hash-contract's People

Contributors

temporallobe 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.