VTreasury
This page documents the BNB-specific legacy VTreasury source in venus-protocol v10.3.0, an Ownable contract that can receive native BNB and hold BEP-20 tokens.
If the requested withdrawal exceeds the live balance, this implementation withdraws the available balance rather than reverting for an excessive amount.
Solidity API
Section titled “Solidity API”fallback
Section titled “fallback”To receive BNB
function() external payablewithdrawTreasuryBEP20
Section titled “withdrawTreasuryBEP20”Withdraws up to the available balance of a BEP-20 token. Only the live owner can call this function.
function withdrawTreasuryBEP20(address tokenAddress, uint256 withdrawAmount, address withdrawAddress) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| tokenAddress | address | The address of treasury token |
| withdrawAmount | uint256 | Requested amount; capped to the contract’s token balance |
| withdrawAddress | address | Recipient of the withdrawn tokens |
withdrawTreasuryBNB
Section titled “withdrawTreasuryBNB”Withdraws up to the available native BNB balance. Only the live owner can call this function.
function withdrawTreasuryBNB(uint256 withdrawAmount, address payable withdrawAddress) external payableParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| withdrawAmount | uint256 | Requested amount; capped to the contract’s BNB balance |
| withdrawAddress | address payable | Recipient of the withdrawn BNB |