I know it sounds like a basic question (it should be), despite that I could not find any clear reference to that in polygon's (Matic) docs on how does payable(address).call
works
pragma solidity ^0.7.6;
contract MyFirstPolygonContract {
string private name;
uint private amount;
function sendFunds(address receiver) external payable {
payable(receiver).call{value: msg.value}('');
}
//set
function setName(string memory newName) public {
name = newName;
}
//get
function getName () public view returns (string memory) {
return name;
}
//set
function setAmount(uint newAmount) public {
amount = newAmount;
}
//get
function getAmount() public view returns (uint) {
return amount;
}
}
I deployed this contract into Matic Mainnet in order to test sendFunds
and quantify the amounts. I tried sending funds between two of my accounts sender_addr
, recv_addr
.
On Remix, I have chosen to send 1 ether on this contract (deployed on Matic). One Matic Token has been deducted from sender_addr
. But the recv_addr
received none !! It's been about 24 hours now. The transaction is not even shown on polygon scan !
It's worth noting that function sendFunds
worked as expected on Mumbai testnet though.
EDITED:
The contracts are deployed in different networks having the same address
0x3918AaECf75aD253E0098fD0ee5C11d854BE9de6
I did that exact transaction on the testnet 0.1 MATIC
https://explorer-mumbai.maticvigil.com/address/0x3918AaECf75aD253E0098fD0ee5C11d854BE9de6/transactions (this was successful)
While I did those two transactions added 1.001 MATIC
on the matic mainnet
https://polygonscan.com/address/0x3918aaecf75ad253e0098fd0ee5c11d854be9de6 (failed to send to recv_addr
)