Giter Site home page Giter Site logo

hack-money's Introduction

HermezJS examples

Scripts to perform basic actions using hermezjs that have been shown on hack-money workshop All examples are in examples-hermezjs folder

Examples list

  • set-environment.js
    • description: sets hermezjs environment variables depending on chainID
    • requirements:
      • ethereum node url
  • create-wallet.js
    • description: creates a standard hermez wallet, an internal hermez wallet and creates an account authorization message
    • requirements:
      • ethereum node url
      • ethereum private key
  • deposit.js
    • description: performs deposit in hermez network through smart contract hermez interaction. This action will create an hermez account
    • requirements:
      • ethereum node url
      • ethereum private key
      • token to be deposited
      • ether
  • transfer.js
    • description: performs a L2 transfer in hermez network
    • requirements:
      • ethereum node url
      • ethereum private key
      • hermez account
      • enough balance on L2
  • exit.js
    • description: performs a L2 exit in hermez network. This action moves funds from L2 to L1 hermez smart contract, ready to be claimed by the user in the following step withdraw
    • requirements:
      • ethereum node url
      • ethereum private key
      • hermez account
      • enough balance on L2
  • withdraw.js
    • description: Claim funds from an exit L2 transaction. This action will move funds from hermez contract to user ethereum account
    • requirements:
      • ethereum node url
      • ethereum private key
      • hermez account
      • pending exit
      • ether

Configuration parameters

  • ETHEREUM_NODE_URL: ethereum node url
  • ETHEREUM_PVT_KEY: ethereum private key
  • TOKEN_SYMBOL: token symbol to be used in the examples (example: ETH)
  • AMOUNT_DEPOSIT: amount to be deposited from ethereum to hermez network (taking into account token decimals) (example: 0.042)
  • AMOUNT_TRANSFER: amount to be transfered between hermez accounts (taking into account token decimals) (example: 0.014)
  • AMOUNT_EXIT: amount to exit from hermez network to hermez contract (taking into account token decimals) (example: 0.014)
  • RECEIVER: hermez account receiver for the hermez network transfer (example: hez:0xa7Db86d226235B9eaF38d742A32D0CBD4FB187Cc)

hack-money's People

Contributors

krlosmata avatar

Watchers

James Cloos avatar Miros avatar Jordi Baylina avatar Arnau Bennassar avatar sherif samir avatar  avatar

Forkers

pinkdiamond1

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.