ERC20PermitLib
Title: ERC20PermitLib
Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/ERC20Permit.sol)
Library implementing ERC-2612 permit-based approvals for ERC-20 tokens.
No own storage — relies on EIP712 and Nonces slots already present.
Functions
__ERC20Permit_init
Registers the IERC20Permit interface for ERC-165 discovery.
No own storage to initialize. EIP712 and Nonces must be initialized separately.
function __ERC20Permit_init() internal;registerInterface
Registers support for the IERC20Permit interface via ERC-165.
function registerInterface() internal;permit
Sets approval via a signed permit.
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
internal;Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | The token owner granting the approval. |
| spender | address | The address being approved. |
| value | uint256 | The allowance amount. |
| deadline | uint256 | The block.timestamp after which the signature is invalid. |
| v | uint8 | Signature component. |
| r | bytes32 | Signature component. |
| s | bytes32 | Signature component. |