-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(evm
/cheatcodes
): Use alloy-signer
, rm ethers-signers
/ethers-core
#6911
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending @DaniPopes
// The `ecrecover` precompile does not use EIP-155. No chain ID is needed. | ||
let wallet = parse_wallet(private_key)?; | ||
|
||
// The `ecrecover` precompile does not use EIP-155 | ||
let sig = wallet.sign_hash(digest.to_ethers())?; | ||
let recovered = sig.recover(digest.to_ethers())?.to_alloy(); | ||
let sig = wallet.sign_hash_sync(*digest)?; | ||
let recovered = sig.recover_address_from_prehash(digest)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the previous impl also didn't require the chain id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
"alloy-sol-types", | ||
"base64 0.21.7", | ||
"const-hex", | ||
"ethers-core", | ||
"ethers-signers", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simply lovely
Motivation
We were still using ethers for signers on cheatcodes.
Solution
Replaces ethers-signers with alloy signers, and removes the now unused ethers deps from
cheatcodes
.This isolates signers on
forge script
/cast
, in which we're still converting to ethers signers.