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
Calling any view method on a contract deployed with "hardhat_setCode" return an empty string #1883
Comments
Just tried with Hardhat v2.6.4 and I got the same result. |
This is pretty odd, as we have a test that (tries to) verify this. We'll dig deeper into this. Thanks, @PaulRBerg |
This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
This might still be relevant @alcuadrado @fvictorio. Might be worth it to re-open the issue if the behavior hasn't been patched. |
The problem here is that the expected response is part of the state of the contract, set during deployment, and not part of the code. So the bytecode is copied, but the state of the We should have an easy way to do this, like the |
Description
I am doing the following things to deploy a contract with the hardhat_setCode JSON-RPC method:
CREATE
opcode) with waffle.deployContractgetCode
When I attempt to call a view method on this contract, I am getting only empty strings back. That makes my tests fail:
Steps to Reproduce
yarn install
.env
file by following the.env.example
yarn typechain
yarn test
To make the tests pass, you can uncomment line 35.
Environment
The text was updated successfully, but these errors were encountered: