Step 2: WHAT What do you want to gate?
Guards can be set up at the smart contract level to prevent actions from happening if users do not comply with the Policy. The guarding contract verifies that the parties have on-chain Credentials to proceed, preventing unauthorised actions from taking place.
There are multiple options to implement contract permissioning. Here are some initial questions to consider:
Do you have multiple contracts to gate?
Do you need different Policies?
Is the contract you want to gate deployed, or is it a new contract?
What do you want to keep as "open" functions vs. "gated" functions?
Do you want to gate different functions with different Policies?
Examples of functions you can gate:
Asset: Apply the guard at the asset level, so it travels across venues and hands.
ERC20 Token : transfer
, transferFrom
, mint
and burn
.
Instead of embedding a modifier in the token code, you can use an ERC20 Wrapper on top of an existing asset, with permissioned or permissionless wrap
/unwrap
. This allows you to add permissioning while leaving the underlying asset's code untouched.
ERC4626 Vault : mint
, redeem
, deposit
, withdraw
. Gate core functions. You can also permission just the transfer out functions (redeem
and withdraw
) to have a permissionless entry and permissioned exit from the protocol.
ERC721 / ERC1155 : Permission NFTs by adding controls to transfer
or mint
functions.
Pool : swap
, addLiquidity
, removeLiquidity
.
Subnet : block_publication
.
Last updated 3 months ago