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 documentation can be found on our github pages site.
- run
git clone [email protected]:AztecProtocol/AZTEC.git
- run
git submodule update --init --recursive
- followed by
npm install
&&npm install ./aztec-crypto-js
&&npm install ./aztec-demo-js
Then, to test and deploy the contracts:
./node_modules/.bin/ganache-cli
&&truffle migrate
- set your private key or mnemonic in a
.env
file - run truffle tests with
truffle test
- go the demo submodule
cd aztec-demo-js
- 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