ERC721_GatedAccess
ERC721_GatedAccess is an integration mandate that gates access to a role based on ERC721 token ownership. If the caller holds at least the configured minimum number of tokens, the role is assigned to them.
Overview
Section titled “Overview”This mandate provides a simple token-gated onboarding mechanism. It checks the caller’s ERC721 balance and, if they meet the minimum threshold, assigns a configured role to them on the Powers contract.
Configuration
Section titled “Configuration”When adopting an ERC721_GatedAccess instance, the following parameters are required:
erc721Address(address): The address of the ERC721 token contract.assignRoleId(uint256): The role ID to assign if the check passes.minBalance(uint256): The minimum number of ERC721 tokens the caller must hold.
Proposing an Action
Section titled “Proposing an Action”This mandate does not require any input parameters. The caller simply submits the action and the mandate checks their token balance.
Execution Flow
Section titled “Execution Flow”-
Balance Check
- Calls
balanceOf(caller)on the ERC721 contract. - Reverts with
"Insufficient ERC721 balance"if the caller holds fewer tokens thanminBalance.
- Calls
-
Role Assignment
- If the check passes, generates an
assignRolecall forassignRoleIdtargeting the caller.
- If the check passes, generates an
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”handleRequest
Section titled “handleRequest”function handleRequest(...) public view override returns (...)- Checks the caller’s ERC721 balance.
- Returns the role assignment call if the check passes.
Error Conditions
Section titled “Error Conditions”"Insufficient ERC721 balance"— The caller does not hold the minimum required number of ERC721 tokens.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|