3

So I recently purchased ether.pizza with the intention of setting it up so people can order pizza with ether just to use as an experiment in Dapp and contract development.

Initially I plan on just doing the ordering manually and letting users pick pizza places from Locu. I'll just my own credit card and will either hang onto the ether or I might just use shapeshift to convert it to bitcoins. Locu's API does have prices so I was planning on just trusting those and canceling the contract if the price turns out to be wrong.

Obviously I shouldn't get any money though until someone gets their pizza however I'm not sure the best way to handle the escrow. Is this even possible? What if I found an api that could tell me when the food was delivered?

I'm not looking for detailed instruction just a general design pattern for the contract.

  • 1
    I really like that kind of questions on Ethereum.SE, but it's clear you did not do your homework yet. If you could answer the question "What have you tried so far?" and point out where you get stuck, we can certainly reopen this thread. – Afr Mar 16 '16 at 23:04
  • I don't think it's too broad a question. I'm asking about contract design. I don't need someone to hold my hand through the development process I just want to talk design patterns. – hadees Mar 16 '16 at 23:28
  • Forget contracts for a moment and think about it as an economic or reputation game. For inspiration look at: dappsforbeginners.wordpress.com/tutorials/two-party-contracts and perhaps in a wider sense you might like to look at slideshare.net/mids106/dapp-design-patterns then you might be able to clarify the question. – JackWinters Mar 16 '16 at 23:58
6

Obviously I shouldn't get any money though until someone gets their pizza however I'm not sure the best way to handle the escrow.

A general pattern for escrow is that the buyer would send funds to the escrow smart contract. As part of sending the funds, the seller's address is specified in the transaction (as well as data like Pizza ID). When the contract receives proof from an authoritative source or oracle, that the pizza was accepted, the contract transfers the escrowed funds to the seller.

The simplest oracle is the buyer. But more oracles are needed to resolve disputes, and the escrow contract would codify precisely how settlement is performed.

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.