So I have this solidity function:
function claimGoodTest(uint256 typeId) public payable {
if (msg.value < 4000) revert();
}
I test it with the following:
var result = await contract.claimGoodTest(typeId, {
from: accounts[0], value: web3.utils.toWei('40', 'ether')
}, function(result) { })
I get this :
Error: VM Exception while processing transaction: revert
Why is this happening ? This seems like a bug or I have the wrong syntax.
if (msg.value < 4000) revert();
line, do you still see a problem? (I'm trying to narrow down whether it's that line causing therevert
.) – user19510 Jan 13 '18 at 17:19if (msg.value < 4000) { revert(); }
– Roman Frolov Jan 13 '18 at 17:20contract
? – user19510 Jan 13 '18 at 18:30