In something like this, how can I tell which require
the contract exits on?
pragma solidity ^0.4.19;
contract Demo {
uint _a;
function Demo(uint a) public {
_a = a;
}
function demo() public view {
require(_a == 1);
require(_a == 2);
}
}
All that's logged in the console is:
[call] from:0xca35b7d915458ef540ade6068dfe2f44e8fa733c, to:Demo.demo(), data:01725...25a0b, return:
Details
Debug
{}
from 0xca35b7d915458ef540ade6068dfe2f44e8fa733c
to Demo.demo() 0xcd021ffd464dc40614c4dd7e7826b3d91a21ab12
transaction cost 21854 gas (Cost only applies when called by a contract)
execution cost 582 gas (Cost only applies when called by a contract)
input 01725a0b
decoded input {}
decoded output {}
logs []
call to Demo.demo errored: VM error: revert.
revert The transaction has been reverted to the initial state.
Note: The constructor should be payable if you send value. Debug the transaction to get more information.
creation of Demo pending...