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:
- Check whether the user has sufficient funds for the transaction
- 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?