foundry-rs / foundry-rs/foundry

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

Open
#10,281 8 comments 5 reactions 1 assignee Claimed by @Haxry View on GitHub
A-cheatcodes first issue T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Forge

### Describe the feature you would like

I am building [safe-utils](https://github.com/Recon-Fuzz/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](https://www.reddit.com/r/ledgerwallet/comments/1edlnjq/psa_latest_eth_app_removes_blind_signing/?rdt=59792 ), 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.