wWETH and wUSDB
INFINIT's ERC-20 wrapped version of ETH, WETH, or USDB
View Functions
underlyingToken
Underlying token of the contract.
function underlyingToken() external view returns (address underlyingToken);totalAssets
Total amount of underlying token, including claimable yield amount.
function totalAssets() external view returns (uint256 totalAssets);decimals
Decimal of the wrapped token, currently equals to8 + underlyingToken.decimals().
function decimals() public view override returns (uint8 decimals);toShares
Convert the underlying token amount to wrapped token amount (rounded down), including claimable yield amount.
function toShares(uint _amt) external view returns (uint256 shares);toAmt
Convert wrapped token amount to underlying token amount (rounded down), including claimable yield amount.
function toAmt(uint256 _shares) external view returns (uint256 amt);External Functions
accrueYield
Claim underlying yield and update the internal balance.
function accrueYield() external;wrap
Accrue underlying token's yield and wrap underlying token to wrapped token (rounded down).
function wrap(uint256 _amt) external returns (uint256 shares);Parameters:
_amt
uint256
amount of underlying to wrap
Returns:
shares
uint256
amount of wrapped token to receive
unwrap
Accrue underlying token's yield and unwrap wrapped token to underlying token (rounded down).
function unwrap(uint256 _shares) external returns (uint256 amtOut);Parameters:
_shares
uint256
amount of wrapped token to unwrap
Returns:
amtOut
uint256
amount of underlying token to receive
wrapNative
Accrue ETH yield, wrap ETH to WETH, and wrap WETH to wWETH (rounded down).
function wrapNative() external payable returns (uint256 shares);Returns:
shares
uint256
amount of wWETH to receive from wrapping msg.value ETH
upwrapNative
Accrue ETH yield, unwrap wWETH to WETH, and unwrap WETH to ETH and send to msg.sender (rounded down).
function unwrapNative(uint256 _shares) external returns (uint256 amtOut);Parameters:
_shares
uint256
amount of wWETH to unwrap
Returns:
amtOut
uint256
amount of ETH to receive
Last updated