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 Ganache 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 installto install all dependencies:
$ yarn install-
Run Ganache
-
After that you can run the command below to deploy Velo Protocol smart contracts to your local network
$ yarn run reset- Now you can interact with the smart contract via
truffle console - Modify the migration script in
./migrationsto control the how the smart contract should be setup.
$ yarn run reset$ yarn run reset: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:covAfter 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:extractPlease 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
