I have question related to transactions. Is is possible to verify transaction by sender and receiver. For example user A want to send money to user B. User A create transaction, digitaly signed. Miners/validator verify transaction and that mean that user A sending some money to user B. But what if user B is not willing to accept this money? Is there some way to ask user B do you want this money to accept (mybee through contract ..)?
-
it works like a bank, if you send money to some account, it will be registered no matter you want it or not– NulikCommented Aug 27, 2021 at 15:15
-
Is it possible for smart contracts to accept transaction (sending money) only if there is conformation from recipient? Is that revert() function?– explorerCommented Aug 28, 2021 at 6:17
Add a comment
|
1 Answer
You can use revert()
or require(msg.value == 0)
in your fallback function for rejecting coming Ethers. But anyways somebody send Ether to you with selfdestruct()
function. It is a way to forcefully send ether. In EOAs there is no way to rejecting coming money.