I'm using the .transfer() method in my smart contract to pay a particular address. I've checked the Ganache logs and the transaction does not revert and is auto-mined successfully. But I don't see a VALUE transaction in the Ganache transaction logs reflecting the transfer and I don't see the amount paid in Metamask for the Eth address that was supposed to receive the payment.
Why don't I see a VALUE transaction in the Ganache transaction list or see the payment in Metamask?
function claimPayment(uint256 _gameId, bytes32 _videoId, address _payeeAddr)
public
onlyOwner
onlyIfValidGameIdAndGameOverState(_gameId)
whenNotPaused
{
require(_payeeAddr != address(0), "(claimPayment) The payee address is not set.");
require(_videoId != "", "(claimPayment) The video ID is not set.");
// Create a payment details structure from the input parameters so we can generate
// a mapping key.
structPendingPaymentDetails memory pendingPaymentDetails =
structPendingPaymentDetails(
0,
_gameId,
_videoId,
_payeeAddr,
0,
EnumPaymentType.NOTSET);
// Build the mapping key from the pending payment details.
bytes32 mapKey = hashPendingPaymentDetails(pendingPaymentDetails);
// Make sure they have funds waiting for them.
pendingPaymentDetails.paymentAmountGwei = s_mapPendingPaymentsByGame[mapKey].paymentAmountGwei;
require(pendingPaymentDetails.paymentAmountGwei > 0, "(claimPayment) In the context of the given game and resource ID, the payee does not have any funds waiting for them.");
// Make sure this contract has enough funds to cover the payment.
require(address(this).balance >= pendingPaymentDetails.paymentAmountGwei, "(claimPayment) The contract does not have enough funds to cover the payment at this time.");
// Remove the payment from our claim amount storage.
delete s_mapPendingPaymentsByGame[mapKey];
// Remove the payment from the pending payments list.
removePaidAddressFromPendingPaymentsList(mapKey);
// Make the payment.
_payeeAddr.transfer(pendingPaymentDetails.paymentAmountGwei);
}