View Source: contracts/Dependencies/IERC2612.sol
↘ Derived Contracts: IZUSDToken
IERC2612
Interface of the ERC2612 standard as defined in the EIP. Adds the {permit} method, which can be used to change one's {IERC20-allowance} without having to send a transaction, by signing a message. This allows users to spend tokens without having to hold Ether. See https://eips.ethereum.org/EIPS/eip-2612.
Code adapted from OpenZeppelin/openzeppelin-contracts#2237
- permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
- nonces(address owner)
- version()
- permitTypeHash()
- domainSeparator()
Sets amount
as the allowance of spender
over owner
's tokens,
given owner
's signed approval.
IMPORTANT: The same issues {IERC20-approve} has related to transaction
ordering also apply here.
Emits an {Approval} event.
Requirements:
owner
cannot be the zero address.spender
cannot be the zero address.deadline
must be a timestamp in the future.v
,r
ands
must be a validsecp256k1
signature fromowner
over the EIP712-formatted function arguments.- the signature must use
owner
's current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section].
function permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
owner | address | |
spender | address | |
amount | uint256 | |
deadline | uint256 | |
v | uint8 | |
r | bytes32 | |
s | bytes32 |
Source Code
function permit(address owner, address spender, uint256 amount,
uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
Returns the current ERC2612 nonce for owner
. This value must be
included whenever a signature is generated for {permit}.
Every successful call to {permit} increases owner
's nonce by one. This
prevents a signature from being used multiple times.
owner
can limit the time a Permit is valid for by setting deadline
to
a value in the near future. The deadline argument can be set to uint(-1) to
create Permits that effectively never expire.
function nonces(address owner) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
owner | address |
Source Code
function nonces(address owner) external view returns (uint256);
function version() external view
returns(string)
Source Code
function version() external view returns (string memory);
function permitTypeHash() external view
returns(bytes32)
Source Code
function permitTypeHash() external view returns (bytes32);
function domainSeparator() external view
returns(bytes32)
Source Code
function domainSeparator() external view returns (bytes32);
- ActivePool
- ActivePoolStorage
- BaseMath
- BorrowerOperations
- BorrowerOperationsScript
- BorrowerOperationsStorage
- BorrowerWrappersScript
- CheckContract
- CollSurplusPool
- CollSurplusPoolStorage
- console
- Context
- DefaultPool
- DefaultPoolStorage
- DocsCover
- DSAuth
- DSAuthEvents
- DSAuthority
- DSNote
- DSProxy
- DSProxyCache
- DSProxyFactory
- ERC20
- ETHTransferScript
- FeeDistributor
- FeeDistributorStorage
- GasPool
- HintHelpers
- HintHelpersStorage
- IActivePool
- IBalanceRedirectPresale
- IBorrowerOperations
- ICollSurplusPool
- IDefaultPool
- IERC20
- IERC2612
- IExternalPriceFeed
- IFeeDistributor
- IFeeSharingProxy
- ILiquityBase
- ILiquityBaseParams
- IMasset
- IMoCBaseOracle
- Initializable
- IPool
- IPriceFeed
- IRSKOracle
- ISortedTroves
- IStabilityPool
- ITroveManager
- IWrbtc
- IZUSDToken
- LiquityBase
- LiquityBaseParams
- LiquityMath
- LiquitySafeMath128
- MoCMedianizer
- MultiTroveGetter
- MultiTroveGetterStorage
- NueToken
- Ownable
- PriceFeed
- PriceFeedStorage
- ProxiableContract
- ProxiableContract2
- Proxy
- RskOracle
- SafeMath
- SortedTroves
- SortedTrovesStorage
- StabilityPool
- StabilityPoolScript
- StabilityPoolStorage
- Storage
- Storage2
- TokenScript
- TroveManager
- TroveManagerBase
- TroveManagerBase1MinuteBootstrap
- TroveManagerRedeemOps
- TroveManagerScript
- TroveManagerStorage
- UpgradableProxy
- ZUSDToken
- ZUSDTokenStorage