Skip to main content

GnoOsTokenRedeemer

Git Source ↗

Inherits: IGnoOsTokenRedeemer, OsTokenRedeemer

This contract is used to redeem OsTokens for the underlying asset.

State Variables

_gnoToken

IERC20 private immutable _gnoToken

Functions

constructor

Constructor

constructor(
address gnoToken_,
address vaultsRegistry_,
address osToken_,
address osTokenVaultController_,
address owner_,
uint256 exitQueueUpdateDelay_
) OsTokenRedeemer(vaultsRegistry_, osToken_, osTokenVaultController_, owner_, exitQueueUpdateDelay_);

Parameters

NameTypeDescription
gnoToken_addressThe address of the GNO token contract
vaultsRegistry_addressThe address of the VaultsRegistry contract
osToken_addressThe address of the OsToken contract
osTokenVaultController_addressThe address of the OsTokenVaultController contract
owner_addressThe address of the owner
exitQueueUpdateDelay_uint256The delay in seconds for exit queue updates

permitGnoToken

Permit GNO tokens to be used for swap.

function permitGnoToken(uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external override;

Parameters

NameTypeDescription
amountuint256The number of tokens to permit
deadlineuint256The deadline for the permit
vuint8The recovery byte of the signature
rbytes32The output of the ECDSA signature
sbytes32The output of the ECDSA signature

swapAssetsToOsTokenShares

Swap assets to OsToken shares

function swapAssetsToOsTokenShares(address receiver, uint256 assets)
external
override
returns (uint256 osTokenShares);

Parameters

NameTypeDescription
receiveraddressThe address to receive the OsToken shares
assetsuint256The amount of assets to swap

Returns

NameTypeDescription
osTokenSharesuint256The amount of OsToken shares received

_getAssets

Internal function that must be implemented to return the account assets

function _getAssets(address account) internal view override returns (uint256);

Parameters

NameTypeDescription
accountaddressThe address of the account

Returns

NameTypeDescription
<none>uint256The amount of assets in the vault

_transferAssets

Internal function for transferring assets to the receiver

function _transferAssets(address receiver, uint256 assets) internal override;

Parameters

NameTypeDescription
receiveraddressThe address that will receive the assets
assetsuint256The number of assets to transfer