Skip to content

Not able to withdraw ETH balance of the contract #10

@pauliax

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);
    }

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