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

  • how can I catch a revert message in truffle? Dec 5 '18 at 12:59

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

  • 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. Jun 18 '18 at 13:11

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