feat(`cheatcodes`): add `vm.signTypedData` cheatcode to Foundry
Component
Forge
Describe the feature you would like
I am building safe-utils to help automate the proposal of Safe transactions through Foundry.
One common use case of governance multisigs is Safe signers who use Ledger wallets.
The issue is that Ledger removed blind signing, so the eth_sign method invoked by vm.sign does not work.
This feature request proposes introducing a new vm.signTypedData similar to cast wallet sign --data. Since foundry already has JSON encoding/decoding cheatcodes, we could rely on the user to correctly construct the data parameters, and only pass them to the VM method.
Additional context
No response
✋
@zerosnacks if it's avialable, may i take it ?
sounds good @Haxry thank you!
@grandizzy @aviggiano lmk if i am wrong ,
the user will provide the structured json data according to the EIP712 , the vm.signTypedData cheatcode should take it as input along with the private key and should generate the digest which should then be signed as done by vm.sign
right ?
@aviggiano pls chime in, if EIP712 you're looking for maybe https://github.com/foundry-rs/foundry/issues/4818 to consider?
@Haxry yes this was my idea
@grandizzy #4818 is nice but I think it is independent from my feature request, no?
It feels like it could go into ally first too no? And then get merged into foundry?
https://github.com/alloy-rs/alloy/issues/2349
This would be great!