Skip to content

feat: setup#2

Open
igorroncevic wants to merge 5 commits into
mainfrom
feat/setup
Open

feat: setup#2
igorroncevic wants to merge 5 commits into
mainfrom
feat/setup

Conversation

@igorroncevic
Copy link
Copy Markdown
Collaborator

@igorroncevic igorroncevic commented May 14, 2026

Description

This PR sets up the first version of Solver7702Delegate, an ERC-7702 delegation target for solver EOAs.

The contract lets approved auxiliary EOAs submit calls through the solver EOA. This gives solvers more nonce lanes for settlement submission while keeping the solver EOA as the address seen by downstream contracts.

What changed

  • Added Solver7702Delegate.
  • Added five immutable approved caller addresses set at deployment time.
  • Added fallback-based call forwarding.
  • Uses packed calldata: the first 20 bytes are the target address, and the rest is forwarded as calldata.
  • Forwards ETH and bubbles up target return data or revert data.
  • Rejects callers that are not in the approved caller list.
  • Added a deploy script for Solver7702Delegate.
  • Removed the starter Counter contract, script, and test.
  • Updated README, Foundry, Slither, Solhint, and editor config for this contract.

Why

A solver EOA has one nonce lane, so transactions from that EOA must land in order. With ERC-7702, auxiliary EOAs can send transactions to the solver EOA and use their own nonce lanes, while calls still execute as the solver EOA.

This keeps the existing solver identity and avoids having to allowlist several EOAs or require every solver to use a smart contract account.

Out of scope

Testing

Run:

just build
just lint
just slither

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the example Counter contract with Solver7702Delegate, an ERC-7702 delegation target that forwards calls from authorized addresses. It also updates tool configurations for Solhint, Slither, and Foundry. Feedback identifies a compilation error in the target address extraction logic and suggests using granular Slither suppressions instead of global detector exclusions to preserve security analysis depth.

Comment thread src/Solver7702Delegate.sol
Comment thread slither.config.json
@igorroncevic igorroncevic marked this pull request as ready for review May 14, 2026 11:26
@igorroncevic igorroncevic requested a review from a team as a code owner May 14, 2026 11:26
Comment thread .solhint.json
Comment on lines +7 to +9
"func-visibility": ["error", { "ignoreConstructors": true }],
"no-complex-fallback": "off",
"no-inline-assembly": "off"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these are necessary:

  • "func-visibility": ["error", { "ignoreConstructors": true }] -> constructor doesn't require explicit visibility modifier since Solidity 0.7
  • "no-complex-fallback": "off" -> we explicitly need our fallback to be complex
  • "no-inline-assembly": "off" -> we explicitly need assembly for gas efficiency

Comment thread foundry.toml
[fmt]
sort_imports = true
number_underscore = "thousands"
wrap_comments = true
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, lines can extend without wrapping.

Comment thread slither.config.json
Comment thread .vscode/settings.json
@@ -0,0 +1,3 @@
{
"solidity.compileUsingRemoteVersion": "v0.8.34+commit.80d5c536"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicit requirement for latest Solidity version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant