I am busy designing a system to use smart contracts. Essentially a user selects a digital item from a website adds them to a basket, enters their wallet address and clicks "pay".

Before a contract can be accepted, some checks need to be run:

  1. Check whether the user has sufficient funds for the transaction
  2. Make sure the digital items are still available (they are managed in the blockchain)

If either fail, then the contract will fail.

My question is simple, what is the cost if a contract fails and who pays this?

1 Answer 1


what is the cost if a contract fails?

When you throw an exception, all gas is consumed. From => Why does a Solidity throw consume all gas?

who pays this?

sender of transactions. from => http://ethdocs.org/en/latest/contracts-and-transactions/account-types-gas-and-transactions.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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