A detector for [ERC-7562](https://eips.ethereum.org/EIPS/eip-7562) banned opcodes reachable from an ERC-4337 validation function (`validateUserOp`, `validatePaymasterUserOp`), following internal calls, library calls and modifiers.
Describe the desired feature
Why
ERC-7562 is enforced by bundlers, off-chain, in a tracer. Nothing on-chain enforces it. A paymaster that reads block.timestamp during validation compiles, passes its tests, passes a real EntryPoint.handleOps call, and is then dropped by every bundler in production, after it has been deployed and staked. Nothing a developer runs before deploying catches it today.
What Slither catches today
tx-origin does flag the ORIGIN case when the read sits in a conditional, for its own phishing
reason. The rest is missed. On a paymaster that stores block.timestamp into its returned
context and checks block.number in a modifier:
$ slither Overlap.sol --detect timestamp,tx-origin,weak-prng
INFO:Slither:Overlap.sol analyzed (2 contracts with 3 detectors), 0 result(s) foundtimestamp fires on comparisons and weak-prng on a modulo; these are an assignment and a
modifier. Nine more banned opcodes have no coverage in this context, and no detector models
"reachable from a validation entry point", which is what decides whether the contract works.
Scope (v1)
OP-011 opcodes (TIMESTAMP, NUMBER, COINBASE, PREVRANDAO, GASLIMIT, BASEFEE, BLOBBASEFEE, ORIGIN, GASPRICE, BLOCKHASH, BLOBHASH, SELFDESTRUCT) including inline-assembly spellings, plus OP-080 BALANCE reported with its staked-entity condition. Entry points matched by name, so a contract that declares its own interface with a wrong argument list is still checked. GAS, CREATE/CREATE2 and the storage rules are left out: they need data flow to avoid false positives. Medium impact, High confidence.
Evidence
Working implementation, with fixtures and snapshot tests on solc 0.5.16 and 0.8.26.
| Target | Result |
|---|---|
eth-infinitism/account-abstraction v0.8.0, all contracts |
0 findings |
| A widely deployed production paymaster | 1 finding: an ORIGIN read enforcing a bundler allowlist |
The second is a documented trade-off rather than a bug, since the read is gated behind a flag that operators set per operation. It is also a fair statement of the limitation: the detector reports reachability and cannot see that the read is optional.
Source: crytic/slither