echidna icon indicating copy to clipboard operation
echidna copied to clipboard

[Bug-Candidate]: Echidna unable to break property using fallback

Open YamenMerhi opened this issue 6 months ago • 1 comments

Describe the issue:

Fallback function given certain parameters can break the property to test.

Code example to reproduce the issue:

contract Example {
    mapping(address => uint) public balances;

    fallback() external payable {
        (address o, uint256 desiredAmount) = abi.decode(
            msg.data,
            (address, uint256)
        );
        balances[o] = desiredAmount;
    }
}
contract TestExample is Example {
    address echidna_caller = msg.sender;

    function echidna_test_balance() public view returns (bool) {
        return balances[echidna_caller] == 0;
    }
}

Altho this code is able to break the property

        (bool success, bytes memory data) = address(this).call(
            abi.encode(echidna_caller, 10000000000000)
        );

Version:

echidna --version                        
Echidna 2.2.4
slither --version                                
0.10.3

Relevant log output:

No response

YamenMerhi avatar Aug 19 '24 23:08 YamenMerhi