GovernedToken_GatedAccess
GovernedToken_GatedAccess is an integration mandate that gates access to a role based on ownership of Soulbound1155 or Governed721 tokens. It supports optional checks on token freshness (block threshold) and the minter’s governance role.
Overview
Section titled “Overview”The mandate accepts a list of token IDs from the caller and validates each one against up to three checks. If a sufficient number of valid tokens are provided (meeting the configured threshold), the caller is assigned the target role.
Configuration
Section titled “Configuration”When adopting a GovernedToken_GatedAccess instance, the following parameters are required:
governedTokenAddress(address): The address of the ERC1155 or ERC721 token contract.assignRoleId(uint256): The role ID to assign if checks pass.checkRoleId(uint256): An optional role ID. If non-zero, the minter of each token must hold this role in the Powers contract.blocksThreshold(uint48): An optional block window. If non-zero, tokens minted more than this many blocks ago are rejected.tokensThreshold(uint48): The minimum number of valid tokens the caller must provide to pass.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, one parameter must be provided:
tokenIds(uint256[]): An array of token IDs to validate.
Execution Flow
Section titled “Execution Flow”For each token ID provided:
- Ownership Check — Verifies the caller owns the token (ERC1155 balance > 0 or ERC721 ownership).
- Block Threshold Check — If
blocksThreshold > 0, rejects tokens minted more thanblocksThresholdblocks ago. - Minter Role Check — If
checkRoleId > 0, verifies the token’s minter holdscheckRoleIdin the Powers contract.
If the count of valid tokens meets tokensThreshold, assigns assignRoleId to the caller.
Error Conditions
Section titled “Error Conditions”"Invalid token address or tokenId"— The token contract doesn’t support the token or it doesn’t exist."Insuffiicent valid tokens provided"— The caller did not provide enough valid tokens to meet the threshold.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|