Coder Social home page Coder Social logo

contract-core's Introduction

Tranchess Core

Tranchess core.

Local Development

Install Dependencies

yarn install

Compile Contracts

yarn hardhat compile

Run Tests

yarn run test

Check Lint and Format

yarn run check

Deploy Contracts

Deployed Contract Address

Each of the following deployment tasks creates a JSON file under the deployed_addresses directory, writing address of all deployed contracts in it.

Configuration

Copy the file .env.example to .env and modify configurations in the file.

This project depends on a few external contracts. On a public blockchain, please update their addresses in .env. On a private blockchain, deploy mock contracts using the following command.

yarn hardhat deploy_mock --network remote

Oracle Contracts

yarn hardhat deploy_twap_oracle --network remote --token <BTC_TOKEN_ADDR> --oracle-symbol BTC

yarn hardhat deploy_bsc_apr_oracle --network remote --token <USDC_TOKEN_ADDR> --v-token <VENUS_V_TOKEN_ADDR>

On a private blockchain, you may want to modify address files generated by these tasks and change addresses to mock oracles.

Governance Contracts

yarn hardhat deploy_governance --network remote

Fund Contracts

yarn hardhat deploy_fund --network remote --underlying-symbol <BTC_TOKEN_SYMBOL> --quote-symbol <USDC_TOKEN_SYMBOL> --admin-fee-rate 0.5

It reads address files generated by some previous tasks.

Exchange Contracts

yarn hardhat deploy_exchange --network remote --underlying-symbol <BTC_TOKEN_SYMBOL>

It reads address files generated by some previous tasks.

Test the Deployment Tasks

The Hardhat task test_deploy runs all the above deployment tasks on a temporary local Hardhat network. It can be used as a preliminary test.

yarn hardhat test_deploy

contract-core's People

Contributors

bill-clippy avatar mogamii avatar pierrejeanjacquot avatar tpawn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.