D
D
drveb12020-05-23 10:28:58
blockchain
drveb1, 2020-05-23 10:28:58

Who pays the fee in the smart contract?

I ask you not to throw stones right away)

With simple transfers to ethereum, everything is clear - the sender pays the commission, but when it comes to a smart contract, questions arise.

Help me to understand.

Let's say there is a smart contract that simply keeps users' money on the balance sheet and, upon request, transfers it back to their wallets.

1) Let's say the user transferred 1 ETH to the contract address, and paid a commission.
Further, the contract must record that this 1 ETH belongs to this particular user.
Do you have to pay a commission for this record? And the contract must pay for it (since he initiates the recording). But how will the contract pay a commission if its account is still 0? Will he take a commission from the balance of the user for whom he makes the record?

2) Suppose, after some time, the user decided to request this 1 ETH to his wallet. The transfer fee is paid by the sender - that is, a smart contract. The same question - where will the contract take the money to pay the commission? From the balance of the same user? It turns out that the user will receive not 1 ETH, but minus the commission?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-05-23
@dimonchik2013

1) the smart has nothing on the account, at any time everything on the wallet accounts is always
paid by the initiator

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question