I've written a smart contract which, like many smart contracts, has a withdrawal message. This withdrawal message will liquidate all holdings of msg.sender
and transfer holdings to them.
The actual code I use to do this is taken directly from the SafeTransfer
library in Uniswap's codebase.
The piece of the function in question looks like:
processWithdrawal(_customerAddr, totalWithdralAmountInEth);
emit Withdrawal(msg.sender, totalWithdralAmountInEth);
With the process withdrawal looking like:
function processWithdrawal(address _customerAddr, uint256 value) internal {
//pattern https://solidity-by-example.org/sending-ether/
(bool sent, ) = _customerAddr.call{value: value}(new bytes(0));
require(sent, "Failed to send Ether");
}
However, in Metamask the event 'Withdrawal' is shown but it shows zero ETH transferred as a result of the transfer.
What's super weird is that the actual amount withdrawn DOES show up in the accounts balance in Metamask. I'm using a hardhat fork locally and I've also console.log present in the contract itself so I know for sure the ETH is leaving the contract. This seems to be isolated to the Metamask activity log. Anyone else have this happen? Thank you.