I have this simple contract used with remix.
pragma solidity^0.4.24;contract test{ mapping (address => uint) balances; function Deposit() public payable{ balances[msg.sender] += msg.value; } function Withdraw() public{ msg.sender.transfer(balances[msg.sender]); balances[msg.sender] = 0; } function CheckBalance() view public returns(uint){ return balances[msg.sender]; } }
I can send the payable amount through remix, and the balance shows accordingly. The transaction will also show the correct value in wei. But withdrawing will result in a transaction of 0 wei.
The balance is deducted in the contract, but no transfer has occured to the msg.sender.
Thanks for help!
Withdraw
function.