IBosonMetaTransactionsHandler
View Source: contracts/interfaces/handlers/IBosonMetaTransactionsHandler.sol
↗ Extends: IBosonMetaTransactionsEvents
IBosonMetaTransactionsHandler
Manages incoming meta-transactions in the protocol.
The ERC-165 identifier for this interface is: 0xb3e4e803
Functions
- isUsedNonce(address _associatedAddress, uint256 _nonce)
- executeMetaTransaction(address _userAddress, string _functionName, bytes _functionSignature, uint256 _nonce, bytes32 _sigR, bytes32 _sigS, uint8 _sigV)
- setAllowlistedFunctions(bytes32[] _functionNameHashes, bool _isAllowlisted)
- isFunctionAllowlisted(bytes32 _functionNameHash)
- isFunctionAllowlisted(string _functionName)
isUsedNonce
Checks nonce and returns true if used already for a specific address.
function isUsedNonce(address _associatedAddress,
uint256 _nonce)
external
view
returns(bool)
Arguments
| Name | Type | Description |
|---|---|---|
| _associatedAddress | address | the address for which the nonce should be checked |
| _nonce | uint256 | the nonce that we want to check. |
Returns
bool
executeMetaTransaction
Handles the incoming meta transaction.
Reverts if:
- The meta-transactions region of protocol is paused
- Nonce is already used by the msg.sender for another transaction
- Function is not allowlisted to be called using metatransactions
- Function name does not match the bytes4 version of the function signature
- sender does not match the recovered signer
- Any code executed in the signed transaction reverts
- Signature is invalid
function executeMetaTransaction(address _userAddress,
string _functionName,
bytes _functionSignature,
uint256 _nonce,
bytes32 _sigR,
bytes32 _sigS,
uint8 _sigV)
external
payable
returns(bytes)
Arguments
| Name | Type | Description |
|---|---|---|
| _userAddress | address | the sender of the transaction |
| _functionName | string | the name of the function to be executed |
| _functionSignature | bytes | the function signature |
| _nonce | uint256 | the nonce value of the transaction |
| _sigR | bytes32 | r part of the signer's signature |
| _sigS | bytes32 | s part of the signer's signature |
| _sigV | uint8 | v part of the signer's signature |
Returns
bytes
setAllowlistedFunctions
Manages allow list of functions that can be executed using metatransactions.
Emits a FunctionsAllowlisted event if successful.
Reverts if:
- Caller is not a protocol admin
function setAllowlistedFunctions(bytes32[] _functionNameHashes,
bool _isAllowlisted)
external
Arguments
| Name | Type | Description |
|---|---|---|
| _functionNameHashes | bytes32[] | a list of hashed function names (keccak256) |
| _isAllowlisted | bool | new allowlist status |
isFunctionAllowlisted
Tells if function can be executed as meta transaction or not.
function isFunctionAllowlisted(bytes32 _functionNameHash)
external
view
returns(bool isAllowlisted)
Arguments
| Name | Type | Description |
|---|---|---|
| _functionNameHash | bytes32 | hashed function name (keccak256) |
Returns
| Name | Type | Description |
|---|---|---|
| isAllowlisted | bool | allowlist status |
isFunctionAllowlisted
Tells if function can be executed as meta transaction or not.
function isFunctionAllowlisted(string _functionName)
external
view
returns(bool isAllowlisted)
Arguments
| Name | Type | Description |
|---|---|---|
| _functionName | string | function name |
Returns
| Name | Type | Description |
|---|---|---|
| isAllowlisted | bool | allowlist status |