This repository contains the implementation of Velo Protocol version 2, which includes
- Smart contract
- Golang implementations
- Go SDK (vclient)
- Go CLI (gvel)
├── contracts - solidity smart contract code stays here
├── migrations - migration script
├── test - smart contract test
├── truffle-config.js - config truffle env and behaviour here
├── package.json
├── yarn.lock
...
└── go (Golang implementations)
See Golang implementations here
To install DRSv2, you need to install NodeJs 10.16.3, Truffle and Evrynet first.
- You can use the command below to install Truffle.
$ yarn global add truffle
- Clone this repository in your machine, go to folder DRSv2, then use
yarn install
to install all dependencies:
$ yarn install
-
Run Evrynet
-
After that you can run the command below to deploy Velo Protocol smart contracts to your dev network
$ ./deploy_evrynet.sh
- Now you can interact with the smart contract via
truffle console
- Modify the migration script in
./migrations
to control the how the smart contract should be setup.
$ yarn run reset
$ yarn run reset:dev
$ yarn run console
$ yarn run console:dev
$ yarn run test test/path/to/file.js
or
$ yarn run test test/path/to/file.sol
$ yarn run test:js
$ yarn run test:sol
$ yarn run test:all
$ yarn run test:cov
After smart contract compilation, it yields ABI in .json format. Golang's abigen
tool requires
ABI in .bin and .abi to generate Go smart contract function. (see more in Go abigen section)
# compile your smart contract before proceed (yarn run reset)
$ yarn run abi:extract
Please copy .env.example
and rename it to .env
, config its value properly
DEV_SCC_HOST - the rpc url to the Ethereum based chain
DEV_SCC_PK - the private key of the smart contract deployer account (the account must own some ETH balance)
USD_VELO_PK, THB_VELO_PK, SGD_VELO_PK - the private key of the VOracle Module deployer account of each currency pair, this
key can be the same as DEV_SCC_PK for testing purpose