Skip to content

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

Description

@aviggiano

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

Activity

  1. changed the title [-]Add vm.signTypedData[/-] [+]Add vm.signTypedData to Foundry[/+] on Apr 9, 2025
  2. nadtech-hub commented on Apr 9, 2025

    @nadtech-hub

    ✋

  3. changed the title [-]Add vm.signTypedData to Foundry[/-] [+]feat(`cheatcodes`): add `vm.signTypedData` cheatcode to Foundry[/+] on Apr 14, 2025
  4. Haxry commented on Apr 15, 2025

    @Haxry
    Contributor

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

  5. grandizzy commented on Apr 15, 2025

    @grandizzy
    Collaborator

    sounds good @Haxry thank you!

  6. Haxry commented on Apr 16, 2025

    @Haxry
    Contributor

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

  7. grandizzy commented on Apr 16, 2025

    @grandizzy
    Collaborator

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

  8. aviggiano commented on Apr 16, 2025

    @aviggiano
    Author

    @Haxry yes this was my idea

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

  9. PatrickAlphaC commented on Apr 25, 2025

    @PatrickAlphaC

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

    alloy-rs/alloy#2349

  10. bowd commented on Jun 2, 2025

    @bowd

    This would be great!

  11. added theissue type on Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    • Status
      Next Up

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions