superchain-ops icon indicating copy to clipboard operation
superchain-ops copied to clipboard

Make SignFromJson compatible with Safe Web UI

Open zchn opened this issue 1 year ago • 4 comments

Currently, the SignFromJson script always use Multicall3.aggregate3 to generate the transaction to be signed, example: https://dashboard.tenderly.co/k-oplabs/project/simulator/4e4efb85-acfc-4210-9a8d-55785e0b65a1

The safe web UI uses MultiSendCallOnly.multiSend to generate the transaction to be signed if there are multiple calls: https://dashboard.tenderly.co/public/safe/safe-apps/simulator/3be84dfc-96d6-4069-bae6-6f64a6da5dbf, and no multicall at all if there is a single call: https://dashboard.tenderly.co/public/safe/safe-apps/simulator/d2177dce-db8a-4999-8ac0-38d2bebe3fd4

This FR is about changing SignFromJson so it behaves just like safe web UI, so different signers can choose to use either SignFromJson or Safe Web UI and they would still see the same domain hash and message hash.

zchn avatar Jan 25 '24 14:01 zchn

input.json

zchn avatar Jan 25 '24 14:01 zchn

This is a great catch. I will include it in a PR which accompanies #42, prior to the ceremony.

maurelian avatar Jan 25 '24 17:01 maurelian

Nice, thank you. Assigning this to you accordingly. But feel free to unassign and not work on this if this end up not blocking the extended pause upgrade and instead putting the launch date at risk

zchn avatar Jan 25 '24 17:01 zchn

Being able to sign from the UI would be a nice way to easily support a lot of different wallets, so I'd like to keep this open and think about how we can do this. However, the MultiSendCallOnly contract has a different call encoding which would require changes to base-org/contracts/script/universal/MultisigBuilder.sol, which would be nice to avoid. I wonder if there are ways to sign arbitrary data in the Safe UI, or if we can PR in Multicall3 support to the Safe Transaction Builder

mds1 avatar Oct 02 '24 00:10 mds1