Skip to content

feat(cheatcodes): add vm.signTypedData cheatcode to Foundry #10281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aviggiano opened this issue Apr 9, 2025 · 7 comments · May be fixed by #10330
Open

feat(cheatcodes): add vm.signTypedData cheatcode to Foundry #10281

aviggiano opened this issue Apr 9, 2025 · 7 comments · May be fixed by #10330
Assignees
Labels
A-cheatcodes Area: cheatcodes first issue A good way to start contributing T-feature Type: feature

Comments

@aviggiano
Copy link

aviggiano commented Apr 9, 2025

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

@aviggiano aviggiano added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Apr 9, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Apr 9, 2025
@aviggiano aviggiano changed the title Add vm.signTypedData Add vm.signTypedData to Foundry Apr 9, 2025
aviggiano added a commit to Recon-Fuzz/safe-utils that referenced this issue Apr 9, 2025
@nadtech-hub
Copy link

@zerosnacks zerosnacks added A-cheatcodes Area: cheatcodes first issue A good way to start contributing labels Apr 14, 2025
@zerosnacks zerosnacks changed the title Add vm.signTypedData to Foundry feat(cheatcodes): add vm.signTypedData cheatcode to Foundry Apr 14, 2025
@zerosnacks zerosnacks removed the T-needs-triage Type: this issue needs to be labelled label Apr 14, 2025
@Haxry
Copy link
Contributor

Haxry commented Apr 15, 2025

@zerosnacks if it's avialable, may i take it ?

@grandizzy
Copy link
Collaborator

sounds good @Haxry thank you!

@Haxry
Copy link
Contributor

Haxry commented Apr 16, 2025

@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 ?

@grandizzy
Copy link
Collaborator

@aviggiano pls chime in, if EIP712 you're looking for maybe #4818 to consider?

@aviggiano
Copy link
Author

@Haxry yes this was my idea

@grandizzy #4818 is nice but I think it is independent from my feature request, no?

@Haxry Haxry linked a pull request Apr 17, 2025 that will close this issue
3 tasks
@PatrickAlphaC
Copy link

It feels like it could go into ally first too no? And then get merged into foundry?

alloy-rs/alloy#2349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes first issue A good way to start contributing T-feature Type: feature
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

6 participants