ERC20PermitUser

Git Source

Author: See https://github.com/agglayer/vault-bridge

Mimics the behavior of LxLy Bridge for validating and using ERC-20 permits.

State Variables

_PERMIT_SELECTOR_ERC_2612

Calculated as bytes4(keccak256(bytes("permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"))).

bytes4 private constant _PERMIT_SELECTOR_ERC_2612 = hex"d505accf";

_PERMIT_SELECTOR_DAI

bytes4 private constant _PERMIT_SELECTOR_DAI = hex"8fcbaf0c";

Functions

_permit

function _permit(address token, uint256 minimumAmount, bytes calldata permitData) internal;

Errors

InvalidOwnerInERC20Permit

error InvalidOwnerInERC20Permit(address owner, address expectedOwner);

InvalidSpenderInERC20Permit

error InvalidSpenderInERC20Permit(address spender, address expectedSpender);

InvalidAmountInERC20Permit

error InvalidAmountInERC20Permit(uint256 amount, uint256 minimumAmount);

InvalidSelectorInERC20Permit

error InvalidSelectorInERC20Permit(bytes4 selector);