Skip to main content

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

Checks nonce and returns true if used already for a specific address.

function isUsedNonce(address _associatedAddress,
uint256 _nonce)
external
view
returns(bool)

Arguments

NameTypeDescription
_associatedAddressaddressthe address for which the nonce should be checked
_nonceuint256the 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

NameTypeDescription
_userAddressaddressthe sender of the transaction
_functionNamestringthe name of the function to be executed
_functionSignaturebytesthe function signature
_nonceuint256the nonce value of the transaction
_sigRbytes32r part of the signer's signature
_sigSbytes32s part of the signer's signature
_sigVuint8v 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

NameTypeDescription
_functionNameHashesbytes32[]a list of hashed function names (keccak256)
_isAllowlistedboolnew allowlist status

isFunctionAllowlisted

Tells if function can be executed as meta transaction or not.

function isFunctionAllowlisted(bytes32 _functionNameHash) 
external
view
returns(bool isAllowlisted)

Arguments

NameTypeDescription
_functionNameHashbytes32hashed function name (keccak256)

Returns

NameTypeDescription
isAllowlistedboolallowlist status

isFunctionAllowlisted

Tells if function can be executed as meta transaction or not.

function isFunctionAllowlisted(string _functionName) 
external
view
returns(bool isAllowlisted)

Arguments

NameTypeDescription
_functionNamestringfunction name

Returns

NameTypeDescription
isAllowlistedboolallowlist status