ERCs

ERC-4494 — Permit for ERC-721

eips.ethereum.org/EIPS/eip-4494

ERC-2612 permit ported to NFTs. The owner signs an off-chain authorization for a specific tokenId; any party submits the permit to authorize the spender.

import { permit, nonces, DOMAIN_SEPARATOR } from "@ethernauta/erc/4494";

const hash = await permit({
  spender,
  token_id,
  deadline,
  sig,  // 65-byte signature
})(signer({ chain_id: eip155_1.chain_id, contract: collection }));

Surface

MethodShapePurpose
permit({ spender, token_id, deadline, sig })Signable<Hash32>Submit the permit.
nonces({ token_id })Callable<Uint256>Per-token nonce.
DOMAIN_SEPARATOR()Callable<Bytes32>EIP-712 domain.

See also