Custom and numbered work examples updated to work without byte arrays. Revisit this...
[robmyers:artworld-ethereum.git] / serpent / owned_stored_work.se
1 OWNER = 0x8802b7f0bfa5e9f5825f2fc708e1ad00d2c2b5d6 // Artist initially
2 WORK = "The art happens here."
3
4 // Make sure we have enough gas to run the contact
5 if tx.value < tx.basefee * 200:
6     // If not, stop
7     stop
8
9 // If there are enough arguments
10 // and the command to return the owner address is given
11 if msg.datasize == 1 and msg.data[0] == "owner":
12     // Return the owning Ethereum address
13     return(OWNER)
14 // If there are enough arguments
15 // and the command to return the artwork is given
16 if msg.datasize == 1 and msg.data[0] == "work":
17     // Return the work
18     return(WORK)
19 // Otherwise
20 else:
21     // Return logical failure
22     return(0)