-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(forge): implement vm.signTypedData cheatcode #10330
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
base: master
Are you sure you want to change the base?
Conversation
@Haxry pls don't introduce ethers dep bit use alloy. Also pls add a test for the new cheatcodes and make sure priv key is redacted in traces, you can add here foundry/crates/evm/traces/src/decoder/mod.rs Line 460 in 709f266
Thanks |
@grandizzy |
yep, lgtm! I run |
Hey |
Awesome, thanks. Mind that the PR wasn't merged yet so you'll need to build locally and test, was wondering if you could provide a sample for input / output to include as a test. |
@aviggiano plz provide a sample test case to include in tests |
@Haxry I hope this example can help: This is the current setup to sign with EIP712:
You should have a Ledger setup and unlocked. It will prompt you to "blind sign" using
The goal is to replace this FFI call to |
Confirm this works with the current cheatcode which requires a private key, one difference though is that the cheatcode returns v, r, s, of sig but I guess that's OK @aviggiano ? I think we need also a cheatcode that would enable signing with the ledger and not by receiving priv key, @Haxry @aviggiano wdyt? thanks |
@grandizzy returning v, r, s is OK, but requiring the private key is not sufficient for my use case, since the biggest motivation for this feature is being able to sign transactions with ledger. So yeah, it would be important to have a cheatcode that does not require the private key. |
Motivation
Solution
closes #10281
PR Checklist