Add registry (needs more work on contract and ui safety). ui updated for contracts...
[robmyers:artworld-ethereum.git] / contract / custom_works_sale.se
1 init:
2     // Price: 1 szabo
3     contract.storage[1001] = 100000000000
4     // Artist
5     contract.storage[1002] = msg.caller
6
7 code:
8     if tx.ether != contract.storage[1001]:
9         return("Wrong price")
10     if contract.storage[msg.sender]:
11         return("Already paid")
12     contract.storage[msg.sender] = msg.sender + 1
13     send(contract.storage[1002], tx.ether, 0)
14     return("OK")