feat: setup#2
Conversation
There was a problem hiding this comment.
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.
| "func-visibility": ["error", { "ignoreConstructors": true }], | ||
| "no-complex-fallback": "off", | ||
| "no-inline-assembly": "off" |
There was a problem hiding this comment.
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
| [fmt] | ||
| sort_imports = true | ||
| number_underscore = "thousands" | ||
| wrap_comments = true |
There was a problem hiding this comment.
Without this, lines can extend without wrapping.
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "solidity.compileUsingRemoteVersion": "v0.8.34+commit.80d5c536" | |||
There was a problem hiding this comment.
Explicit requirement for latest Solidity version
| /// @notice Address of the first approved caller | ||
| address private immutable APPROVED_CALLER_0; | ||
|
|
||
| /// @notice Address of the second approved caller | ||
| address private immutable APPROVED_CALLER_1; | ||
|
|
||
| /// @notice Address of the third approved caller | ||
| address private immutable APPROVED_CALLER_2; | ||
|
|
||
| /// @notice Address of the fourth approved caller | ||
| address private immutable APPROVED_CALLER_3; | ||
|
|
||
| /// @notice Address of the fifth approved caller | ||
| address private immutable APPROVED_CALLER_4; |
There was a problem hiding this comment.
I left these as private as to not increase the bytecode of the contract unnecessarily.
However, there would need to be some additional assumptions in services about this, because now we can no longer check if the caller is approved with isApprovedCaller (first iteration), but through some other means, e.g. simulating a transaction with a sender being e.g. Bob, and see if it would revert with Unauthorized.
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
Solver7702Delegate.Solver7702Delegate.Countercontract, script, and test.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: