StrategVault

Strateg vault implementation

Methods

DOMAIN_SEPARATOR

function DOMAIN_SEPARATOR() external view returns (bytes32)

Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.

Returns

Name
Type
Description

_0

bytes32

undefined

addressProvider

function addressProvider() external view returns (contract IStrategAddressesProvider)

The address of the operator

Returns

Name
Type
Description

_0

contract IStrategAddressesProvider

undefined

allowance

function allowance(address owner, address spender) external view returns (uint256)

See {IERC20-allowance}.

Parameters

Name
Type
Description

owner

address

undefined

spender

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

approve

See {IERC20-approve}. NOTE: If value is the maximum uint256, the allowance is not updated on transferFrom. This is semantically equivalent to an infinite approval. Requirements: - spender cannot be the zero address.

Parameters

Name
Type
Description

spender

address

undefined

value

uint256

undefined

Returns

Name
Type
Description

_0

bool

undefined

asset

See {IERC4626-asset}.

Returns

Name
Type
Description

_0

address

undefined

balanceOf

See {IERC20-balanceOf}.

Parameters

Name
Type
Description

account

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

buffer

The address of the buffer contract

Returns

Name
Type
Description

_0

address

undefined

convertToAssets

See {IERC4626-convertToAssets}.

Parameters

Name
Type
Description

shares

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

convertToShares

See {IERC4626-convertToShares}.

Parameters

Name
Type
Description

assets

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

decimals

Set the decimal value for the vault token.

Returns

Name
Type
Description

_0

uint8

The number of decimals for the vault token.

deposit

Deposit assets into the vault and mint shares to the receiver.

Parameters

Name
Type
Description

assets

uint256

The amount of assets to deposit.

receiver

address

The address to receive the minted shares.

Returns

Name
Type
Description

_0

uint256

The amount of shares minted.

eip712Domain

See {IERC-5267}.

Returns

Name
Type
Description

fields

bytes1

undefined

name

string

undefined

version

string

undefined

chainId

uint256

undefined

verifyingContract

address

undefined

salt

bytes32

undefined

extensions

uint256[]

undefined

erc3525

Strateg ERC3525 which define vault ownership

Returns

Name
Type
Description

_0

address

undefined

factory

Strateg vault factory address

Returns

Name
Type
Description

_0

address

undefined

getStrat

Get the strategy blocks for the vault.

Returns

Name
Type
Description

_strategyBlocks

address[]

Array of strategy blocks addresses.

_strategyBlocksParameters

bytes[]

Array of strategy blocks parameters.

_isFinalBlock

bool[]

Array of boolean indicating if a block is a final block.

_harvestBlocks

address[]

Array of harvest blocks addresses.

_harvestBlocksParameters

bytes[]

Array of harvest blocks parameters.

harvest

Internal function to harvest strategy rewards. Only callable by the operator proxy.

Parameters

Name
Type
Description

_dynParamsIndex

uint256[]

The array of dynamic parameter indices.

_dynParams

bytes[]

The array of dynamic parameter values.

harvestBlocksLength

Mapping of harvest block numbers to their corresponding addresses

Returns

Name
Type
Description

_0

uint256

undefined

initialize

Initalize function call by the factory on deployment

Parameters

Name
Type
Description

_erc3525

address

ERC3525 address

_name

string

vault name

_symbol

string

vault symbol

_asset

address

native asset

isLive

Indicates whether the vault is live

Returns

Name
Type
Description

_0

bool

undefined

lastHarvestIndex

Last index of harvest operation

Returns

Name
Type
Description

_0

uint256

undefined

maxDeposit

See {IERC4626-maxDeposit}.

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

maxMint

See {IERC4626-maxMint}.

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

maxRedeem

See {IERC4626-maxRedeem}.

Parameters

Name
Type
Description

__owner

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

maxWithdraw

See {IERC4626-maxWithdraw}.

Parameters

Name
Type
Description

__owner

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

mint

Mint shares to the receiver.

Parameters

Name
Type
Description

shares

uint256

The amount of shares to mint.

receiver

address

The address to receive the minted shares.

Returns

Name
Type
Description

_0

uint256

The amount of assets minted.

name

Returns the name of the token.

Returns

Name
Type
Description

_0

string

undefined

nonces

Returns the current nonce for owner. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases owner's nonce by one. This prevents a signature from being used multiple times.

Parameters

Name
Type
Description

owner

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

owner

return current owner of the vault

Returns

Name
Type
Description

_0

address

Owner of the vault

partialStrategyExecution

Executes partial strategy enter for a given range of strategy blocks. Only callable by a position manager owned by the vault.

Executes the strategy enter function for a subset of strategy blocks, starting from _from index. The _dynParamsIndex array and _dynParams array provide dynamic parameters for the strategy blocks.

Parameters

Name
Type
Description

_isEnter

bool

Boolean indicating if the strategy blocks are entering or exiting the vault.

_neededTokenToRebalance

address

The token needed for the position manager to rebalance.

_from

uint256[]

The starting index of the strategy blocks.

_to

uint256[]

The ending index of the strategy blocks.

_dynParamsIndex

uint256[]

The array of dynamic parameter indices.

_dynParams

bytes[]

The array of dynamic parameter values.

permit

Sets value as the allowance of spender over owner's tokens, given owner's signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - spender cannot be the zero address. - deadline must be a timestamp in the future. - v, r and s must be a valid secp256k1 signature from owner over the EIP712-formatted function arguments. - the signature must use owner's current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section]. CAUTION: See Security Considerations above.

Parameters

Name
Type
Description

owner

address

undefined

spender

address

undefined

value

uint256

undefined

deadline

uint256

undefined

v

uint8

undefined

r

bytes32

undefined

s

bytes32

undefined

previewDeposit

See {IERC4626-previewDeposit}.

Parameters

Name
Type
Description

assets

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

previewMint

See {IERC4626-previewMint}.

Parameters

Name
Type
Description

shares

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

previewRedeem

See {IERC4626-previewRedeem}.

Parameters

Name
Type
Description

shares

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

previewWithdraw

See {IERC4626-previewWithdraw}.

Parameters

Name
Type
Description

assets

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

rebalance

Function to execute the buffer rebalancing process. Only callable by the operator proxy.

Parameters

Name
Type
Description

_dynParamsIndexEnter

uint256[]

The array of dynamic parameter indices for strategy enter.

_dynParamsEnter

bytes[]

The array of dynamic parameters for strategy enter.

_dynParamsIndexExit

uint256[]

The array of dynamic parameter indices for strategy exit.

_dynParamsExit

bytes[]

The array of dynamic parameters for strategy exit.

redeem

Redeem shares for assets from the vault.

Parameters

Name
Type
Description

_shares

uint256

The amount of shares to redeem.

_receiver

address

The address to receive the redeemed assets.

__owner

address

The owner of the shares being redeemed.

Returns

Name
Type
Description

_0

uint256

The amount of assets redeemed.

setStrat

Set the strategy blocks for the vault. Only callable by the factory.

Parameters

Name
Type
Description

_positionManagers

address[]

Array of position managers.

_stratBlocks

address[]

Array of strategy blocks.

_stratBlocksParameters

bytes[]

Array of strategy block parameters.

_isFinalBlock

bool[]

Array of boolean indicating if a block is a final block..

_harvestBlocks

address[]

Array of harvest blocks.

_harvestBlocksParameters

bytes[]

Array of harvest block parameters.

stopStrategy

Internal function to stop the strategy, harvest fees, and perform rebalancing. Only callable by the operator proxy.

Parameters

Name
Type
Description

_dynParamsIndex

uint256[]

The array of dynamic parameter indices.

_dynParams

bytes[]

The array of dynamic parameter values.

stratInitialized

Indicates whether the strategy has been initialized

Returns

Name
Type
Description

_0

bool

undefined

strategyBlocksLength

Mapping of strategy block numbers to their corresponding addresses

Returns

Name
Type
Description

_0

uint256

undefined

symbol

Returns the symbol of the token, usually a shorter version of the name.

Returns

Name
Type
Description

_0

string

undefined

timelocks

User Timelocks

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

totalAssets

Get the total assets (TVL) of the vault.

Returns

Name
Type
Description

_0

uint256

The total assets (TVL) of the vault.

totalSupply

See {IERC20-totalSupply}.

Returns

Name
Type
Description

_0

uint256

undefined

transfer

See {IERC20-transfer}. Requirements: - to cannot be the zero address. - the caller must have a balance of at least value.

Parameters

Name
Type
Description

to

address

undefined

value

uint256

undefined

Returns

Name
Type
Description

_0

bool

undefined

transferFrom

See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum uint256. Requirements: - from and to cannot be the zero address. - from must have a balance of at least value. - the caller must have allowance for from's tokens of at least value.

Parameters

Name
Type
Description

from

address

undefined

to

address

undefined

value

uint256

undefined

Returns

Name
Type
Description

_0

bool

undefined

userDeposit

Mapping of addresses to their deposited amounts.

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

uint256

undefined

withdraw

Withdraw assets from the vault and burn the corresponding shares.

Parameters

Name
Type
Description

_assets

uint256

The amount of assets to withdraw.

_receiver

address

The address to receive the withdrawn assets.

__owner

address

The owner of the shares being burned.

Returns

Name
Type
Description

_0

uint256

The amount of shares burned.

withdrawalRebalance

Function to perform a withdrawal rebalance. Only callable by the operator proxy.

Parameters

Name
Type
Description

_user

address

The user address requesting the withdrawal.

_amount

uint256

The amount of shares to be withdrawn.

_dynParamsIndexExit

uint256[]

The array of dynamic parameter indices for strategy exit.

_dynParamsExit

bytes[]

The array of dynamic parameters for strategy exit.

Returns

Name
Type
Description

totalWithdraw

uint256

undefined

Events

Approval

Emitted when the allowance of a spender for an owner is set by a call to {approve}. value is the new allowance.

Parameters

Name
Type
Description

owner indexed

address

undefined

spender indexed

address

undefined

value

uint256

undefined

Deposit

Parameters

Name
Type
Description

sender indexed

address

undefined

owner indexed

address

undefined

assets

uint256

undefined

shares

uint256

undefined

EIP712DomainChanged

MAY be emitted to signal that the domain could have changed.

Initialized

Triggered when the contract has been initialized or reinitialized.

Parameters

Name
Type
Description

version

uint64

undefined

StrategVaultUpdate

Emitted when a StrategVault is updated.

Parameters

Name
Type
Description

update indexed

enum IStrategVault.StrategVaultUpdateType

The type of update being performed.

data

bytes

Data relevant to the update.

Transfer

Emitted when value tokens are moved from one account (from) to another (to). Note that value may be zero.

Parameters

Name
Type
Description

from indexed

address

undefined

to indexed

address

undefined

value

uint256

undefined

Withdraw

Parameters

Name
Type
Description

sender indexed

address

undefined

receiver indexed

address

undefined

owner indexed

address

undefined

assets

uint256

undefined

shares

uint256

undefined

Errors

AddressEmptyCode

There's no code at target (it is not a contract).

Parameters

Name
Type
Description

target

address

undefined

AddressInsufficientBalance

The ETH balance of the account is not enough to perform the operation.

Parameters

Name
Type
Description

account

address

undefined

BlockListNotValid

Error triggered when you try to include not approved block in a vault strategy

DepositMoreThanMax

Error triggered when you try to deposit more than the maximum of assets depositable

ECDSAInvalidSignature

The signature derives the address(0).

ECDSAInvalidSignatureLength

The signature has an invalid length.

Parameters

Name
Type
Description

length

uint256

undefined

ECDSAInvalidSignatureS

The signature has an S value that is in the upper half order.

Parameters

Name
Type
Description

s

bytes32

undefined

ERC20InsufficientAllowance

Indicates a failure with the spender’s allowance. Used in transfers.

Parameters

Name
Type
Description

spender

address

Address that may be allowed to operate on tokens without being their owner.

allowance

uint256

Amount of tokens a spender is allowed to operate with.

needed

uint256

Minimum amount required to perform a transfer.

ERC20InsufficientBalance

Indicates an error related to the current balance of a sender. Used in transfers.

Parameters

Name
Type
Description

sender

address

Address whose tokens are being transferred.

balance

uint256

Current balance for the interacting account.

needed

uint256

Minimum amount required to perform a transfer.

ERC20InvalidApprover

Indicates a failure with the approver of a token to be approved. Used in approvals.

Parameters

Name
Type
Description

approver

address

Address initiating an approval operation.

