Coder Social home page Coder Social logo

pinkdiamond1 / aztec-demo-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from equitytrustbankxfether0xlba0ethplorer/aztec-demo-js

0.0 1.0 0.0 883 KB

AZTEC javascript demos

License: GNU Lesser General Public License v3.0

Shell 0.75% JavaScript 99.25%

aztec-demo-js's Introduction

AZTEC Demonstration Scripts

This directory uses the aztec-crypto-js library to issue AZTEC confidential transactions, using AZTEC contracts deployed to the following networks:

  • Main-net
  • Rinkeby
  • Kovan
  • Ropsten

In order to use these scripts, Ethereum private keys and addresses need to be added to accounts.json; these are the accounts used to issue AZTEC transactions. The demo script currently requires three but you can modify it to fit your purposes.

The demo script will, if used on the Ethereum main-net, convert 10 DAI into zero-knowledge AZTEC notes, and then issue multiple AZTEC notes to the addresses in accounts.json. If the first account in accounts.json does not have 10 DAI the transactions will throw. You can modify the amount of DAI transferred, the sizes of the AZTEC notes and their recipients in demoTransactions.js.

For the test-nets, the AZTEC token smart contract is attached to a dummy ERC20 contract that anybody can mint from - the demoTransactions.js script will automatically mint tokens for you.

You can deploy your own AZTEC contracts (attached to different ERC20 token contracts if you want) by running truffle migrate, specifying the appropriate network. See the truffle docs for more details.

If you're running this script on a local test-net, run truffle migrate to deploy the AZTEC contracts locally.

API Docs

API documentation can be found on our github pages site.

Usage

  1. run git clone [email protected]:AztecProtocol/AZTEC.git
  2. run git submodule update --init --recursive
  3. followed by npm install && npm install ./aztec-crypto-js && npm install ./aztec-demo-js

Then, to test and deploy the contracts:

  1. ./node_modules/.bin/ganache-cli && truffle migrate
  2. set your private key or mnemonic in a .env file
  3. run truffle tests with truffle test
  4. go the demo submodule cd aztec-demo-js
  5. run javascript tests with npm run test

Finally, run the demo transactions script (to the appropriate network) with the following:

npm run demo:development (to a network running on port 8545)
npm run demo:rinkeby
npm run demo:kovan
npm run demo:ropsten
npm run demo:mainnet

aztec-demo-js's People

Contributors

paulrberg avatar add-license[bot] 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.