API reference v1.0
Introduction
periphery
tokenomics
SelfPermit

SelfPermit

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

selfPermit(address,uint256,uint256,uint8,bytes32,bytes32) payable public

Permits this contract to spend a given token from `msg.sender`

NameTypeDescription
tokenaddressThe address of the token spent
valueuint256The amount that can be spent of token
deadlineuint256A timestamp, the current blocktime must be less than or equal to this timestamp
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`

selfPermitIfNecessary

selfPermitIfNecessary(address,uint256,uint256,uint8,bytes32,bytes32) payable external

Permits this contract to spend a given token from `msg.sender`

NameTypeDescription
tokenaddressThe address of the token spent
valueuint256The amount that can be spent of token
deadlineuint256A timestamp, the current blocktime must be less than or equal to this timestamp
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`

selfPermitAllowed

selfPermitAllowed(address,uint256,uint256,uint8,bytes32,bytes32) payable public

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

NameTypeDescription
tokenaddressThe address of the token spent
nonceuint256The current nonce of the owner
expiryuint256The timestamp at which the permit is no longer valid
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`

selfPermitAllowedIfNecessary

selfPermitAllowedIfNecessary(address,uint256,uint256,uint8,bytes32,bytes32) payable external

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

NameTypeDescription
tokenaddressThe address of the token spent
nonceuint256The current nonce of the owner
expiryuint256The timestamp at which the permit is no longer valid
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`

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

selfPermit(address,uint256,uint256,uint8,bytes32,bytes32) payable public

Permits this contract to spend a given token from `msg.sender`

NameTypeDescription
tokenaddressThe address of the token spent
valueuint256The amount that can be spent of token
deadlineuint256A timestamp, the current blocktime must be less than or equal to this timestamp
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`

selfPermitIfNecessary

selfPermitIfNecessary(address,uint256,uint256,uint8,bytes32,bytes32) payable external

Permits this contract to spend a given token from `msg.sender`

NameTypeDescription
tokenaddressThe address of the token spent
valueuint256The amount that can be spent of token
deadlineuint256A timestamp, the current blocktime must be less than or equal to this timestamp
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`

selfPermitAllowed

selfPermitAllowed(address,uint256,uint256,uint8,bytes32,bytes32) payable public

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

NameTypeDescription
tokenaddressThe address of the token spent
nonceuint256The current nonce of the owner
expiryuint256The timestamp at which the permit is no longer valid
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`

selfPermitAllowedIfNecessary

selfPermitAllowedIfNecessary(address,uint256,uint256,uint8,bytes32,bytes32) payable external

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

NameTypeDescription
tokenaddressThe address of the token spent
nonceuint256The current nonce of the owner
expiryuint256The timestamp at which the permit is no longer valid
vuint8Must produce valid secp256k1 signature from the holder along with `r` and `s`
rbytes32Must produce valid secp256k1 signature from the holder along with `v` and `s`
sbytes32Must produce valid secp256k1 signature from the holder along with `r` and `v`