SelfPermit

Self Permit

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

Developer note: 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

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

Permits this contract to spend a given token from `msg.sender` Developer note: The `owner` is always msg.sender and the `spender` is always address(this).

selfPermitIfNecessary

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

Permits this contract to spend a given token from `msg.sender` Developer note: The `owner` is always msg.sender and the `spender` is always address(this). Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit

selfPermitAllowed

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

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter Developer note: The `owner` is always msg.sender and the `spender` is always address(this)

selfPermitAllowedIfNecessary

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

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter Developer note: The `owner` is always msg.sender and the `spender` is always address(this) Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed.