Notes
- Same interface as Compound V2 (forked codebase)
- Must call
enterMarketson Comptroller before borrowing against any market - Also supports VAI stablecoin minting (separate contract)
- Return values: 0 = success, non-zero = error code
- BSC-only deployment
- vBNB (
vBNB) takes native BNB, so itsmintandrepayBorrowtake no amount: the BNB sent with the call is the amount.
Its names in a program
On BNB Chain,Venus is a namespace: its contracts need no import.
Deployments
ABI
VBNBABI
import VBNBABI from "./protocols/venus/VBNBABI.json"; Speaks for: vBNB.
mint() payableredeem(uint256 redeemTokens) returns (uint256)redeemUnderlying(uint256 redeemAmount) returns (uint256)borrow(uint256 borrowAmount) returns (uint256)repayBorrow() payablebalanceOfUnderlying(address owner) returns (uint256)
VTokenABI
import VTokenABI from "./protocols/venus/VTokenABI.json";
mint(uint256 mintAmount) returns (uint256)redeem(uint256 redeemTokens) returns (uint256)redeemUnderlying(uint256 redeemAmount) returns (uint256)borrow(uint256 borrowAmount) returns (uint256)repayBorrow(uint256 repayAmount) returns (uint256)balanceOfUnderlying(address owner) returns (uint256)
VenusComptrollerABI
import VenusComptrollerABI from "./protocols/venus/VenusComptrollerABI.json"; Speaks for: comptroller.
enterMarkets(address[] vTokens) returns (uint256[])exitMarket(address vToken) returns (uint256)
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
