---
eip: 7604
label: ERC-7604
title: ERC-1155 Permit Approvals
status: Draft
type: Standards Track
category: ERC
created: 2024-01-27
requires: 165, 712, 1155, 1271, 2098, 5216
official: https://eips.ethereum.org/EIPS/eip-7604
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7604.md
canonical: https://eips.huatuo.xyz/eip-7604/
lang: en
tldr: "Brings ERC-2612-style gasless permit signatures to ERC-1155: an owner signs an EIP-712 message granting a spender an allowance for a specific token ID and amount, and anyone can submit it on-chain."
tags: [nft, erc-1155, permit, signatures, approvals]
---

# ERC-7604: ERC-1155 Permit Approvals

> Permit approvals for ERC-1155 tokens

**TL;DR:** Brings ERC-2612-style gasless permit signatures to ERC-1155: an owner signs an EIP-712 message granting a spender an allowance for a specific token ID and amount, and anyone can submit it on-chain.

## What problem does it solve?

To let a marketplace or other contract move your tokens, you normally first send an approval transaction, then the actual action. That costs gas twice and needs ETH in the wallet. [ERC-2612](/eip-2612/) fixed this for ERC-20 with `permit`: you sign an off-chain message and the dapp submits the approval together with its own call. [ERC-4494](/eip-4494/) did the same for ERC-721.

[ERC-1155](/eip-1155/) had no equivalent. It is also harder, because an ERC-1155 balance is both a token ID and an amount, and core ERC-1155 only supports all-or-nothing operator approvals. ERC-7604 builds on [ERC-5216](/eip-5216/), which adds per-ID, per-amount allowances to ERC-1155, and defines a permit for them.

## How it works

Three functions are added:

```solidity
function permit(address owner, address operator, uint256 tokenId, uint256 value, uint256 deadline, bytes memory sig) external;
function nonces(address owner, uint256 tokenId) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
```

The owner signs an [EIP-712](/eip-712/) `Permit(address owner,address spender,uint256 tokenId,uint256 value,uint256 nonce,uint256 deadline)` message. A call to `permit` succeeds only if:

- `block.timestamp <= deadline`,
- `owner` is not the zero address,
- the signed `nonce` equals the current `nonces(owner, tokenId)`,
- `sig` is a valid signature from `owner`: a normal 65-byte ECDSA signature, a 64-byte [ERC-2098](/eip-2098/) compact signature, or an [ERC-1271](/eip-1271/) contract-wallet signature.

On success it sets the ERC-5216 `allowance(owner, spender, tokenId)` to `value`, bumps the nonce and emits ERC-5216's `Approval` event. Note that nonces are tracked per owner **and** per token ID. Anyone may call `permit`; `msg.sender` is not checked.

The signature is passed as `bytes` rather than `v, r, s` so that compact and contract signatures fit. Contracts advertise support via [ERC-165](/eip-165/) interface ID `0x7409106d`.

## Sample code

Signing a permit with ethers v6:

```ts
import { Contract, Wallet } from "ethers";

const owner = new Wallet(process.env.PRIVATE_KEY!, provider);
const token = new Contract(tokenAddress, [
  "function nonces(address owner, uint256 tokenId) view returns (uint256)",
  "function permit(address owner, address operator, uint256 tokenId, uint256 value, uint256 deadline, bytes sig)",
], owner);

const tokenId = 7n;
const value = 3n;
const nonce = await token.nonces(owner.address, tokenId);
const deadline = BigInt(Math.floor(Date.now() / 1000) + 3600);

const domain = { name: "MyItems", version: "1", chainId: 1n, verifyingContract: tokenAddress };
const types = {
  Permit: [
    { name: "owner", type: "address" },
    { name: "spender", type: "address" },
    { name: "tokenId", type: "uint256" },
    { name: "value", type: "uint256" },
    { name: "nonce", type: "uint256" },
    { name: "deadline", type: "uint256" },
  ],
};
const sig = await owner.signTypedData(domain, types, {
  owner: owner.address, spender: marketplace, tokenId, value, nonce, deadline,
});

// The marketplace (or a relayer) can now submit it:
// await token.permit(owner.address, marketplace, tokenId, value, deadline, sig);
```

The domain `name` and `version` must match whatever the token contract uses to build its `DOMAIN_SEPARATOR`.

## Things to know

- Status is **Draft**, and it depends on [ERC-5216](/eip-5216/), which is itself not yet Final.
- Signed permits can be front-run (someone else submits first; the outcome for the owner is the same) or withheld by the relayer. Use short deadlines.
- Setting `value` or `deadline` to `type(uint256).max` creates unlimited or non-expiring approvals; treat such signatures like infinite ERC-20 approvals.
- If the domain separator is cached at deployment, a future chain split could allow cross-chain replay. Recompute it when `block.chainid` changes.
- The usual approval race condition (changing a non-zero allowance) applies here too.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7604
