SelfPermit

Inherits: ISelfPermit

Functionality to call permit on any EIP-2612-compliant token for use in the route.

These functions are expected to be embedded in multicalls to allow EOAs to approve a contract and call a function that requires an approval in a single transaction.

Functions

selfPermit

Allows the contract to call the permit function on the specified token.

function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
    public
    payable
    override;

Parameters

NameTypeDescription

token

address

The address of the token to permit.

value

uint256

The amount to permit.

deadline

uint256

The deadline for the permit.

v

uint8

The v value from the permit signature.

r

bytes32

The r value from the permit signature.

s

bytes32

The s value from the permit signature.

selfPermitIfNecessary

Allows the contract to call selfPermit if necessary based on the token's allowance.

function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
    external
    payable
    override;

Parameters

NameTypeDescription

token

address

The address of the token to permit.

value

uint256

The amount to permit.

deadline

uint256

The deadline for the permit.

v

uint8

The v value from the permit signature.

r

bytes32

The r value from the permit signature.

s

bytes32

The s value from the permit signature.

selfPermitAllowed

Allows the contract to call the permit function with unlimited allowance on the specified token.

function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
    public
    payable
    override;

Parameters

NameTypeDescription

token

address

The address of the token to permit.

nonce

uint256

The nonce for the permit.

expiry

uint256

The expiry time for the permit.

v

uint8

The v value from the permit signature.

r

bytes32

The r value from the permit signature.

s

bytes32

The s value from the permit signature.

selfPermitAllowedIfNecessary

Allows the contract to call selfPermitAllowed if necessary based on the token's allowance.

function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
    external
    payable
    override;

Parameters

NameTypeDescription

token

address

The address of the token to permit.

nonce

uint256

The nonce for the permit.

expiry

uint256

The expiry time for the permit.

v

uint8

The v value from the permit signature.

r

bytes32

The r value from the permit signature.

s

bytes32

The s value from the permit signature.

Last updated