Entry/Exit Guards - Implementation
Entry and Exit Guards are a set of predefined but customizable checks that can be put on users their actions, like depositing into a Smart Vault or withdrawing from it. These checks are selected and configured during the Smart Vault Creation Process.
The guards can use the data connected with the action or can call view functions of external contracts and the main effect of a guard is to prevent a certain action if the specified condition is not met.
However, some guards can have additional side effects, such as making the associated Deposit NFT token non-transferrable. Guards implementations are at their core conditionals and implemented as view-only functions - they don’t allow changing state.
The majority of guards can be defined using a set of metadata properties:
Smart Contract to invoke
Smart Contract method to invoke
Method parameters needed
Comparison operator
Value to compare the result with other guards will be use-case specific implementations, each being their own smart contract.
Examples of entry guards are:
The user must be on a specific allow-list
The user must own a specific NFT
The user must have a certain amount of specific tokens
Examples of exit guards are:
The user must wait a certain amount of time before the withdrawal
Last updated