Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
YamenMerhi opened this issue Aug 19, 2024 · 1 comment
Open

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

YamenMerhi opened this issue Aug 19, 2024 · 1 comment

Comments

@YamenMerhi
Copy link

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

@ggrieco-tob
Copy link
Member

Echidna will never send data into the fallback, this is a known issue #714

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants