pragma solidity >=0.7.0 <0.9.0;
contract StructMapping {
mapping(address => uint) public balanceReceived;
function getBalance() public view returns(uint) {
return address(this).balance;
}
function sendMoney() public payable {
balanceReceived[msg.sender] += msg.value;
}
function withdrawAllMoney(address payable _to) public {
uint balanceToSend = balanceReceived[msg.sender];
balanceReceived[msg.sender] = 0;
_to.transfer(balanceToSend);
}
}
requirements: remix web ide, solidity file with above code opened in remix, two metamask wallets
steps to reproduce:
- save file and open through remix
- injected web3 (connect metamask wallet A)
- deploy contract
- send from wallet A to the deployed contract using remix interactive feature
- copy address of the contract and send from metamask wallet B
When I try to perform step 5 the transaction in my metamask from wallet b which is on a different machine fails says not enough gas. How can I send from this remote wallet and have it interact with the contract, im assuming it is just sending it like its a wallet address and timesout.