I am new with solidity. I've implemented this withdraw function
function withdraw() public payable onlyOwner {
require(payable(msg.sender).send(address(this).balance));
}
And I am calling this in the dapp I am creating thats linked to Metamask:
...methods
.send({
gasLimit: "",
from: msg.sender,
to: *contract owner address here*,
value:...,
}
So the code seems to work as I can transfer tokens and deduct fee from the wallet. However, the "value" is not going to the stated "to" but still in contract. Anyone can help?
sendto transfer ETH, usecall{value: amount}("")instead. – Paul Razvan Berg Sep 17 '21 at 09:05} and in Metamask function calls in the "call" instead of "send"?
– bugbytes Sep 17 '21 at 09:32