Custom and numbered work examples updated to work without byte arrays. Revisit this...
[robmyers:artworld-ethereum.git] / serpent / catalogue_raisonne.se
1 ARTIST = 0x8802b7f0bfa5e9f5825f2fc708e1ad00d2c2b5d6
2
3 // Make sure we have enough gas to run the contact
4 if tx.value < tx.basefee * 200:
5     // If not, stop
6     stop
7     
8 // If the message is from the artist
9 if msg.datasize == 1 and msg.sender == ARTIST:
10     // Add the work to the catalog
11     contract.storage[msg.data[0]] = 1
12     return(1)
13 // check inclusion
14 else if msg.datasize == 1:
15     // Check whether the artwork is in the catalog
16     return(contract.storage[msg.data[0]])
17 // Otherwise
18 else:
19     return(0)