smart contract containing Payable function is not working when deployed using new version of metamask. can anyone please resolve this issue?
-
You will need to provide more information, such as the relevant code, and sample transaction call. – Raghav Sood Aug 13 '18 at 12:54
-
solidity code: pragma solidity ^0.4.21; contract test1{ mapping(address=>uint) public balances; function ()public payable{ balances[msg.sender]+=msg.value; } } and this is deployed in ropsten Test Network contract address is 0x737843b00794aebe122420a6e2f8b99586ce8806 try sending test ethers to this contract and transaction fails always – Harsha Sunny Aug 13 '18 at 13:04
-
and same contract's fallback function works when deployed using old version of metamask and sending ethers using old version of metamask to this contract – Harsha Sunny Aug 13 '18 at 13:09
-
@HarshaSunny Please, edit your own question and add the code, so it more easy to read. – Ismael Aug 13 '18 at 15:41
I just sent some ether to your contract and it fails. The issue seems to be that metamask is making a wrong estimation of the required gas. It asks for a gas limit of about 39500 gas, but looking at your contract the limit should be at least 41000 gas.
I set a gas limit of 100000 gas and it works, consuming 41325 gas.
here is the successful transaction: https://ropsten.etherscan.io/tx/0x631762aed20ac432fe82d4fc8521c0c7af370a3d34f64f3dd778017854bc37d6
Hope this helps.