intents-erc7683
Skill36 starsChanged 5 months agoMITView on GitHub
Detect ERC-7683 / intent-based protocol bugs — solver griefing, intent expiration, settlement race conditions, surplus theft, cross-chain replay, allowance front-runs. Activate on `IOriginSettler`, `IDestinationSettler`, `CrossChainOrder`, ERC-7683 imports, UniswapX reactor patterns, CoW settlement, 1inch Fusion, Across spoke pool / hub pool.
In this repository44 other files it gives its agents.
- access-controlSkill
- approval-issuesSkill
- caching-and-incrementalSkill
- centralization-riskSkill
- confidence-scoringSkill
- cosmwasmSkill
- cross-chain-messagingSkill
- cross-contract-stateSkill
- delegatecall-risksSkill
- diamond-eip2535Skill
- dos-vectorsSkill
- erc1271-contract-signaturesSkill
- erc4337-account-abstractionSkill
- erc4626-inflationSkill
- false-positive-feedback-loopSkill
- fee-on-transferSkill
- flash-loan-attacksSkill
- initializationSkill
- inline-assemblySkill
- integer-issuesSkill
- known-good-comparisonSkill
- liquidation-cascadeSkill
- mev-frontrunningSkill
- mev-pbsSkill
- multi-pass-self-critiqueSkill
- oracle-manipulationSkill
- oracle-redundancySkill
- permit2-patternsSkill
- pragma-and-addressesSkill
- progress-and-streamingSkill
- reentrancySkill
- restaking-eigenlayerSkill
- selfdestruct-eip6780Skill
- signature-malleabilitySkill
- signature-replaySkill
- solana-anchorSkill
- storage-layoutSkill
- stylus-rustSkill
- token-compatibilitySkill
- tx-context-misuseSkill
- unchecked-callsSkill
- ve-lock-governanceSkill
- vyper-specificSkill
- zk-verifier-bugsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
If destination fill fails after origin lock: refund mechanism required.
- Distinctive: line 37
If origin lock fails after destination fill: solver loses.
- Distinctive: line 58
If fast solver doesn't fill: fallback to a slower, trustless path.
- Distinctive: line 81
Always include both origin and destination chainIds in signed payload.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Intent-based / ERC-7683 detection
When this applies
- ERC-7683 cross-chain intents
- UniswapX (reactor + filler model)
- CoW Protocol (batch auctions)
- 1inch Fusion / Fusion+
- Across (origin lock + destination fill)
- Any "user signs intent, solver fills" pattern
Detection patterns
Surplus theft (HIGH)
Intent specifies amountOutMin (user's floor). Solver delivers exactly the min, pockets actual market surplus. UX issue but real for intents with tight min — solver fills inferior route.
Defense: surplus distribution to user (CoW does this).
Cross-chain replay (HIGH)
ERC-7683 intent payload signable for one (origin, destination) pair must include both chainIds. Otherwise replay on another destination.
Solver front-run (HIGH)
Solver A's fill is in mempool; Solver B copies and submits with higher gas → A's tx reverts. Mitigations: private mempools, MEV-Share, exclusivity windows.
Intent expiration not enforced atomically (HIGH)
require(block.timestamp <= deadline) at settlement. If deadline is checked at the wrong step (e.g. at origin lock but not destination fill), funds can be stuck.
Origin lock + destination fill atomicity (CRITICAL)
- User locks funds on origin chain.
- Solver fills on destination chain.
- Solver claims locked funds on origin (via cross-chain proof).
- If destination fill fails after origin lock: refund mechanism required.
- If origin lock fails after destination fill: solver loses; bond required.
Reactor callback reentrancy (HIGH — UniswapX-specific)
reactor.execute(order, fillerCallback) → callback in attacker-controlled filler contract. If reactor state is mutated mid-callback, reentrancy possible. Required: nonReentrant on the reactor.
Permit2 + intent collision (HIGH)
Intent assumes user's Permit2 sig was just executed. Solver can race: front-run the permit, grief the intent.
Allowed-fillers list bypass (HIGH)
Intent restricts to specific solvers. If the list check is via tx.origin (instead of msg.sender or signature recovery), trivially bypassable.
Decay function correctness (HIGH — UniswapX)
Dutch auction: output token amount decays over time. If decay math overflows or rounds wrong, solver fills at the minimum before decay completes.
Salt-based nonce missing (HIGH)
Intent identifies itself by (user, salt). If salt isn't enforced unique on-chain, multiple identical intents replayable.
Solver bond on cross-chain (HIGH)
Cross-chain intents (ERC-7683): solver bonds on destination to prove they'll bring liquidity. If bond is too small, solver can grief by filling and abandoning.
Slow-path fallback (HIGH)
If fast solver doesn't fill: fallback to a slower, trustless path. Bug surface: race between fast and slow paths.
Cancellation race (HIGH)
User cancels intent (cancel); solver fills in the same block. Order-of-execution determines who wins. Required: cancel must invalidate fills in the same tx.
Severity rubric
| Pattern | Severity |
| Origin lock without atomic destination fill / refund | Critical |
| Cross-chain replay (no chainId binding) | Critical |
| Reactor callback reentrancy | High |
| Solver-allowed-list using tx.origin | High |
| Surplus theft (silent) | High |
| Decay function precision wrong | High |
| Salt nonce not enforced unique | High |
| Insufficient solver bond | High |
| Cancellation race | High |
| Deadline not enforced atomically | High |
| Permit2 race | Medium |
Remediation patterns
- Always include both origin and destination chainIds in signed payload.
- Atomic origin lock + cross-chain message + destination fill OR atomic refund.
nonReentranton reactor.- Solver-allowed-list via signature recovery against an allowlist set, not tx.origin.
- Surplus → user (CoW model).
- Bond sized to disincentivize griefing (≥ profit margin × N).
- Cancellation invalidates all in-flight fills atomically.
False-positive notes
- CoW / UniswapX reference implementations are well-audited.
- Solver-side bugs aren't in scope for the contract audit — call out as advisory.
Related
- [[intents-specialist]] (subagent)
- [[cross-chain-messaging]]
- [[mev-frontrunning]]
- [[permit2-patterns]]
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

