Skip to content

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.

To receive BNB

function() external payable

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) external
NameTypeDescription
tokenAddressaddressThe address of treasury token
withdrawAmountuint256Requested amount; capped to the contract’s token balance
withdrawAddressaddressRecipient of the withdrawn tokens

Withdraws up to the available native BNB balance. Only the live owner can call this function.

function withdrawTreasuryBNB(uint256 withdrawAmount, address payable withdrawAddress) external payable
NameTypeDescription
withdrawAmountuint256Requested amount; capped to the contract’s BNB balance
withdrawAddressaddress payableRecipient of the withdrawn BNB