//if tx.value < tx.basefee * 200: // If not, stop // stop // If registration is being requested if msg.datasize == 3 and msg.data[0] == "register": // If the url/work combination has not been claimed if ! contract.storage[msg.data[1]]: // Set the owner to be the provided Ethereum address contract.storage[msg.data[1]] = msg.sender // Store the artwork hash next to the url ownership information contract.storage[msg.data[1] + 1] = msg.data[2] // return success return(1) // If the sender was trying to overwrite a work they do not own else: // They cannot set it, so return failure return(0) // If ownership confirmation is being requested // Confirm that the work and url hashes match elif msg.datasize == 4 and msg.data[0] == "confirm": // Check the provided hashes against the stored work and url hashes return((contract.storage[msg.data[2]] == msg.data[1]) and (contract.storage[msg.data[2] + 1] == msg.data[3])) // If no action was specified else: // Otherwise do nothing return(0)