Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

False positive on contracts-that-lock-ether #114

Closed
mrice32 opened this issue Dec 21, 2018 · 1 comment
Closed

False positive on contracts-that-lock-ether #114

mrice32 opened this issue Dec 21, 2018 · 1 comment

Comments

@mrice32
Copy link
Contributor

mrice32 commented Dec 21, 2018

Forwarding ether to another contract in a payable method seems to incorrectly trigger the locking warning despite the fact that all ether is forwarded rather than stored. As with #112, feel free to close if this is not the right forum or this error is working as intended. See the following example that triggers the error:

/*
  Test
*/
pragma solidity >=0.4.24;


contract OtherContract {
    address public owner;

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    constructor(address ownerAddress) public payable {
        owner = ownerAddress;
    }

    function withdraw() external onlyOwner {
        msg.sender.transfer(address(this).balance);
    }
}


contract TestContract {
    function createOtherContract() external payable returns (address newContract) {
        OtherContract otherContract = (new OtherContract).value(msg.value)(msg.sender);
        return address(otherContract);
    }
}
@montyly
Copy link
Member

montyly commented Dec 23, 2018

Hey @mrice32 , thank you for reporting the issue

LockedEther was not considering the transfer of ether through new contract operations. It is fixed in master

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

No branches or pull requests

2 participants