I am currently testing assertions using Echidna.
[test file]
contract ReceiveEther {
constructor() payable {}
function receiveEther() public payable {
uint256 amount = msg.value;
assert(address(this).balance == amount);
}
}
[yaml]
maxValue: 100000000000000000000 #100 eth
balanceContract: 0
[test command]
echidna-test --config ./echidna.yaml ./ReceiveEther.sol --contract ReceiveEther --test-mode assertion
[Result]
receiveEther(): failed!
Call sequence:
receiveEther() Value: 0x1
receiveEther()
Event sequence: Panic(1)
The test result was expected to be passed. But for some reason
the fuzz test does not pass like above log.
I don't know why the following line doesn't pass in Echidna:
assert(address(this).balance == amount);
If anyone knows the reason, please tell me.