IWusdn

Git Source

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

NameTypeDescription
<none>IUsdnThe 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

NameTypeDescription
<none>uint256The 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

NameTypeDescription
usdnAmountuint256The amount of USDN to wrap.

Returns

NameTypeDescription
wrappedAmount_uint256The 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

NameTypeDescription
usdnAmountuint256The amount of USDN to wrap.
toaddressThe address to receive the WUSDN.

Returns

NameTypeDescription
wrappedAmount_uint256The 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

NameTypeDescription
usdnSharesuint256The amount of USDN shares to wrap.
toaddressThe address to receive the WUSDN.

Returns

NameTypeDescription
wrappedAmount_uint256The amount of WUSDN received.

unwrap

Unwraps a given amount of WUSDN into USDN.

function unwrap(uint256 wusdnAmount) external returns (uint256 usdnAmount_);

Parameters

NameTypeDescription
wusdnAmountuint256The amount of WUSDN to unwrap.

Returns

NameTypeDescription
usdnAmount_uint256The 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

NameTypeDescription
wusdnAmountuint256The amount of WUSDN to unwrap.
toaddressThe address to receive the USDN.

Returns

NameTypeDescription
usdnAmount_uint256The 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

NameTypeDescription
usdnAmountuint256The amount of USDN to wrap.

Returns

NameTypeDescription
wrappedAmount_uint256The 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

NameTypeDescription
usdnSharesuint256The amount of USDN shares to wrap.

Returns

NameTypeDescription
wrappedAmount_uint256The amount of WUSDN that would be received.

redemptionRate

Returns the exchange rate between WUSDN and USDN.

function redemptionRate() external view returns (uint256 usdnAmount_);

Returns

NameTypeDescription
usdnAmount_uint256The 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

NameTypeDescription
wusdnAmountuint256The amount of WUSDN to unwrap.

Returns

NameTypeDescription
usdnAmount_uint256The 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

NameTypeDescription
wusdnAmountuint256The amount of WUSDN to unwrap.

Returns

NameTypeDescription
usdnSharesAmount_uint256The 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

NameTypeDescription
<none>uint256The 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

NameTypeDescription
<none>uint256The total amount of USDN shares held by the contract.