---
eip: 7741
label: ERC-7741
title: Authorize Operator
status: Draft
type: Standards Track
category: ERC
created: 2024-06-03
requires: 712, 1271
official: https://eips.ethereum.org/EIPS/eip-7741
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7741.md
canonical: https://eips.huatuo.xyz/eip-7741/
lang: en
tldr: Adds a signature-based authorizeOperator function, modeled on ERC-2612 permit, so users can grant or revoke an operator on vaults and similar contracts without sending a transaction themselves.
tags: [operator, signature, eip-712, vault, meta-transaction]
---

# ERC-7741: Authorize Operator

> Set Operator via EIP-712 secp256k1 signatures

**TL;DR:** Adds a signature-based authorizeOperator function, modeled on ERC-2612 permit, so users can grant or revoke an operator on vaults and similar contracts without sending a transaction themselves.

## What problem does it solve?

Many contracts, including [ERC-6909](/eip-6909/) multi-tokens and [ERC-7540](/eip-7540/) asynchronous vaults, use an *operator* model: an owner calls `setOperator(operator, true)` and the operator can then act on the owner's behalf. That call is an on-chain transaction, so the owner needs native gas on every chain where they want to set an operator, and it cannot be bundled atomically with the operator's first action.

ERC-7741 lets the owner sign an [EIP-712](/eip-712/) message off-chain instead. Anyone (typically the operator or a relayer) submits it, which enables meta-transactions and one-step "authorize and act" flows, much like [ERC-2612](/eip-2612/) `permit` does for ERC-20 allowances.

## How it works

It applies to any contract with the operator interface:

```solidity
event OperatorSet(address indexed owner, address indexed operator, bool approved);
function setOperator(address operator, bool approved) external returns (bool);
function isOperator(address owner, address operator) external returns (bool);
```

and adds:

- `authorizeOperator(owner, operator, approved, nonce, deadline, signature)`: must revert if the deadline passed, if the nonce was used, or if the signature is not a valid EIP-712 signature by the owner. On success it marks the nonce used, sets the operator status, emits `OperatorSet` and returns `true`.
- `invalidateNonce(nonce)`: lets the owner cancel a signed authorization before it is used.
- `authorizations(owner, nonce)`: whether a nonce has been used.
- `DOMAIN_SEPARATOR()`: the EIP-712 domain, unique per contract and chain.

The main difference from ERC-2612 is that `nonce` is a `bytes32` rather than a sequential `uint256`, so authorizations are **unordered**: several can be outstanding at once and used in any order. Contracts must report support via [ERC-165](/eip-165/) interface ID `0xa9e50872`. The reference implementation also verifies contract-account signatures with [ERC-1271](/eip-1271/).

## Sample code

Signing an authorization off-chain (ethers v6). The type string matches the reference implementation's typehash:

```ts
import { Wallet, hexlify, randomBytes } from "ethers";

const domain = { name: "MyVault", version: "1", chainId: 1, verifyingContract: vaultAddr };
const types = {
  AuthorizeOperator: [
    { name: "controller", type: "address" },
    { name: "operator", type: "address" },
    { name: "approved", type: "bool" },
    { name: "nonce", type: "bytes32" },
    { name: "deadline", type: "uint256" },
  ],
};
const value = {
  controller: owner.address,
  operator: relayerAddr,
  approved: true,
  nonce: hexlify(randomBytes(32)),            // unordered nonce
  deadline: Math.floor(Date.now() / 1000) + 600,
};
const signature = await owner.signTypedData(domain, types, value);

// Anyone can now submit it:
await vault.authorizeOperator(
  value.controller, value.operator, value.approved, value.nonce, value.deadline, signature,
);
```

The `domain` name and version must match what the target contract uses in its `DOMAIN_SEPARATOR`.

## Things to know

- Status is **Draft**: names and the interface ID may still change.
- Operators usually have broad power over the owner's positions. Keep `deadline` as short as feasible so a leaked, unused signature expires quickly, and use `invalidateNonce` to cancel ones you no longer want.
- The reference implementation in the spec is explicitly incomplete pseudocode; do not deploy it as-is.
- The spec notes parameter names are interchangeable (ERC-6909 says `spender` where others say `operator`).


---

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