GovernedToken_BurnToAccess
GovernedToken_BurnToAccess is an integration mandate that gates access by requiring the caller to burn a token. It works with both ERC1155 (Soulbound1155) and ERC721 (Governed721) tokens. Burning the token is the price of admission for the subsequent action.
Overview
Section titled “Overview”This mandate is useful for throttling access — for example, requiring members to spend a token earned through participation in order to trigger a privileged action. The mandate auto-detects whether the configured token is ERC1155 or ERC721 and burns accordingly.
Configuration
Section titled “Configuration”When adopting a GovernedToken_BurnToAccess instance, the following parameters are required:
inputParams(string[]): UI hints for any additional parameters the caller must provide (beyond the requiredtokenId).governedTokenAddress(address): The address of the ERC1155 or ERC721 token contract.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, the following input must be provided:
- Any additional parameters defined in
inputParams. tokenId(uint256): The ID of the token to burn. This is always appended as the last input parameter.
Execution Flow
Section titled “Execution Flow”-
Token Type Detection
- Calls
supportsInterface(IERC1155)on the token contract. - If ERC1155: checks the caller’s balance for
tokenId. Reverts with"Insufficient balance"if zero. - If ERC721: checks ownership of
tokenId. Reverts with"Not token owner"if the caller is not the owner.
- Calls
-
Burn
- ERC1155: calls
burn(caller, tokenId, 1). - ERC721: calls
burn(tokenId).
- ERC1155: calls
Error Conditions
Section titled “Error Conditions”"Insufficient balance"— The caller does not hold the ERC1155 token."Not token owner"— The caller does not own the ERC721 token."Invalid token contract"— The token contract does not support ERC1155 or ERC721.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|