9.7.0 • Published 4 months ago

@venusprotocol/venus-protocol v9.7.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
4 months ago

GitHub Actions GitHub Actions

Venus Protocol

The Venus Protocol is a BNB Chain collection of smart contracts for supplying or borrowing assets. Through the vToken contracts, accounts on the blockchain supply capital (BNB or BEP-20 tokens) to receive vTokens or borrow assets from the protocol (holding other assets as collateral). The protocol will also enable the minting of VAI, which is the first synthetic stablecoin on Venus that aims to be pegged to 1 USD. VAI is minted by the same collateral that is supplied to the protocol. The Venus vToken contracts track these balances and algorithmically set interest rates for borrowers and suppliers.

Before getting started with this repo, please read:

Interested in contributing? Please checkout our contributing guidelines

Isolated pool is the updated version of the Venus protocol. The Venus "Core Pool" uses the codebase in this repository. On the other hand, Isolated pools use the codebase in the isolated-pools repository.

Contracts

We detail a few of the core contracts in the Venus protocol.

Documentation

  • Public documentation site: https://docs.venus.io, including autogenerated documentation, guides, addresses of the deployment contracts and more content.
  • Documentation autogenerated using solidity-docgen.
  • To generate the documentation from the natspec comments embedded in the contracts, use yarn docgen

Installation

To run venus, pull the repository from GitHub and install its dependencies. You will need yarn or npm installed.

git clone https://github.com/VenusProtocol/venus-protocol
cd venus-protocol
yarn install --lock-file # or `npm install`

Testing

Contract tests are defined under the tests directory. To run the tests run:

    yarn test
  • To run fork tests set theFORKED_NETWORK var in the .env file. An env variable with the name ARCHIVE_NODE_<FORKED_NETWORK> is also required.

Code Coverage

To run code coverage, run:

npx hardhat coverage

Deployment

npx hardhat deploy
  • This command will execute all the deployment scripts in ./deploy directory - It will skip only deployment scripts which implement a skip condition - Here is example of a skip condition: - Skipping deployment script on bsctestnet network func.skip = async (hre: HardhatRuntimeEnvironment) => hre.network.name !== "bsctestnet";
  • The default network will be hardhat
  • Deployment to another network: - Make sure the desired network is configured in hardhat.config.ts - Add MNEMONIC variable in .env file - Execute deploy command by adding --network <network_name> in the deploy command above - E.g. npx hardhat deploy --network bsctestnet
  • Execution of single or custom set of scripts is possible, if:
    • In the deployment scripts you have added tags for example: - func.tags = ["MockTokens"];
    • Once this is done, adding --tags "<tag_name>,<tag_name>..." to the deployment command will execute only the scripts containing the tags.

Dry Run / Forked Deployments

To simulate what contracts would be deployed on a given network the deployment scripts support running on a forked network. To run the deployment scripts on a forked network the HARDHAT_FORK_NETWORK env variable needs to be set.

For example

HARDHAT_FORK_NETWORK=ethereum npx hardhat deploy

Deployed Contracts

Contract addresses deployed before hardhat-deploy was adopted are available in the networking directory in JSON files by network name.

Contract addresses and abis deployed with hardhat deploy are exported in the deployments directory. To create a summary export of all contracts deployed to a network run.

$ yarn hardhat --network <network-name> --export ./deployments/<network-name>.json

Source Code Verification

In order to verify the source code of already deployed contracts, run: npx hardhat etherscan-verify --network <network_name>

Make sure you have added ETHERSCAN_API_KEY in .env file.

Linting

To lint the code, run:

yarn lint

To format the code, run:

yarn prettier

Hardhat Commands

npx hardhat accounts

npx hardhat compile

npx hardhat clean

npx hardhat test

npx hardhat node

npx hardhat help

REPORT_GAS=true npx hardhat test

npx hardhat coverage

TS_NODE_FILES=true npx ts-node scripts/deploy.ts

npx eslint '\*_/_.{js,ts}'

npx eslint '\*_/_.{js,ts}' --fix

npx prettier '\*_/_.{json,sol,md}' --check

npx prettier '\*_/_.{json,sol,md}' --write

npx solhint 'contracts/\*_/_.sol'

npx solhint 'contracts/\*_/_.sol' --fix

MNEMONIC="<>" BSC_API_KEY="<>" npx hardhat run ./script/hardhat/deploy.ts --network testnet

Discussion

For any concerns with the protocol, open an issue or visit us on Telegram to discuss.

For security concerns, please contact the administrators of our telegram chat.

© Copyright 2023, Venus Protocol

9.8.0-dev.1

4 months ago

9.7.0-dev.2

5 months ago

9.7.0-dev.1

5 months ago

9.7.0

5 months ago

9.5.0-dev.3

5 months ago

9.5.0

5 months ago

9.6.0

5 months ago

9.6.0-dev.5

5 months ago

9.6.0-dev.3

5 months ago

9.6.0-dev.4

5 months ago

9.6.0-dev.1

5 months ago

9.6.0-dev.2

5 months ago

9.5.0-dev.2

6 months ago

9.5.0-dev.1

6 months ago

9.4.0

7 months ago

9.4.0-dev.9

7 months ago

9.4.0-dev.8

7 months ago

9.4.0-dev.7

7 months ago

9.4.0-dev.6

7 months ago

9.4.0-dev.5

7 months ago

9.4.0-dev.4

7 months ago

9.4.0-dev.3

8 months ago

9.4.0-dev.2

8 months ago

9.4.0-dev.1

9 months ago

9.3.0-dev.5

10 months ago

9.3.0-dev.6

