ERC20PermitFacet
Asset Tokenization Studio Team
ERC20PermitFacet
Diamond facet exposing ERC-2612 permit-based gasless approval operations, registered under RESOLVER_KEY_ERC20PERMIT.
Methods
getStaticFunctionSelectors
function getStaticFunctionSelectors() external pure returns (bytes4[])
Gets all function selectors of a facet
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes4[] | Face functions selectors |
getStaticInterfaceIds
function getStaticInterfaceIds() external pure returns (bytes4[])
Gets all interfaces ids of a facet.
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes4[] | Face interface ids |
getStaticResolverKey
function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)
Gets the static resolver key
Returns
| Name | Type | Description |
|---|---|---|
| staticResolverKey_ | bytes32 | Static resolver key |
initializeERC20Permit
function initializeERC20Permit() external nonpayable
Initialises the ERC20 permit capability on the token.
Restricted to DEFAULT_ADMIN_ROLE by the implementation. Callable once and expected to revert with FacetAlreadyRegistered on subsequent calls. Emits ERC20PermitInitialized on success.
permit
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
Approves a spender using an owner's off-chain ERC-2612 signature.
Validates the deadline, owner nonce, EIP-712 digest, and recovered signer before updating allowance. Reverts with ERC2612ExpiredSignature or ERC2612InvalidSigner when validation fails.
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined |
| spender | address | undefined |
| value | uint256 | undefined |
| deadline | uint256 | undefined |
| v | uint8 | undefined |
| r | bytes32 | undefined |
| s | bytes32 | undefined |
Events
Approval
event Approval(address indexed owner, address indexed spender, uint256 value)
Emitted when owner authorises spender to spend up to value tokens on their behalf, whether via {IAllowance.approve}, {IAllowance.increaseAllowance} or {IAllowance.decreaseAllowance}.
Mirrors the ERC-20 Approval event. value is the resulting, absolute allowance after the update — not the delta applied.
Parameters
| Name | Type | Description |
|---|---|---|
owner indexed | address | Address whose tokens may be spent. |
spender indexed | address | Address authorised to spend on owner's behalf. |
| value | uint256 | Allowance of spender over owner's tokens after the update. |
ERC20PermitInitialized
event ERC20PermitInitialized()
Emitted once when the ERC20 permit capability is initialised on a token.
Fires exclusively from initializeERC20Permit after successful facet registration.
Transfer
event Transfer(address indexed from, address indexed to, uint256 value)
Emitted whenever tokens move between accounts, are minted, or are burned.
Parameters
| Name | Type | Description |
|---|---|---|
from indexed | address | Source account (zero address on mint). |
to indexed | address | Destination account (zero address on burn). |
| value | uint256 | Amount of tokens transferred. |
TransferByPartition
event TransferByPartition(bytes32 indexed fromPartition, address operator, address indexed from, address indexed to, uint256 value, bytes data, bytes operatorData)
Emitted when tokens are transferred from one partition to another or within the same partition.
Parameters
| Name | Type | Description |
|---|---|---|
fromPartition indexed | bytes32 | Source partition. |
| operator | address | Address that initiated the transfer. |
from indexed | address | Token holder whose balance decreased. |
to indexed | address | Recipient whose balance increased. |
| value | uint256 | Token quantity transferred. |
| data | bytes | Caller-supplied data. |
| operatorData | bytes | Operator-supplied data. |
Errors
AccountHasNoRole
error AccountHasNoRole(address account, bytes32 role)
Thrown when an account does not hold a required role.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account that lacks the role. |
| role | bytes32 | The role that is not held. |
AssetNotOperational
error AssetNotOperational(bytes32 configId, uint256 versionId)
Raised by InitializerStorageWrapper.checkOperational (and the related isConfigVersionOperational helper) when an operation is attempted on a configuration version that has not yet been marked operational.
Parameters
| Name | Type | Description |
|---|---|---|
| configId | bytes32 | Resolver-proxy configuration whose operational status was checked. |
| versionId | uint256 | Configuration version whose operational status was checked. |
Deactivated
error Deactivated()
Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.
ERC2612ExpiredSignature
error ERC2612ExpiredSignature(uint256 deadline)
Raised when a permit signature is submitted after its expiry deadline.
The permit must not mutate allowance state when the deadline has passed.
Parameters
| Name | Type | Description |
|---|---|---|
| deadline | uint256 | Timestamp after which the permit is no longer valid. |
ERC2612InvalidSigner
error ERC2612InvalidSigner(address signer, address owner)
Raised when the recovered permit signer does not match the token owner.
Protects approvals from invalid, malformed, or unauthorised signatures.
Parameters
| Name | Type | Description |
|---|---|---|
| signer | address | Address recovered from the submitted permit signature. |
| owner | address | Address expected to have authorised the permit. |
FacetAlreadyRegistered
error FacetAlreadyRegistered(bytes32 facetId, uint256 lastVersion)
Raised when an initialiser tries to register a facet that already has a non-zero last registered version (i.e. the facet is being re-initialised on a fresh install).
Parameters
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Identifier of the offending facet. |
| lastVersion | uint256 | Last version recorded for that facet at the time of the check. |
IsPaused
error IsPaused()
Thrown when an operation that requires the token to be unpaused is attempted while the token is paused (own flag or any external pause contract).
NotAllowedInMultiPartitionMode
error NotAllowedInMultiPartitionMode()
Thrown when a single-partition operation is attempted on a multi-partition token.
SpenderWithZeroAddress
error SpenderWithZeroAddress()
Reverts when the zero address is supplied as spender in an allowance update.
UnexpectedError
error UnexpectedError(bytes4 _errorId)
Reverts when an unreachable validation state is detected.
Replaces assertions for defensive handling of logically impossible states.
Parameters
| Name | Type | Description |
|---|---|---|
| _errorId | bytes4 | Identifier of the unexpected validation condition. |
UnrecognizedResolverProxyVersion
error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)
Thrown when the provided proxy version does not match any BLR compatible standard.
Parameters
| Name | Type | Description |
|---|---|---|
| _resolverProxyVersion | bytes8 | proxy version that is not compatible with the BLR. |
WalletRecovered
error WalletRecovered()
Thrown when attempting to recover a wallet that has already been recovered.
ZeroAddressNotAllowed
error ZeroAddressNotAllowed()
Reverts when the zero address is supplied where it is not permitted.
Prevents invalid account, contract, or recipient references.