Skip to main content

PermitAndMulticall

Git Source

Allows a user to permit token spend and then call multiple functions on a contract.

Functions

_multicall

Allows a user to call multiple functions on the same contract. Useful for EOA who want to batch transactions.

function _multicall(bytes[] calldata _data) internal virtual returns (bytes[] memory);

Parameters

NameTypeDescription
_databytes[]An array of encoded function calls. The calls must be abi-encoded calls to this contract.

Returns

NameTypeDescription
<none>bytes[]The results from each function call

_permitAndMulticall

Allow a user to approve an ERC20 token and run various calls in one transaction.

function _permitAndMulticall(
IERC20Permit _permitToken,
uint256 _amount,
Signature calldata _permitSignature,
bytes[] calldata _data
) internal;

Parameters

NameTypeDescription
_permitTokenIERC20PermitAddress of the ERC20 token
_amountuint256Amount of tickets to approve
_permitSignatureSignaturePermit signature
_databytes[]Datas to call with functionDelegateCall

Structs

Signature

Secp256k1 signature values.

struct Signature {
uint256 deadline;
uint8 v;
bytes32 r;
bytes32 s;
}

Properties

NameTypeDescription
deadlineuint256Timestamp at which the signature expires
vuint8v portion of the signature
rbytes32r portion of the signature
sbytes32s portion of the signature