Skip to content

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

Open
@YamenMerhi

Description

@YamenMerhi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions