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:

Name
Type
Description

_amt

uint256

amount of underlying to wrap

Returns:

Name
Type
Description

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:

Name
Type
Description

_shares

uint256

amount of wrapped token to unwrap

Returns:

Name
Type
Description

amtOut

uint256

amount of underlying token to receive

wrapNative

Accrue ETH yield, wrap ETH to WETH, and wrap WETH to wWETH (rounded down).

Only available in wWETH contract.

function wrapNative() external payable returns (uint256 shares);

Returns:

Name
Type
Description

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).

Only available in wWETH contract.

function unwrapNative(uint256 _shares) external returns (uint256 amtOut);

Parameters:

Name
Type
Description

_shares

uint256

amount of wWETH to unwrap

Returns:

Name
Type
Description

amtOut

uint256

amount of ETH to receive

Last updated