Skip to content
Lattice

IERC1271

Git Source

Title: IERC1271 — Standard signature validation for contracts

Author: Vendored from OpenZeppelin Contracts contracts/interfaces/IERC1271.sol (MIT). Vendored subset —

do not add an openzeppelin-contracts dependency.

ERC-1271: lets a contract declare a signature valid. dapps (permits, Seaport, Permit2) call this.

Functions

isValidSignature

Returns 0x1626ba7e when signature is a valid signature over hash for this contract.

The magic value is bytes4(keccak256("isValidSignature(bytes32,bytes)")). Any other return (or a revert) means invalid.

function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);

Parameters

NameTypeDescription
hashbytes32The hash of the signed data.
signaturebytesThe signature bytes (opaque; format is account-defined).

Returns

NameTypeDescription
magicValuebytes40x1626ba7e if valid, any other value otherwise.