Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

LimitConfigTrait

Sets limits to the target exchange type and is expected to be defined at the contract level.

It’s important to note that these limits correspond directly to the max_<OPERATION> i.e. deposit_limit -> max_deposit.

The EIP-4626 spec states that the max_<OPERATION> methods must take into account all global and user-specific limits. If an operation is disabled (even temporarily), the corresponding limit MUST be 0 and MUST NOT panic.

Fully qualified path: openzeppelin_token::erc20::extensions::erc4626::erc4626::ERC4626Component::LimitConfigTrait

pub trait LimitConfigTrait<TContractState, +HasComponent<TContractState>>

Trait functions

deposit_limit

The max deposit allowed. Defaults (Option::None) to 2 ** 256 - 1.

Fully qualified path: openzeppelin_token::erc20::extensions::erc4626::erc4626::ERC4626Component::LimitConfigTrait::deposit_limit

fn deposit_limit(self: @ComponentState<TContractState>, receiver: ContractAddress) -> Option<u256>

mint_limit

The max mint allowed. Defaults (Option::None) to 2 ** 256 - 1.

Fully qualified path: openzeppelin_token::erc20::extensions::erc4626::erc4626::ERC4626Component::LimitConfigTrait::mint_limit

fn mint_limit(self: @ComponentState<TContractState>, receiver: ContractAddress) -> Option<u256>

withdraw_limit

The max withdraw allowed. Defaults (Option::None) to the full asset balance of owner converted from shares.

Fully qualified path: openzeppelin_token::erc20::extensions::erc4626::erc4626::ERC4626Component::LimitConfigTrait::withdraw_limit

fn withdraw_limit(self: @ComponentState<TContractState>, owner: ContractAddress) -> Option<u256>

redeem_limit

The max redeem allowed. Defaults (Option::None) to the full asset balance of owner.

Fully qualified path: openzeppelin_token::erc20::extensions::erc4626::erc4626::ERC4626Component::LimitConfigTrait::redeem_limit

fn redeem_limit(self: @ComponentState<TContractState>, owner: ContractAddress) -> Option<u256>