foundry: Revert messages are missing
Component
Anvil
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
forge 0.2.0 (3fc1491 2022-06-06T00:14:30.023454Z)
What command(s) is the bug in?
anvil
Operating System
macOS (Intel)
Describe the bug
Transactions will revert messages are missing revert messages.
I have a method and modifier like:
modifier onlyOwner() {
require(msg.sender == owner, "!authorized");
_;
}
function getSecret() public onlyOwner view returns(uint256 secret) {
return 123;
}
The response data I am getting looks like:
{'jsonrpc': '2.0', 'id': 23, 'error': {'code': -32003, 'message': 'execution reverted: ', 'data': '0x'}}
which is maybe what I would expect had I not included a revert message.
!unathorized is missing from the response.
I believe this is a regression, as this was working a month or so ago.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (7 by maintainers)
Ok I am working on a more bare-bones reproduction script to try and debug stuff. I got this:
When I use Hardhat, this is the output of the script:
When I connect to Anvil however, this is the output:
For some reason, the revert message is not there!
@mattsse let me know if my reproduction script is at all helpful! I can also reach out to the people at web3.py.