Skip to content

Not able to withdraw ETH balance of the contract #10

Description

@pauliax

BitGuildMarketPlace.sol
This function is supposed to allow ETH withdrawals from the contract:

    // @dev Admin function: withdraw ETH balance
    function withdrawETH() public onlyOwner payable {
        msg.sender.transfer(msg.value);
    }

However, it is marked as a payable and transfers msg.value back to the sender. In other words, this function is useless as it sends back what it receives. Probably it was supposed to transfer the ETH balance of the contract to the owner.

Solution:

    // @dev Admin function: withdraw ETH balance
    function withdrawETH() public onlyOwner {
        msg.sender.transfer(address(this).balance);
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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