Closed keefertaylor closed 3 years ago
Hey folks,
Happy to write a PR for this but I am having trouble tracing down where the parsing is actually done. If you have a code pointer it is possible I could fix this myself.
@keefertaylor I wasn't able to reproduce this (using a different function on Accounts.sol
as the isDown
function no longer exists for DowntimeSlasher
). It looks like hitting a require
within a Contract call is now raising an exception as expected. I'm going to go ahead and close this, but please reopen or open a new issue if you observe this with a different function! Thanks for flagging this in any case!
When making a call to a contract wrapper which returns a boolean, ContractKit will return
true
if a solidityrequire()
statement triggers a revert op code.Consider the following program:
This program outputs
true
. However, block 99999999999 doesn't exist on RC1 yet, so this require() is hit.The response is
which is a revert op code. ContractKit is interpreting this revert code as a boolean and returning
true
.Here's a complete debug log of the above program: https://gist.github.com/keefertaylor/a1dff437fb41703d06a9a903f5d9673a
Expected Behavior
Contract kit throws an exception.
Current Behavior
ContractKit returns true.