Repository navigation
feat: fall back to canonical MultiSendCallOnly on unserved chains - #34
Merged
Merged
Conversation
getMultiSendCallOnly reverted with MultiSendCallOnlyNotFound on every chain the Safe transaction service does not serve, so batches were impossible there even when the canonical MultiSendCallOnly is deployed. - On the current chain, fall back to the canonical v1.4.1 address, then v1.3.0, if it has code. Served chains resolve as before. - Add Client.withMultiSendCallOnly(address) to set an explicit address, which takes precedence; address(0) clears it. - getMultiSendCallOnly is now view instead of pure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Thanks for this. Looks good to merge once CI passes. I’ll add a check for custom MultiSend addresses with no code in a follow-up, since those can report success without executing the batch. I’ll also clarify that the override must point to a trusted contract. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #33.
Problem
Safe.getMultiSendCallOnly(client, chainId)reverts withMultiSendCallOnlyNotFoundfor every chain the official Safe Transaction Service does not serve. So every batch path (proposeTransactions,getExecTransactionsData,simulateTransactionsNoSign,simulateTransactionsMultiSigNoSign, ...) is unusable on those chains. The canonical MultiSendCallOnly contracts (v1.4.1 and v1.3.0, deployed through the singleton factory) are often present there anyway. For example, one project targets 5 Safe testnets, and 3 of them (0G Galileo, Ink Sepolia, Plume testnet) have no transaction service.Solution
getMultiSendCallOnlynow resolves in this order:safe.withMultiSendCallOnly(address). Passingaddress(0)clears it.chainId == block.chainid), the canonical v1.4.1 address if it has code, then v1.3.0.MultiSendCallOnlyNotFound, as before.Notes:
getMultiSendCallOnlychanges frompuretoviewbecause it now reads the client and checks code.Clientgains a newmultiSendCallOnlyfield. Existing call sites compile unchanged.chainIdargument.Testing
SafeMultiSendFallbackTestintest/Safe.t.solforks Base, copies the real v1.4.1 and v1.3.0 bytecode, clears both addresses, setsvm.chainId(763373)(Ink Sepolia) and etches the code back as each case needs. The cases are: v1.4.1 only, v1.3.0 only, both (v1.4.1 wins), neither (reverts), a non-currentchainId(reverts), a served chain (Base still resolves to v1.3.0), the override taking precedence, and the override cleared withaddress(0).test/SafeSimulation.t.solhas one end-to-end batch simulation on an unserved chain id.forge test(forge 1.8.7): 38 passed, 0 failed. It was 29 before.src/Safe.sol, 6 of the new tests fail withMultiSendCallOnlyNotFound(763373). The other 3 are guards that pass either way. With all ofsrc/reverted, the tests do not compile becausewithMultiSendCallOnlydoes not exist.forge fmt --checkpasses.🤖 Generated with Claude Code