1 HEX = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]
2 ARTWORK = ["<svg><rect x=\"23\" y=\"23\" ", "height=\"123\" width=\"123\" ", "style=\"fill:none;stroke:#", ";stroke-width:32\" /></svg>"]
6 // Make sure we have enough gas to run the contact
7 //if tx.value < tx.basefee * 500:
11 // If there are enough arguments
12 // and the command to create the work is being given
13 if msg.datasize == 1 and msg.data[0] == "create":
14 artwork = array(ARTWORK.LENGTH)
15 artwork[0] = ARTWORK[0]
16 artwork[1] = ARTWORK[1]
17 artwork[2] = ARTWORK[2]
18 artwork[9] = ARTWORK[3]
19 // Copy the most significant hex bytes of the key as an html colour
21 hash.bytes = msg.sender
23 current.byte = hash.bytes % 256
24 hash.bytes = hash.bytes / 256
25 hi = HEX[current.byte / 16]
26 lo = HEX[current.byte % 16]
27 artwork[ARTWORK.INSERT.END - (index * 2)] = lo
28 artwork[ARTWORK.INSERT.END - (index * 2) + 1] = hi
30 return(artwork, ARTWORK.LENGTH)
33 // Logical false for failure