Custom and numbered work examples updated to work without byte arrays. Revisit this...
[robmyers:artworld-ethereum.git] / serpent / image_stored_work.se
1 ARTWORK = ['P1\n32 32\n00000000000000010000000', '00000000000000000000000010000000', '000000000000000\n0000000001000000', '00000000000000000000000001000000', '0000000000000000000000\n001100000', '00000000000000000000001100001010', '00001100001000000000100000000\n00', '01011000010000000000100000000000', '01111000100000000001000000000001', '1111\n000100000000001000000000011', '11110110000000000010000000001111', '11100010000\n00000000000000011111', '11000000000000000010000001111111', '110000001000000000\n1000001111111', '11000000000000000000000000111111', '1110000001000000000000000\n000011', '11111000000000000000100000000001', '11111100000100000000000000000111', '\n1111110000000000000010000000011', '11111100000100000000010000001111', '1111000\n000010000000000000000111', '11110000000000000000000100001111', '10000000000100\n00000000000001111', '10000000000010000000000001111100', '000000000001000000000\n0000011100', '00000000000100000000000000101000', '0000000000000000000000000000\n010', '10000000010100000000000000000000', '01010010100000000000000000000000', '000\n0110000000000000000000000000', '00000100000000000000000000000000', '0000010000\n000000000000000000000', '00000010000000000000000']
2
3 ARTWORK.LENGTH = 33
4
5 // Make sure we have enough gas to run the contact
6 if tx.value < tx.basefee * 1000:
7     // If not, stop
8     stop
9
10 // If there are enough arguments
11 // and the command to show the work is being given
12 if msg.datasize == 1 and msg.data[0] == "exhibit":
13     // Just return the artwork
14     return(ARTWORK, ARTWORK.LENGTH)
15 // Otherwise
16 else:
17     // Logical false for failure
18     return(0)