Skip to main content

Generalized4626Strategy

Generalized4626Strategy

shareToken

contract IERC20 shareToken

assetToken

contract IERC20 assetToken

constructor

constructor(struct InitializableAbstractStrategy.BaseStrategyConfig _baseConfig, address _assetToken) public

Parameters

NameTypeDescription
_baseConfigstruct InitializableAbstractStrategy.BaseStrategyConfigBase strategy config with platformAddress (ERC-4626 Vault contract), eg sfrxETH or sDAI, and vaultAddress (OToken Vault contract), eg VaultProxy or OETHVaultProxy
_assetTokenaddressAddress of the ERC-4626 asset token. eg frxETH or DAI

initialize

function initialize() external virtual

deposit

function deposit(address _asset, uint256 _amount) external

Deposit assets by converting them to shares

Parameters

NameTypeDescription
_assetaddressAddress of asset to deposit
_amountuint256Amount of asset to deposit

_deposit

function _deposit(address _asset, uint256 _amount) internal virtual

Deposit assets by converting them to shares

Parameters

NameTypeDescription
_assetaddressAddress of asset to deposit
_amountuint256Amount of asset to deposit

depositAll

function depositAll() external virtual

Deposit the entire balance of assetToken to gain shareToken

withdraw

function withdraw(address _recipient, address _asset, uint256 _amount) external virtual

Withdraw asset by burning shares

Parameters

NameTypeDescription
_recipientaddressAddress to receive withdrawn asset
_assetaddressAddress of asset to withdraw
_amountuint256Amount of asset to withdraw

_abstractSetPToken

function _abstractSetPToken(address, address) internal virtual

Internal method to respond to the addition of new asset / share tokens

withdrawAll

function withdrawAll() external virtual

Remove all assets from platform and send them to Vault contract.

checkBalance

function checkBalance(address _asset) external view virtual returns (uint256 balance)

Get the total asset value held in the platform

Parameters

NameTypeDescription
_assetaddressAddress of the asset

Return Values

NameTypeDescription
balanceuint256Total value of the asset in the platform

safeApproveAllTokens

function safeApproveAllTokens() external

Governor approves the the ERC-4626 Tokenized Vault to spend the asset.

_approveBase

function _approveBase() internal virtual

supportsAsset

function supportsAsset(address _asset) public view virtual returns (bool)

Retuns bool indicating whether asset is supported by strategy

Parameters

NameTypeDescription
_assetaddressAddress of the asset

setPTokenAddress

function setPTokenAddress(address, address) external

is not supported for this strategy as the asset and ERC-4626 Tokenized Vault are set at deploy time.

If the ERC-4626 Tokenized Vault needed to be changed, a new contract would need to be deployed and the proxy updated.

removePToken

function removePToken(uint256) external

is not supported for this strategy as the asset and ERC-4626 Tokenized Vault are set at deploy time.

If the ERC-4626 Tokenized Vault needed to be changed, a new contract would need to be deployed and the proxy updated.