IWusdn
Inherits: IERC20Metadata, IERC20Permit, IWusdnEvents, IWusdnErrors
Interface for the Wrapped Ultimate Synthetic Delta Neutral (WUSDN) token.
Functions
USDN
Returns the address of the USDN token.
function USDN() external view returns (IUsdn);
Returns
Name | Type | Description |
---|---|---|
<none> | IUsdn | The address of the USDN token. |
SHARES_RATIO
Returns the ratio used to convert USDN shares to WUSDN amounts.
This ratio is initialized in the constructor based on the maximum divisor of the USDN token.
function SHARES_RATIO() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The conversion ratio between USDN shares and WUSDN amounts. |
wrap
Wraps a given amount of USDN into WUSDN.
This function may use slightly less than usdnAmount
due to rounding errors.
For a more precise operation, use wrapShares.
function wrap(uint256 usdnAmount) external returns (uint256 wrappedAmount_);
Parameters
Name | Type | Description |
---|---|---|
usdnAmount | uint256 | The amount of USDN to wrap. |
Returns
Name | Type | Description |
---|---|---|
wrappedAmount_ | uint256 | The amount of WUSDN received. |
wrap
Wraps a given amount of USDN into WUSDN and sends it to a specified address.
This function may use slightly less than usdnAmount
due to rounding errors.
For a more precise operation, use wrapShares.
function wrap(uint256 usdnAmount, address to) external returns (uint256 wrappedAmount_);
Parameters
Name | Type | Description |
---|---|---|
usdnAmount | uint256 | The amount of USDN to wrap. |
to | address | The address to receive the WUSDN. |
Returns
Name | Type | Description |
---|---|---|
wrappedAmount_ | uint256 | The amount of WUSDN received. |
wrapShares
Wraps a given amount of USDN shares into WUSDN and sends it to a specified address.
function wrapShares(uint256 usdnShares, address to) external returns (uint256 wrappedAmount_);
Parameters
Name | Type | Description |
---|---|---|
usdnShares | uint256 | The amount of USDN shares to wrap. |
to | address | The address to receive the WUSDN. |
Returns
Name | Type | Description |
---|---|---|
wrappedAmount_ | uint256 | The amount of WUSDN received. |
unwrap
Unwraps a given amount of WUSDN into USDN.
function unwrap(uint256 wusdnAmount) external returns (uint256 usdnAmount_);
Parameters
Name | Type | Description |
---|---|---|
wusdnAmount | uint256 | The amount of WUSDN to unwrap. |
Returns
Name | Type | Description |
---|---|---|
usdnAmount_ | uint256 | The amount of USDN received. |
unwrap
Unwraps a given amount of WUSDN into USDN and sends it to a specified address.
function unwrap(uint256 wusdnAmount, address to) external returns (uint256 usdnAmount_);
Parameters
Name | Type | Description |
---|---|---|
wusdnAmount | uint256 | The amount of WUSDN to unwrap. |
to | address | The address to receive the USDN. |
Returns
Name | Type | Description |
---|---|---|
usdnAmount_ | uint256 | The amount of USDN received. |
previewWrap
Computes the amount of WUSDN that would be received for a given amount of USDN.
The actual amount received may differ slightly due to rounding errors. For a precise value, use previewWrapShares.
function previewWrap(uint256 usdnAmount) external view returns (uint256 wrappedAmount_);
Parameters
Name | Type | Description |
---|---|---|
usdnAmount | uint256 | The amount of USDN to wrap. |
Returns
Name | Type | Description |
---|---|---|
wrappedAmount_ | uint256 | The estimated amount of WUSDN that would be received. |
previewWrapShares
Computes the amount of WUSDN that would be received for a given amount of USDN shares.
function previewWrapShares(uint256 usdnShares) external view returns (uint256 wrappedAmount_);
Parameters
Name | Type | Description |
---|---|---|
usdnShares | uint256 | The amount of USDN shares to wrap. |
Returns
Name | Type | Description |
---|---|---|
wrappedAmount_ | uint256 | The amount of WUSDN that would be received. |
redemptionRate
Returns the exchange rate between WUSDN and USDN.
function redemptionRate() external view returns (uint256 usdnAmount_);
Returns
Name | Type | Description |
---|---|---|
usdnAmount_ | uint256 | The amount of USDN that corresponds to 1 WUSDN. |
previewUnwrap
Computes the amount of USDN that would be received for a given amount of WUSDN.
The actual amount received may differ slightly due to rounding errors. For a precise value, use previewUnwrapShares.
function previewUnwrap(uint256 wusdnAmount) external view returns (uint256 usdnAmount_);
Parameters
Name | Type | Description |
---|---|---|
wusdnAmount | uint256 | The amount of WUSDN to unwrap. |
Returns
Name | Type | Description |
---|---|---|
usdnAmount_ | uint256 | The estimated amount of USDN that would be received. |
previewUnwrapShares
Computes the amount of USDN shares that would be received for a given amount of WUSDN.
function previewUnwrapShares(uint256 wusdnAmount) external view returns (uint256 usdnSharesAmount_);
Parameters
Name | Type | Description |
---|---|---|
wusdnAmount | uint256 | The amount of WUSDN to unwrap. |
Returns
Name | Type | Description |
---|---|---|
usdnSharesAmount_ | uint256 | The amount of USDN shares that would be received. |
totalUsdnBalance
Returns the total amount of USDN held by the contract.
function totalUsdnBalance() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The total amount of USDN held by the contract. |
totalUsdnShares
Returns the total amount of USDN shares held by the contract.
function totalUsdnShares() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The total amount of USDN shares held by the contract. |