3

I am wondering who pays the fees for transactions initiated by a smart contract in Ethereum?

For example, if I have a contract that simply forwards any payment made into it to someone else, does the contract have to pay its own transaction fees for payments moving out, or does the transaction that initiate the contract have to pay the fees for both its transaction and the resulting transaction coming from the contract?

6

A smart contract can only initiate a transaction when it receives a transaction from either another contract or a user. Thus, all transactions must originate from some user transaction, and it is this transaction that must pay for fees. The amount of fees can be limited by setting the gas limit on that transaction to prevent a malicious contract from consuming a horrendous amount of fees.

Also, all transactions that are the result of a specific user transaction will occur before any other user transactions (and it's subsequent contract transactions) are processed.

-1

Usually there is a small transaction fee on any bitcoin transaction. its 0.0002 i think. If the contract says that there is a additional fee for that contract then i would assume you would have both the transaction fee and the contract fee.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.