Accounts: .
Errors (return code): .
Errors (try catch): .
Results: .
# register works and derivative works data storage[] # per work OFFSET_CREATORS = 0 OFFSET_DERIVED_FROM = 10^12 OFFSET_DERIVED_INTO = 2*10^12 OFFSET_TIMESTAMP = 3*10^12 # per creator OFFSET_WORKS = 0 # to keep a balance OFFSET_CREATORS = 0 def init(): self.storage[OFFSET_CREATORS]=0 def register(workHash): # Simple register only Argument: Hashcode of the work creator = msg.sender if self.storage[workHash]: # Work already registered return (0) else: # Store sender as creator self.storage[workHash]=creator self.storage[workHash+OFFSET_TIMESTAMP]=block.timestamp # Store work as work of sender if not self.storage[creator]: # create entry self.storage[creator]=0 self.storage[creator+self.storage[creator]]=workHash self.storage[creator]+=1 return(1) def queryWork(workHash): # Queries for Status of work only Argument: Hashcode of the work if self.storage[workHash]: return(self.storage[workHash],1) else: return(0) def queryCreator(creator): if not self.storage[creator]: # no work for creator registered return(0) else: return(self.storage[creator]) # Would be better to return a list of works