6

I have this example contract.

contract Example{
    function foo(){
        revert("hello world!!!");        
    }
}

When execute the foo function, this revert the tx, how get the revert message?

PD.: i use truffle to test contracts


now truffle support revert message

1
  • how can I catch a revert message in truffle? Commented Dec 5, 2018 at 12:59

1 Answer 1

0

This feature still not supported on high-level: https://github.com/ethereum/solidity/issues/1686

1
  • i try this in remix and get this: transact to Example.foo errored: VM error: revert. revert The transaction has been reverted to the initial state. Reason provided by the contract: "hello world!!!". Debug the transaction to get more information. Commented Jun 18, 2018 at 13:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.