9 months ago

9.3.0

9 months ago

9.2.0-dev.14

10 months ago

9.2.0-dev.15

10 months ago

9.2.0-dev.12

10 months ago

9.2.0-dev.13

10 months ago

9.2.0-dev.16

10 months ago

9.2.0-dev.11

11 months ago

9.3.0-dev.1

10 months ago

9.3.0-dev.4

10 months ago

9.3.0-dev.3

10 months ago

9.3.0-dev.2

10 months ago

9.2.0

10 months ago

9.2.0-dev.10

11 months ago

9.2.0-dev.9

11 months ago

9.2.0-dev.8

11 months ago

9.2.0-dev.7

11 months ago

9.2.0-dev.6

12 months ago

9.2.0-dev.5

12 months ago

9.2.0-dev.2

12 months ago

9.2.0-dev.3

12 months ago

9.2.0-dev.4

12 months ago

9.2.0-dev.1

1 year ago

9.1.0-dev.1

1 year ago

9.1.0-dev.2

1 year ago

9.1.0

1 year ago

9.0.0-dev.9

1 year ago

9.0.0

1 year ago

9.0.0-dev.7

1 year ago

9.0.0-dev.8

1 year ago

9.0.0-dev.6

1 year ago

9.0.0-dev.5

1 year ago

9.0.0-dev.4

1 year ago

9.0.0-dev.2

1 year ago

9.0.0-dev.3

1 year ago

9.0.0-dev.1

1 year ago

8.1.0

1 year ago

8.1.0-dev.1

1 year ago

8.0.0-dev.1

1 year ago

8.0.0

1 year ago

7.6.0-dev.5

1 year ago

7.6.0-dev.4

1 year ago

7.6.0-dev.3

1 year ago

7.6.0-dev.2

1 year ago

7.6.0-dev.1

1 year ago

7.5.0

1 year ago

7.5.0-dev.2

1 year ago

7.5.0-dev.1

1 year ago

7.4.1-dev.1

1 year ago

7.4.0

1 year ago

7.4.0-dev.8

1 year ago

7.4.0-dev.7

1 year ago

7.4.0-dev.6

1 year ago

7.4.0-dev.3

1 year ago

7.4.0-dev.4

1 year ago

7.4.0-dev.5

1 year ago

7.4.0-dev.2

1 year ago

7.4.0-dev.1

1 year ago

7.3.0

1 year ago

7.3.0-dev.4

1 year ago

7.3.0-dev.3

1 year ago

7.3.0-dev.2

1 year ago

7.3.0-dev.1

1 year ago

7.2.0-dev.1

1 year ago

7.2.0

1 year ago

7.1.0

1 year ago

7.1.0-dev.3

1 year ago

7.1.0-dev.2

1 year ago

7.1.0-dev.1

2 years ago

7.0.0

2 years ago

7.0.0-dev.5

2 years ago

7.0.0-dev.4

2 years ago

7.0.0-dev.3

2 years ago

7.0.0-dev.2

2 years ago

7.0.0-dev.1

2 years ago

6.1.0-dev.11

2 years ago

6.1.0-dev.9

2 years ago

6.1.0-dev.10

2 years ago

6.1.0-dev.8

2 years ago

6.1.0-dev.7

2 years ago

6.1.0-dev.6

2 years ago

5.1.0

2 years ago

5.0.0-dev.1

2 years ago

3.1.0-dev.1

2 years ago

3.1.0-dev.2

2 years ago

6.1.0-dev.5

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

6.1.0-dev.3

2 years ago

6.1.0-dev.4

2 years ago

6.1.0-dev.1

2 years ago

6.1.0-dev.2

2 years ago

3.0.0-dev.19

2 years ago

3.0.0-dev.18

2 years ago

3.0.0-dev.17

2 years ago

3.0.0-dev.16

2 years ago

3.0.0-dev.15

2 years ago

3.0.0-dev.14

2 years ago

3.0.0-dev.13

2 years ago

3.0.0-dev.12

2 years ago

4.0.0-dev.1

2 years ago

3.0.0

2 years ago

4.0.0

2 years ago

5.1.0-dev.4

2 years ago

5.1.0-dev.3

2 years ago

5.1.0-dev.2

2 years ago

5.1.0-dev.1

2 years ago

6.0.1-dev.1

2 years ago

6.0.1-dev.2

2 years ago

5.2.0

2 years ago

5.0.0

2 years ago

6.0.0

2 years ago

6.0.0-dev.7

2 years ago

6.0.0-dev.6

2 years ago

6.0.0-dev.5

2 years ago

6.0.0-dev.4

2 years ago

6.0.0-dev.3

2 years ago

5.0.1-dev.1

2 years ago

6.0.0-dev.2

2 years ago

6.0.0-dev.1

2 years ago

2.1.0

2 years ago

4.1.0-dev.1

2 years ago

4.1.0-dev.2

2 years ago

3.1.0

2 years ago

5.2.0-dev.3

2 years ago

5.2.0-dev.1

2 years ago

5.2.0-dev.2

2 years ago

3.0.0-dev.11

2 years ago

3.0.0-dev.10

2 years ago

3.0.0-dev.8

2 years ago

3.0.0-dev.7

2 years ago

3.0.0-dev.9

2 years ago

3.0.0-dev.4

2 years ago

3.0.0-dev.3

2 years ago

3.0.0-dev.6

2 years ago

3.0.0-dev.5

2 years ago

3.0.0-dev.2

2 years ago

3.0.0-dev.1

2 years ago

0.7.0

2 years ago

2.1.0-dev.1

2 years ago

0.6.0

2 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago