StrategUserInteractions
Additional contract to implement permit1, permit2 and ERC2771 features. It is used as main user interactions contract
Methods
addressProvider
function addressProvider() external view returns (contract IStrategAddressesProvider)
The address provider contract.
Returns
_0
contract IStrategAddressesProvider
undefined
authority
function authority() external view returns (address)
Returns the current authority.
Returns
_0
address
undefined
claimERC3525Rewards
function claimERC3525Rewards(address[] _erc3525s, uint256[] _tokenIds) external nonpayable
Claims rewards for ERC3525 tokens.
Parameters
_erc3525s
address[]
The addresses of the ERC3525 tokens for which to claim rewards.
_tokenIds
uint256[]
The token IDs for which to claim rewards.
deployNewVault
function deployNewVault(string _name, string _symbol, address _asset, uint256 _strategy, uint256 _bufferSize, uint256 _creatorFees, uint256 _harvestFees, string _ipfsHash) external nonpayable
Deploys a new vault with the specified parameters.
This function calls the factory contract to create a new vault.
Parameters
_name
string
The name of the new vault.
_symbol
string
The symbol of the new vault.
_asset
address
The address of the asset token for the vault.
_strategy
uint256
The identifier for the strategy to be used by the vault.
_bufferSize
uint256
The size of the buffer for the vault.
_creatorFees
uint256
The fees to be paid to the creator of the vault.
_harvestFees
uint256
The fees to be paid for harvesting the vault.
_ipfsHash
string
The IPFS hash containing additional information about the vault.
editVaultParams
function editVaultParams(address _vault, enum IStrategVault.StrategVaultSettings[] settings, bytes[] data) external nonpayable
Edits the parameters of an existing vault.
Parameters
_vault
address
The address of the vault to be edited.
settings
enum IStrategVault.StrategVaultSettings[]
An array of StrategVaultSettings indicating which settings to edit.
data
bytes[]
An array of bytes data corresponding to each setting in settings
.
executeVaultParamsEdit
function executeVaultParamsEdit(address _vault, uint256 _index) external nonpayable
Edits the parameters of an existing vault.
Parameters
_vault
address
The address of the vault to be edited.
_index
uint256
An array of bytes data corresponding to each setting in settings
.
isConsumingScheduledOp
function isConsumingScheduledOp() external view returns (bytes4)
Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs attacker controlled calls.
Returns
_0
bytes4
undefined
isTrustedForwarder
function isTrustedForwarder(address _forwarder) external view returns (bool)
Checks if the given address is a trusted forwarder.
Overrides the ERC2771Context isTrustedForwarder function to utilize the RELAYER_ROLE.
Parameters
_forwarder
address
The address to check.
Returns
_0
bool
bool True if the address has the RELAYER_ROLE, false otherwise.
portalVaultDeposit
function portalVaultDeposit(address _sender, address _vault, uint256 _assets, address _receiver) external nonpayable
Allows a user to deposit assets into a vault after a portal swap.
Parameters
_sender
address
The address of the vault where assets will be deposited.
_vault
address
The address of the vault where assets will be deposited.
_assets
uint256
The amount of assets to deposit.
_receiver
address
The vault shares receiver
setAuthority
function setAuthority(address newAuthority) external nonpayable
Transfers control to a new authority. The caller must be the current authority.
Parameters
newAuthority
address
undefined
setVaultStrategy
function setVaultStrategy(address vault, address[] _positionManagers, address[] _stratBlocks, bytes[] _stratBlocksParameters, bool[] _isFinalBlock, address[] _harvestBlocks, bytes[] _harvestBlocksParameters) external nonpayable
Sets the strategy for a given vault.
This function configures the strategy for a vault by specifying position managers, strategy blocks, their parameters, and harvest blocks.
Parameters
vault
address
The address of the vault for which the strategy is being set.
_positionManagers
address[]
An array of addresses for the position managers associated with the strategy.
_stratBlocks
address[]
An array of addresses for the strategy blocks to be used in the strategy.
_stratBlocksParameters
bytes[]
An array of bytes representing the parameters for each strategy block.
_isFinalBlock
bool[]
An array of booleans indicating whether each corresponding strategy block is a final block in the strategy.
_harvestBlocks
address[]
An array of addresses for the harvest blocks to be used in the strategy.
_harvestBlocksParameters
bytes[]
An array of bytes representing the parameters for each harvest block.
vaultDeposit
function vaultDeposit(address _vault, uint256 _assets, address _receiver, bytes _permitParams) external nonpayable
Allows a user to deposit assets into a vault.
Parameters
_vault
address
The address of the vault where assets will be deposited.
_assets
uint256
The amount of assets to deposit.
_receiver
address
undefined
_permitParams
bytes
The permit parameters for approving the vault to spend assets on behalf of the sender.
vaultRedeem
function vaultRedeem(address _vault, uint256 _shares, bytes _permitParams) external nonpayable
Redeems shares from the vault and sends the underlying assets to the sender.
Parameters
_vault
address
The address of the vault from which to redeem shares.
_shares
uint256
The amount of shares to redeem.
_permitParams
bytes
The permit parameters for approving the vault to spend shares on behalf of the sender.
vaultWithdrawalRebalance
function vaultWithdrawalRebalance(address _vault, uint256 _deadline, uint256 _amount, bytes _signature, bytes _portalPayload, bytes _permitParams, uint256[] _dynParamsIndexExit, bytes[] _dynParamsExit) external payable returns (uint256 returnedAssets)
Performs a withdrawal rebalance operation on the vault.
Parameters
_vault
address
The address of the vault to perform the withdrawal rebalance on.
_deadline
uint256
The deadline by which the operation must be completed.
_amount
uint256
The amount to withdraw from the vault.
_signature
bytes
The signature for permit-based withdrawals.
_portalPayload
bytes
The payload for interacting with external protocols during the rebalance.
_permitParams
bytes
The permit parameters for approving the vault to spend tokens on behalf of the sender.
_dynParamsIndexExit
uint256[]
Dynamic parameters index for exiting strategies.
_dynParamsExit
bytes[]
Dynamic parameters for exiting strategies.
Returns
returnedAssets
uint256
undefined
Events
AuthorityUpdated
event AuthorityUpdated(address authority)
Authority that manages this contract was updated.
Parameters
authority
address
undefined
Errors
AccessManagedInvalidAuthority
error AccessManagedInvalidAuthority(address authority)
Parameters
authority
address
undefined
AccessManagedRequiredDelay
error AccessManagedRequiredDelay(address caller, uint32 delay)
Parameters
caller
address
undefined
delay
uint32
undefined
AccessManagedUnauthorized
error AccessManagedUnauthorized(address caller)
Parameters
caller
address
undefined
AddressEmptyCode
error AddressEmptyCode(address target)
There's no code at target
(it is not a contract).
Parameters
target
address
undefined
AddressInsufficientBalance
error AddressInsufficientBalance(address account)
The ETH balance of the account is not enough to perform the operation.
Parameters
account
address
undefined
BadInput
error BadInput()
Triggered when functions inputs are invalid
FailedInnerCall
error FailedInnerCall()
A call to an address target failed. The target may have reverted.
NotPortal
error NotPortal()
Triggered when function caller is not the portal
SafeERC20FailedOperation
error SafeERC20FailedOperation(address token)
An operation with an ERC20 token failed.
Parameters
token
address
undefined
Last updated