| Crates.io | eip7702reset |
| lib.rs | eip7702reset |
| version | 1.0.0 |
| created_at | 2025-10-11 01:35:09.629791+00 |
| updated_at | 2025-10-11 01:35:09.629791+00 |
| description | A CLI to inspect, set, and clear EIP-7702 delegations. |
| homepage | |
| repository | https://github.com/maikelordaz/eip7702reset |
| max_upload_size | |
| id | 1877718 |
| size | 149,180 |
A tiny, batteries-included CLI to inspect, set, and clear EIP-7702 delegations for an EOA.
It uses the latest Alloy stack under the hood and hides private-key input by default.
check <address> — Reads bytecode at an EOA and classifies it as:
set <delegated_contract> — Creates and broadcasts an EIP-7702 Authorization so a user EOA can execute code from a template contract. Uses a relayer account to pay gas.clear — Creates and broadcasts an EIP-7702 De-authorization (authorization list with the zero address) to revert an EOA back to a normal account. Also uses a relayer to pay gas.[!NOTE] Keys are requested interactively and typed/pasted without echo in the terminal.
EIP-7702 allows an EOA to temporarily delegate execution to a delegation contract (e.g., a smart account), without permanently converting the EOA. This CLI is a minimal, auditable tool to:
It’s useful for migrations, recoveries, support flows, and ops where you need a simple, scriptable UX.
eth_getCode on the EOA.EF 01 00 EIP-7702 bytecode prefix and, if present, extracts/prints the 20-byte template address.[!NOTE] We rely on Alloy Providers/Signers. Gas fields can be set explicitly or left to Alloy’s fillers if you enable them in the code.
rpassword).Any EVM chain that supports EIP-7702.
The flow has been tested on Arbitrum Sepolia. You’ll need an RPC endpoint that accepts raw transactions.
cargo install eip7702reset
# In the repo root
cargo install --path .
This builds a release binary and installs it into Cargo’s bin dir
cargo build --release
# binary at: target/release/eip7702reset
Requirements:
Rust (stable) with MSVC toolchain on Windows (installed via rustup)
A recent git
(Optional) make if you want to use the convenience Makefile targets
# Format + lints + tests + build
cargo fmt
cargo clippy -- -D warnings
cargo test
cargo build --release
# Common workflows:
make fmt
make lint
make test
make build
eip7702reset --help
eip7702reset check --help
eip7702reset set --help
eip7702reset clear --help
# Vars
# Arbitrum Sepolia RPC endpoint
RPC="https://sepolia-rollup.arbitrum.io/rpc"
# EOA to inspect/delegate/clear
VICTIM="<your_eoa_address>"
# Metamask EIP7702 delegator contract
TEMPLATE="0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B"
# 1) Check (expect "safe" if not delegated)
eip7702reset check "$VICTIM" --rpc-url "$RPC"
# 2) Set delegation (prompts for USER key and RELAYER key; no echo)
eip7702reset set "$TEMPLATE" --rpc-url "$RPC" --gas-limit 50000
# 3) Check again (expect EIP-7702 + template address)
eip7702reset check "$VICTIM" --rpc-url "$RPC"
# 4) Clear (prompts for VICTIM key and RELAYER key; no echo)
eip7702reset clear --rpc-url "$RPC" --gas-limit 50000
# 5) Final check (expect safe)
eip7702reset check "$VICTIM" --rpc-url "$RPC"
Relayer must have a small balance on the target chain to pay gas.
If your endpoint auto-fills fees/nonces, you may remove explicit gas settings in the code (disable disable_recommended_fillers()).
We include:
Unit tests for bytecode classification.
Integration tests that spin a tiny mock JSON-RPC server for check, set, and clear.
Run all tests:
cargo test
--rpc-url <URL> — RPC endpoint (HTTP).
--gas-limit <u64> — Gas limit for the outer EIP-1559 tx (default: 100000 via global CLI flag in cli.rs).
--debug — Prints extra diagnostic output.
RUST_LOG — Use with tracing_subscriber (e.g., RUST_LOG=info).
Some public endpoints may reject raw transactions or have strict rate limits. If you hit eth_sendRawTransaction failed, try another RPC or a project key from a provider.
Built with ❤️ using:
clap, tokio, tracingrpassword, zeroize for safer key handling