-
Notifications
You must be signed in to change notification settings - Fork 76
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: impl hardhat_impersonateAccount
and hardhat_stopImpersonationAccount
#125
feat: impl hardhat_impersonateAccount
and hardhat_stopImpersonationAccount
#125
Conversation
And actually, it will be impossible to simulate a call from a contract, because of this check: https://github.com/matter-labs/era-system-contracts/blob/main/bootloader/bootloader.yul#L2097. If we want to support such functionality we need to mark the impersonated account as an account here https://github.com/matter-labs/era-system-contracts/blob/main/contracts/ContractDeployer.sol#L25 . WDYT @MexicanAce ? |
Decided to hold off on addressing this functionality in a follow-up PR |
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.
LGTM
What 💻
impersonated_account: Option<Address>
to node; inrun_l2_tx
method, adjust the tx to have initiator = impersonated account if set. This requires settingself.system_contracts = SystemContracts::from_options(&Options::BuiltInWithoutSecurity)
to disable signature verificationhardhat_impersonateAccount
andhardhat_stopImpersonationAccount
RPCsWhy ✋
Evidence 📷
Notes 📝
send_raw_transaction
- I tried a bit to write one but was quite hard, just re-usedapply_txs