ERC20InvalidReceiver

Indicates a failure with the token receiver. Used in transfers.

Parameters

Name
Type
Description

receiver

address

Address to which tokens are being transferred.

ERC20InvalidSender

Indicates a failure with the token sender. Used in transfers.

Parameters

Name
Type
Description

sender

address

Address whose tokens are being transferred.

ERC20InvalidSpender

Indicates a failure with the spender to be approved. Used in approvals.

Parameters

Name
Type
Description

spender

address

Address that may be allowed to operate on tokens without being their owner.

ERC2612ExpiredSignature

Permit deadline has expired.

Parameters

Name
Type
Description

deadline

uint256

undefined

ERC2612InvalidSigner

Mismatched signature.

Parameters

Name
Type
Description

signer

address

undefined

owner

address

undefined

ERC4626ExceededMaxDeposit

Attempted to deposit more assets than the max amount for receiver.

Parameters

Name
Type
Description

receiver

address

undefined

assets

uint256

undefined

max

uint256

undefined

ERC4626ExceededMaxMint

Attempted to mint more shares than the max amount for receiver.

Parameters

Name
Type
Description

receiver

address

undefined

shares

uint256

undefined

max

uint256

undefined

ERC4626ExceededMaxRedeem

Attempted to redeem more shares than the max amount for receiver.

Parameters

Name
Type
Description

owner

address

undefined

shares

uint256

undefined

max

uint256

undefined

ERC4626ExceededMaxWithdraw

Attempted to withdraw more assets than the max amount for receiver.

Parameters

Name
Type
Description

owner

address

undefined

assets

uint256

undefined

max

uint256

undefined

FailedInnerCall

A call to an address target failed. The target may have reverted.

HarvestReverted

Error triggered when the harvest function reverts

Parameters

Name
Type
Description

_block

address

The address of the harvest block

_index

uint256

The index of the harvest block

_data

bytes

The data associated with the revert

HoldAmountNotReached

Error thrown when the required hold amount is not reached.

HookReverted

Error triggered when the hook function reverts

Parameters

Name
Type
Description

_block

address

The address of the harvest block

_index

uint256

The index of the harvest block

_data

bytes

The data associated with the revert

InvalidAccountNonce

The nonce used for an account is not the expected current nonce.

Parameters

Name
Type
Description

account

address

undefined

currentNonce

uint256

undefined

InvalidInitialization

The contract is already initialized.

MathOverflowedMulDiv

Muldiv operation overflow.

MaxUserDepositReached

Error thrown when the user's maximum deposit amount is reached.

MaxVaultDepositReached

Error thrown when the vault's maximum deposit amount is reached.

MinDepositNotReached

Error thrown when the minimum deposit amount is not reached.

NoSharesMinted

Error triggered when you try to deposit and the amount of share is 0

NotFactory

Error thrown when the caller is not the factory contract.

NotInitializing

The contract is not initializing.

NotOperator

Error triggered on operator proxy reserved function when the sender is not the proxy

NotOwner

Error thrown when the caller is not the owner.

NotPositionManager

Error triggered on position manager reserved function when the sender is not a position manager

NotWhitelisted

Error thrown when the caller is not whitelisted.

ReentrancyGuardReentrantCall

Unauthorized reentrant call.

SafeERC20FailedOperation

An operation with an ERC20 token failed.

Parameters

Name
Type
Description

token

address

undefined

StrategyAlreadyInitialized

Error triggered when you try to setup the vault strategy a second time

StrategyEnterReverted

Error triggered when the strategy enter function reverts

Parameters

Name
Type
Description

_block

address

The address of the strategy block

_index

uint256

The index of the strategy block

_data

bytes

The data associated with the revert

StrategyExitReverted

Error triggered when the strategy exit function reverts

Parameters

Name
Type
Description

_block

address

The address of the strategy block

_index

uint256

The index of the strategy block

_data

bytes

The data associated with the revert

StrategyNotInitialized

Error triggered on strategy related function when strategy isn't set

TimelockNotReached

Error thrown when the timelock for withdrawal has not been reached.

WithdrawMoreThanMax

Error triggered when you try to withdraw more than the maximum of assets withdrawable

WithdrawalRebalanceIssue

Error triggered when there is an issue during the withdrawal rebalance

Last updated