Contract con_testfarm21


Contract Code


  
1 import currency # For buy function
2
3 #NFTs are always part of a collection.
4
5 collection_name = Variable() # The name of the collection for display
6 collection_owner = Variable() # Only the owner can mint new NFTs for this collection
7 collection_nfts = Hash(default_value=0) # All NFTs of the collection
8 collection_balances = Hash(default_value=0) # All user balances of the NFTs
9 collection_balances_approvals = Hash(default_value=0) # Approval amounts of certain NFTs
10 plants = Hash(default_value=0) #store various data related to plants and growing seasons
11 metadata = Hash()
12 nicknames = Hash()
13 emergency = Hash()
14
15 random.seed()
16
17 @construct
18 def seed():
19 collection_name.set("Test_plants") # Sets the name
20 collection_owner.set(ctx.caller) # Sets the owner
21 metadata['operator'] = ctx.caller
22
23 metadata['growing_season_length'] = 14
24 metadata['plant price'] = 5
25 metadata['ipfs_contract'] = 'con_testipfs1'
26
27 plants['growing_season'] = False
28 plants['growing_season_start_time'] = now
29 plants['count'] = 0
30 plants['active_generation'] = -1
31 emergency['addresses'] = {
32 'd701fe13fc525264161793a4fc2a16363e5c6ff0080dad25ae0f1041bb967c1b' : 0,
33 '00b82d83ac279bbd42b538afec4bc662d8b99f799474b6359888c6476752fd2a' : 0,
34 'e8dc708028e049397b5baf9579924dde58ce5bebee5655da0b53066117572e73' : 0
35 }
36
37 nicknames = {}
38
39
40 @export
41 def change_metadata(key: str, new_value: str, convert_to_decimal: bool=False):
42 assert ctx.caller == metadata['operator'], "only operator can set metadata"
43 if convert_to_decimal:
44 new_value = decimal(new_value)
45 metadata[key] = new_value
46
47 # function to mint a new NFT
48 def mint_nft(name: str, description: str, ipfs_image_url: str, nft_metadata: dict, amount: int):
49 assert name != "", "Name cannot be empty"
50 assert collection_nfts[name] == 0, "Name already exists"
51 assert amount > 0, "You cannot transfer negative amounts"
52
53 collection_nfts[name] = {"description": description, "ipfs_image_url": ipfs_image_url, "nft_metadata": f"See collection_nfts[{name},'nft_metadata']", "amount": amount} # Adds NFT to collection with all details
54 collection_nfts[name,"nft_metadata"] = nft_metadata
55 collection_balances[ctx.caller, name] = amount # Mints the NFT
56
57 # standard transfer function
58 @export
59 def transfer(name: str, amount:int, to: str):
60 assert amount > 0, "You cannot transfer negative amounts"
61 assert name != "", "Please specify the name of the NFT you want to transfer"
62 assert collection_balances[ctx.caller, name] >= amount, "You don't have enough NFTs to send"
63
64 collection_balances[ctx.caller, name] -= amount # Removes amount from sender
65 collection_balances[to, name] += amount # Adds amount to receiver
66
67 # allows other account to spend on your behalf
68 @export
69 def approve(amount: int, name: str, to: str):
70 assert amount > 0, "Cannot approve negative amounts"
71
72 collection_balances_approvals[ctx.caller, to, name] += amount # Approves certain amount for spending by another account
73
74 # transfers on your behalf
75 @export
76 def transfer_from(name:str, amount:int, to: str, main_account: str):
77 assert amount > 0, 'Cannot send negative balances!'
78
79 assert collection_balances_approvals[main_account, to, name] >= amount, "Not enough NFTs approved to send! You have {} and are trying to spend {}"\
80 .format(collection_balances_approvals[main_account, to, name], amount)
81 assert collection_balances[main_account, name] >= amount, "Not enough NFTs to send!"
82
83 collection_balances_approvals[main_account, to, name] -= amount # Removes Approval Amount
84 collection_balances[main_account, name] -= amount # Removes amount from sender
85
86 collection_balances[to, name] += amount # Adds amount to receiver
87
88 @export
89 def start_growing_season():
90 assert collection_owner.get() == ctx.caller, "Only the owner can start a growing season."
91 grow_season = plants['growing_season']
92 assert grow_season == False, "It is already growing season."
93 growing_season_length = metadata['growing_season_length']
94 active_gen = plants['active_generation']
95 active_gen += 1
96 plants['growing_season'] = True
97 plants['growing_season_start_time'] = now
98 plants['growing_season_end_time'] = now + datetime.timedelta(days = growing_season_length)
99 plants[active_gen, 'finalize_time'] = now + datetime.timedelta(days = growing_season_length + 3)
100 plants['active_generation'] = active_gen
101 plants[active_gen, 'total_berries'] = 0
102 plants[active_gen, 'sellable_berries'] = 0
103 plants[active_gen, 'total_tau'] = 0
104 plants[active_gen, 'claimable_tau'] = 0
105 plants[active_gen,'stale_claim_time'] = now + datetime.timedelta(days = growing_season_length + 30)
106
107
108 @export
109 def buy_plant(nick : str):
110 assert plants['growing_season'] == True, 'The growing season has not started, so you cannot buy a plant.'
111 assert plants['growing_season_end_time'] >= now + datetime.timedelta(days = 12), "It's too far into the growing season and you cannot buy a plant now."
112 assert not nick.isdigit(), "The plant nickname can't be an integer."
113 assert bool(collection_nfts[nick]) == False, "This nickname already exists."
114 assert nick.isalnum() == True, "Only alphanumeric characters allowed."
115 assert nick != "", "Name cannot be empty"
116 assert len(nick) >= 3, "The minimum length is 3 characters."
117 plant_generation = plants['active_generation']
118
119 plant_data = {
120 "current_water": (random.randint(70, 90)),
121 "current_bugs" : (random.randint(5, 25)),
122 "current_photosynthesis" : 0,
123 "current_nutrients" : (random.randint(70, 90)),
124 "current_weeds" : (random.randint(5, 25)),
125 "current_toxicity" : 0,
126 "current_weather" : 1,
127 "last_interaction" : now,
128 "last_daily" : now,
129 "last_calc" : now,
130 "alive" : True,
131 "last_squash_weed" : (now + datetime.timedelta(days = -1)),
132 "last_grow_light" : (now + datetime.timedelta(days = -1)),
133 "burn_amount" : 0
134 }
135
136 plant_calc_data = {
137 "previous_water": plant_data["current_water"],
138 "previous_bugs" : plant_data["current_bugs"],
139 "previous_nutrients" : plant_data["current_nutrients"],
140 "previous_weeds" : plant_data["current_weeds"],
141 "total_water": 0,
142 "total_bugs" : 0,
143 "total_nutrients" : 0,
144 "total_weeds": 0
145 }
146
147 p_count = plants['count'] + 1
148 name = f"Gen_{plant_generation}_{p_count}"
149 collection_nfts[nick] = [plant_generation , p_count]
150 payment(plant_generation, metadata['plant price'])
151
152 #assigns random, one time use IPFS image
153 ipfs_c = importlib.import_module(metadata['ipfs_contract'])
154 ipfs_image_url = ipfs_c.pick_random()
155
156 mint_nft(name,'This is a blueberry plant. Keep it alive and healthy by tending to it during growing season.' , ipfs_image_url , plant_data,1)
157 collection_nfts[name,'plant_calc_data'] = plant_calc_data
158 plants['count'] = p_count
159 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"],ipfs_image_url]
160
161 def action_setup(plant_generation : int, plant_number : int):
162 active_generation = plants['active_generation']
163 assert plant_generation == active_generation, f'The plant you are trying to interact with is not part of the current generation. The current generation is {active_generation}.'
164 name = f'Gen_{plant_generation}_{plant_number}'
165 assert collection_balances[ctx.caller, name] == 1, "You do not own this plant."
166 assert now <= plants['growing_season_end_time'], 'The growing season is not active, so you cannot interact with your plant.'
167 if ctx.caller.startswith('con_'): return
168 plant_data = collection_nfts[name,"nft_metadata"]
169 assert plant_data["alive"] == True, 'Your plant is dead due to neglect and you must buy a new plant to try again. Try not to kill it too.'
170
171 #interaction idle check. If idle too long, plant gets penalized.
172 if now > plant_data['last_interaction'] + datetime.timedelta(hours = 12):
173 plant_data["current_water"] -= (random.randint(5, 15))
174 plant_data["current_bugs"] += (random.randint(5, 15))
175 plant_data["current_nutrients"] -= (random.randint(5, 15))
176 plant_data["current_weeds"] += (random.randint(5, 15))
177
178 plant_data = daily_conditions(plant_data, plant_generation) #checks if weather and other daily conditions need updating
179 plant_data = totalizer_calc(plant_data,name) #checks if enough time has passed to add info to the plant totalizer calculations
180
181 #if (random.randint(1, 10)) == 10 : #10% chance of an event happening #RANDOM EVENTS NOT WORKING. COMMENTING OUT UNTIL FIXED
182 # event_contract = importlib.import_module(metadata['event_handler'])
183 # plant_data = event_contract.event(plant_data)
184
185 plant_data = dead_check(plant_data)
186 plant_data['last_interaction'] = now #resets the interaction time
187
188 plant_all = {
189 'plant_data' : plant_data,
190 'name' : name
191 }
192
193 return plant_all
194
195 def daily_conditions(plant_data, plant_generation):
196 while now - plant_data["last_daily"] > datetime.timedelta(hours = 12) and now < (plants[plant_generation, 'finalize_time'] + datetime.timedelta(days = -3)): #Loops through to calculate changes to plant if it's been more than a day since the last day's changes. Does multiple days worth too if needed
197 current_weather = random.randint(1, 3) # 1=sunny 2=cloudy 3=rainy
198 if current_weather == 1:
199 plant_data["current_water"] -= (random.randint(5, 10)) #how much water is lost each sunny day
200 plant_data["current_photosynthesis"] += (random.randint(4, 7)) #How much photosynthesis increases each sunny day
201 if current_weather == 2:
202 plant_data["current_water"] -= (random.randint(3, 8)) #how much water is lost each cloudy day
203 plant_data["current_photosynthesis"] += (random.randint(2, 4)) #How much photosynthesis increases each cloudy day
204 if current_weather == 3:
205 plant_data["current_water"] += (random.randint(3, 12)) #how much water is gained each rainy day
206 plant_data["current_photosynthesis"] += (random.randint(1, 2)) #How much photosynthesis increases each rainy day
207
208 plant_data["current_bugs"] += (random.randint(3, 10)) #how many bugs are added each day
209 plant_data["current_nutrients"] -= (random.randint(2, 5)) #how many nutrients are consumed each day
210 plant_data["current_weeds"] += (random.randint(2, 10)) #how many weeds grow each day
211 plant_data["last_daily"] += datetime.timedelta(hours = 12)
212 plant_data["current_weather"] = current_weather
213 plant_data['current_toxicity'] -= (random.randint(0, 2))
214
215 if plant_data['current_toxicity'] < 0:
216 plant_data['current_toxicity'] = 0
217
218 if plant_data['current_water'] > 100 : #water can't be above 100%
219 plant_data['current_water'] = 100
220
221 if plant_data["current_photosynthesis"] > 100 :
222 plant_data["burn_amount"] += (plant_data["current_photosynthesis"]-100)
223 plant_data["current_photosynthesis"] = 100
224
225 return plant_data
226
227 def totalizer_calc(plant_data,name):
228 if now > plant_data['last_calc'] + datetime.timedelta(hours = 3):
229 delta = now - plant_data['last_calc']
230 delta_d = (delta.seconds / 86400)
231 plant_calc_data = collection_nfts[name,'plant_calc_data']
232 #This sections performs an integral on the various properties for use in determining total berries produced.
233 plant_calc_data["total_water"] += (delta_d**2*((plant_data["current_water"]/100-plant_calc_data["previous_water"]/100)/(delta_d))/2)+plant_calc_data["previous_water"]/100*delta_d
234 plant_calc_data["total_bugs"] += (delta_d**2*(((1-plant_data["current_bugs"]/100)-(1-plant_calc_data["previous_bugs"]/100))/(delta_d))/2)+(1-plant_calc_data["previous_bugs"]/100)*delta_d
235 plant_calc_data["total_nutrients"] += (delta_d**2*((plant_data["current_nutrients"]/100-plant_calc_data["previous_nutrients"]/100)/(delta_d))/2)+plant_calc_data["previous_nutrients"]/100*delta_d
236 plant_calc_data["total_weeds"] += (delta_d**2*(((1-plant_data["current_weeds"]/100)-(1-plant_calc_data["previous_weeds"]/100))/(delta_d))/2)+(1-plant_calc_data["previous_weeds"]/100)*delta_d
237 plant_data['last_calc'] = now
238 #Updates previous values for next calculation period.
239 plant_calc_data["previous_water"] = plant_data["current_water"]
240 plant_calc_data["previous_bugs"] = plant_data["current_bugs"]
241 plant_calc_data["previous_nutrients"] = plant_data["current_nutrients"]
242 plant_calc_data["previous_weeds"] = plant_data["current_weeds"]
243
244 collection_nfts[name,'plant_calc_data'] = plant_calc_data
245
246 return plant_data
247
248 def dead_check(plant_data): #checks to see if your plant has died.
249 if plant_data["current_toxicity"] >= 100 or plant_data["current_bugs"] >= 100 or plant_data["current_weeds"] >= 100 or plant_data["burn_amount"] >= 100:
250 plant_data["alive"] = False
251 if plant_data["current_water"] <= 0 or plant_data["current_nutrients"] <= 0:
252 plant_data["alive"] = False
253 return plant_data
254
255 @export
256 def water(plant_generation : int, plant_number : int, num_times : int = 1): #Water your plant to increase its current_water.
257 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
258 plant_data = plant_all['plant_data']
259 name = plant_all['name']
260
261 for x in range(0, num_times):
262 plant_data['current_water'] += (random.randint(5, 15))
263 if plant_data['current_water'] > 100 : #water can't be above 1
264 plant_data['current_water'] = 100
265
266 collection_nfts[name,"nft_metadata"] = plant_data
267 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
268
269 @export
270 def squash(plant_generation : int, plant_number : int): #Squash bugs to reduce current_bugs and takes 5 minutes. Share's a timer with pullweeds.
271 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
272 plant_data = plant_all['plant_data']
273 name = plant_all['name']
274
275 t_delta = plant_data["last_squash_weed"] + datetime.timedelta(minutes = 5)
276 assert now > t_delta, f"You are still squashing bugs or pulling weeds. Try again at {t_delta}."
277
278 plant_data['current_bugs'] -= (random.randint(2, 5))
279 if plant_data['current_bugs'] < 0 :
280 plant_data['current_bugs'] = 0
281
282 plant_data["last_squash_weed"] = now
283 collection_nfts[name,"nft_metadata"] = plant_data
284 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
285
286 @export
287 def spraybugs(plant_generation : int, plant_number : int): #Spray bugs to instantly reduce current_bugs but costs tau and adds small amount of toxicity
288 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
289 plant_data = plant_all['plant_data']
290 name = plant_all['name']
291
292 plant_data['current_toxicity'] += (random.randint(1, 3))
293
294 plant_data['current_bugs'] -= (random.randint(10, 20))
295 if plant_data['current_bugs'] < 0 :
296 plant_data['current_bugs'] = 0
297
298 payment(plant_generation, 5)
299 collection_nfts[name,"nft_metadata"] = plant_data
300 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
301
302 @export
303 def growlights(plant_generation : int, plant_number : int): #add photosynthesis to help plant catchup after several rainy days. Adds amount to current_photosynthesis but if it goes over 100%, burns your plant.
304 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
305 plant_data = plant_all['plant_data']
306 name = plant_all['name']
307
308 t_delta = plant_data["last_grow_light"] + datetime.timedelta(hours = 12)
309 assert now > t_delta, f"You have used a grow light or shade too recently. Try again at {t_delta}."
310
311 payment(plant_generation, 5)
312 plant_data['current_photosynthesis'] += (random.randint(3, 5))
313 plant_data["last_grow_light"] = now
314
315 if plant_data["current_photosynthesis"] > 100 :
316 plant_data["burn_amount"] += (plant_data["current_photosynthesis"]-100)
317 plant_data["current_photosynthesis"] = 100
318
319 collection_nfts[name,"nft_metadata"] = plant_data
320 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
321
322 @export
323 def shade(plant_generation : int, plant_number : int): #shades your plant to reduce photosynthesis by a small amount
324 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
325 plant_data = plant_all['plant_data']
326 name = plant_all['name']
327
328 t_delta = plant_data["last_grow_light"] + datetime.timedelta(hours = 12)
329 assert now > t_delta, f"You have used a grow light or shade too recently. Try again at {t_delta}."
330
331 plant_data['current_photosynthesis'] -= (random.randint(3, 5))
332 plant_data["last_grow_light"] = now
333
334 if plant_data["current_photosynthesis"] < 0 :
335 plant_data["current_photosynthesis"] = 0
336
337 collection_nfts[name,"nft_metadata"] = plant_data
338 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
339
340 @export
341 def fertilize(plant_generation : int, plant_number : int, num_times : int = 1): #increases current nutrients of the plant but if nutrients go over 100%, it burns your plant.
342 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
343 plant_data = plant_all['plant_data']
344 name = plant_all['name']
345
346 for x in range(0, num_times):
347 plant_data['current_nutrients'] += (random.randint(4, 6))
348
349 if plant_data['current_nutrients'] > 100 :
350 plant_data["burn_amount"] += (plant_data['current_nutrients']-100)
351 plant_data['current_nutrients'] = 100
352
353 collection_nfts[name,"nft_metadata"] = plant_data
354 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
355
356 @export
357 def pullweeds(plant_generation : int, plant_number : int): #reduces current weeds in plant and takes 5 minutes to do. Share's a timer with squash bugs.
358
359 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
360 plant_data = plant_all['plant_data']
361 name = plant_all['name']
362
363 t_delta = plant_data["last_squash_weed"] + datetime.timedelta(minutes = 5)
364 assert now > t_delta, f"You are still squashing bugs or pulling weeds. Try again at {t_delta}."
365
366 plant_data['current_weeds'] -= (random.randint(2, 5))
367 if plant_data['current_weeds'] < 0 :
368 plant_data['current_weeds'] = 0
369
370 plant_data["last_squash_weed"] = now
371 collection_nfts[name,"nft_metadata"] = plant_data
372 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
373
374 @export
375 def sprayweeds(plant_generation : int, plant_number : int): #Spray weeds to instantly reduce current_weeds but costs tau and adds small amount of toxicity
376 plant_all = action_setup(plant_generation,plant_number) #Runs the main method that performs all of the various checks required for the plant.
377 plant_data = plant_all['plant_data']
378 name = plant_all['name']
379
380 plant_data['current_toxicity'] += (random.randint(1, 3))
381
382 plant_data['current_weeds'] -= (random.randint(10, 20))
383 if plant_data['current_weeds'] < 0 :
384 plant_data['current_weeds'] = 0
385
386 payment(plant_generation, 5)
387
388 collection_nfts[name,"nft_metadata"] = plant_data
389 return [plant_data["current_water"],plant_data["current_photosynthesis"],plant_data["current_bugs"],plant_data["current_nutrients"],plant_data["current_weeds"],plant_data['current_toxicity'],plant_data["burn_amount"],plant_data["current_weather"]]
390
391 @export
392 def finalize(plant_generation : int, plant_number : int): #Finalizes your plant at the end of growing season to deterimine your berry yield.
393 active_generation = plants['active_generation']
394 assert plant_generation == active_generation, f'The plant you are trying to interact with is not part of the current generation. The current generation is {active_generation}.'
395 name = f'Gen_{plant_generation}_{plant_number}'
396 assert collection_balances[ctx.caller, name] == 1, "You do not own this plant."
397 assert collection_nfts[name,'finalized'] == False, 'This plant has already been finalized.'
398 end_time = plants['growing_season_end_time']
399 finalize_time = plants[plant_generation, 'finalize_time']
400 assert now <= finalize_time and now >= end_time, f'It is not time to finalize your plant. Try between {end_time} and {finalize_time}'
401 if ctx.caller.startswith('con_'): return
402 plant_data = collection_nfts[name,"nft_metadata"]
403 plant_data = daily_conditions(plant_data, plant_generation) #checks if weather and other daily conditions need updating
404 plant_data = dead_check(plant_data)
405 if plant_data["alive"] == False:
406 plant_data['last_calc'] = now
407 collection_nfts[name,"nft_metadata"] = plant_data
408 return 'Your plant is dead due to neglect and you cannot grow any berries. Try again next season.'
409
410 if plants['growing_season'] == True : #first person to run this also turns growing_season to false and resets plant counter for next growing season
411 plants['growing_season'] = False
412 plants['count'] = 0
413
414 delta = end_time - plant_data['last_calc']
415 delta_d = (delta.seconds / 86400)
416
417 plant_calc_data = collection_nfts[name,'plant_calc_data']
418 #This sections performs an integral on the various properties for use in determining total berries produced.
419 plant_calc_data["total_water"] += (delta_d**2*((plant_data["current_water"]/100-plant_calc_data["previous_water"]/100)/(delta_d))/2)+plant_calc_data["previous_water"]/100*delta_d
420 plant_calc_data["total_bugs"] += (delta_d**2*(((1-plant_data["current_bugs"]/100)-(1-plant_calc_data["previous_bugs"]/100))/(delta_d))/2)+(1-plant_calc_data["previous_bugs"]/100)*delta_d
421 plant_calc_data["total_nutrients"] += (delta_d**2*((plant_data["current_nutrients"]/100-plant_calc_data["previous_nutrients"]/100)/(delta_d))/2)+plant_calc_data["previous_nutrients"]/100*delta_d
422 plant_calc_data["total_weeds"] += (delta_d**2*(((1-plant_data["current_weeds"]/100)-(1-plant_calc_data["previous_weeds"]/100))/(delta_d))/2)+(1-plant_calc_data["previous_weeds"]/100)*delta_d
423 collection_nfts[name,'plant_calc_data'] = plant_calc_data
424
425 plant_data['last_calc'] = now
426 collection_nfts[name,"nft_metadata"] = plant_data
427
428 length = metadata['growing_season_length']
429 berries = int(1000 * ((plant_calc_data["total_water"]*plant_calc_data["total_bugs"]*plant_calc_data["total_nutrients"]*plant_calc_data["total_weeds"])/(length**4))*(1-plant_data['current_toxicity']/100)*(plant_data["current_photosynthesis"]/100)*(1-plant_data["burn_amount"]/100))
430 collection_nfts[name,'berries'] = berries
431 collection_nfts[name,'final_score'] = berries
432 plants[plant_generation,'total_berries'] += berries
433
434 if plants[plant_generation, 'claimable_tau'] == 0: #sets the total amount of tau that can be claimed by players.
435 plants[plant_generation, 'claimable_tau'] = plants[plant_generation, 'total_tau']
436
437 collection_nfts[name,'finalized'] == True
438 berries = str(berries)
439 return berries
440
441 @export
442 def sellberries(plant_generation : int, plant_number : int): #redeem berries for TAU. Must be done after plant finalize time is over.
443 name = f'Gen_{plant_generation}_{plant_number}'
444 assert collection_balances[ctx.caller, name] == 1, "You do not own this plant."
445 berries = collection_nfts[name,'berries']
446 assert berries > 0, "You don't have any berries to sell."
447 assert now >= plants[plant_generation, 'finalize_time'], f"You can't sell yet. Try again after {plants[plant_generation, 'finalize_time']} but do not wait too long."
448 sell_price = plants[plant_generation, 'total_tau'] / plants[plant_generation,'total_berries']
449 proceeds = sell_price * berries
450 currency.transfer(amount=proceeds, to=ctx.caller)
451 collection_nfts[name,'berries'] = 0
452 plants[plant_generation, 'claimable_tau'] -= proceeds
453 proceeds = str(proceeds)
454 return proceeds
455
456 def payment(plant_generation, amount): #used to process payments
457 dev_reward = 0.05
458 currency.transfer_from(amount=amount*(1-dev_reward), to=ctx.this, main_account=ctx.caller)
459 currency.transfer_from(amount=amount*dev_reward, to=metadata['operator'], main_account=ctx.caller)
460 plants[plant_generation, 'total_tau'] += amount*(1-dev_reward)
461
462 @export
463 def manual_reward_add(plant_generation : int, amount : int): #used to manually add more tau to the prize pool
464 currency.transfer_from(amount=amount, to=ctx.this, main_account=ctx.caller)
465 plants[plant_generation, 'total_tau'] += amount
466
467 @export
468 def stale_claims(plant_generation : int): #used by the operator to claim tau from a plant generation that ended at least 30 days prior. This allows players ample time to sell their berries
469 assert metadata['operator'] == ctx.caller, "Only the operator can claim stale tau."
470 stale_claim_time = plants[plant_generation,'stale_claim_time']
471 assert now >= stale_claim_time, f"The tau is not stale yet and cannot be claimed. Try again after {stale_claim_time}"
472 stale_tau = plants[plant_generation, 'claimable_tau']
473 assert stale_tau > 0, "There is no stale tau to claim."
474 currency.transfer(amount=stale_tau, to=ctx.caller)
475
476 @export
477 def manual_season_end(): #only needed if for some reason there were no finalized plants in the current grow season
478 assert metadata['operator'] == ctx.caller, "Only the operator can do this."
479 assert now > plants['growing_season_end_time'], "You can't end the season before the end_time."
480 plants['growing_season'] = False
481 plants['count'] = 0
482
483 @export
484 def new_nickname(plant_generation : int, plant_number : int, nick : str):
485 name = f'Gen_{plant_generation}_{plant_number}'
486 assert collection_balances[ctx.caller, name] == 1, "You do not own this plant."
487 assert not nick.isdigit(), "The plant nickname can't be an integer."
488 assert bool(collection_nfts[nick]) == False, "This nickname already exists."
489 assert nick.isalnum() == True, "Only alphanumeric characters allowed."
490 assert nick != "", "Name cannot be empty"
491 assert len(nick) >= 3, "The minimum length is 3 characters."
492 payment(plant_generation, 25)
493 collection_nfts[nick] = [plant_generation , plant_number]
494
495 @export
496 def nickname_interaction(nickname : str, function_name :str): #allows players to interact with a plant based on its nickname
497 nick = collection_nfts[nickname]
498
499 function_names = {
500 'water' : water,
501 'squash' : squash,
502 'spraybugs' : spraybugs,
503 'growlights' : growlights,
504 'shade' : shade,
505 'fertilize' : fertilize,
506 'pullweeds' : pullweeds,
507 'sprayweeds' : sprayweeds,
508 'finalize' : finalize,
509 'sellberries' : sellberries
510 }
511
512 return function_names[function_name](nick[0],nick[1])
513
514 @export
515 def e_wdraw_enable(enable:bool):
516 emergency_addresses = emergency['addresses']
517 call_address = ctx.caller
518 assert call_address in emergency_addresses.keys(), "You are not approved to do this."
519 emergency_addresses[call_address] = int(enable)
520 emergency['addresses'] = emergency_addresses
521
522 @export
523 def safe_emergency_withdraw(amount:float): #can only be run if at least 2 of 3 multisig accounts approve of the emergency_withdraw
524 emergency_addresses = emergency['addresses']
525 call_address = ctx.caller
526 approval_check = sum(emergency_addresses.values())
527 assert approval_check >= 2, "An emergency withdrawal is not approved."
528 assert metadata['operator'] == call_address, "Only the operator can claim tau."
529 currency.transfer(amount=amount, to=call_address)
530
531 @export
532 def emergency_withdraw(amount:float): #temporary function used in testing. will be removed from final contract.
533 assert metadata['operator'] == ctx.caller, "Only the operator can claim tau."
534 currency.transfer(amount=amount, to=ctx.caller)

Byte Code

e300000000000000000000000006000000400000007312030000640064016c005a0065016402640364048d025a0265016402640564048d025a03650464006402640664078d035a05650464006402640864078d035a06650464006402640964078d035a07650464006402640a64078d035a0865046402640b64048d025a0965046402640c64048d025a0a65046402640d64048d025a0b650c6a0d83000100640e640f84005a0e650f64028301645c65106510651164119c0364126413840583015a126510651065106513651464149c056415641684045a15650f6402830165106514651064179c0364186419840483015a16650f64028301651465106510641a9c03641b641c840483015a17650f640283016510651465106510641d9c04641e641f840483015a18650f6402830164206421840083015a19650f64028301651064229c0164236424840483015a1a6514651464259c026426642784045a1b6428642984005a1c642a642b84005a1d642c642d84005a1e650f64028301645d651465146514642f9c0364306431840583015a1f650f640283016514651464259c0264326433840483015a20650f640283016514651464259c0264346435840483015a21650f640283016514651464259c0264366437840483015a22650f640283016514651464259c0264386439840483015a23650f64028301645e651465146514642f9c03643a643b840583015a24650f640283016514651464259c02643c643d840483015a25650f640283016514651464259c02643e643f840483015a26650f640283016514651464259c0264406441840483015a27650f640283016514651464259c0264426443840483015a286444644584005a29650f640283016514651464469c0264476448840483015a2a650f64028301651464499c01644a644b840483015a2b650f64028301644c644d840083015a2c650f64028301651465146510644e9c03644f6450840483015a2d650f640283016510651064519c0264526453840483015a2e650f64028301651164549c0164556456840483015a2f650f64028301653064579c0164586459840483015a31650f64028301653064579c01645a645b840483015a3264015300295fe9000000004eda0e636f6e5f746573746661726d3231da0f636f6c6c656374696f6e5f6e616d652902da08636f6e7472616374da046e616d65da10636f6c6c656374696f6e5f6f776e6572da0f636f6c6c656374696f6e5f6e6674732903da0d64656661756c745f76616c756572040000007205000000da13636f6c6c656374696f6e5f62616c616e636573da1d636f6c6c656374696f6e5f62616c616e6365735f617070726f76616c73da06706c616e7473da086d65746164617461da096e69636b6e616d6573da09656d657267656e6379630000000000000000010000000400000043000000737000000074006a0164018301010074026a0174036a048301010074036a04740564023c006403740564043c006405740564063c006407740564083c0064097406640a3c0074077406640b3c00640c7406640d3c0064127406640f3c00640c640c640c64109c03740864113c0069007d006400530029134eda0b546573745f706c616e7473da086f70657261746f72e90e000000da1567726f77696e675f736561736f6e5f6c656e677468e9050000007a0b706c616e74207072696365da0d636f6e5f746573746970667331da0d697066735f636f6e747261637446da0e67726f77696e675f736561736f6eda1967726f77696e675f736561736f6e5f73746172745f74696d657201000000da05636f756e74e901000000da116163746976655f67656e65726174696f6e2903da4064373031666531336663353235323634313631373933613466633261313633363365356336666630303830646164323561653066313034316262393637633162da4030306238326438336163323739626264343262353338616665633462633636326438623939663739393437346236333539383838633634373637353266643261da4065386463373038303238653034393339376235626166393537393932346464653538636535626562656535363535646130623533303636313137353732653733da09616464726573736573e9ffffffff2909da115f5f636f6c6c656374696f6e5f6e616d65da03736574da125f5f636f6c6c656374696f6e5f6f776e6572da03637478da0663616c6c6572da0a5f5f6d65746164617461da085f5f706c616e7473da036e6f77da0b5f5f656d657267656e63792901da0b5f5f6e69636b6e616d6573a900722a000000da00da045f5f5f5f12000000731c00000000010a010c010a010801080108010801080108010803020202010c01722c000000462903da036b6579da096e65775f76616c7565da12636f6e766572745f746f5f646563696d616c630300000000000000030000000300000043000000732e00000074006a017402640119006b02731674036402830182017c02722274047c0183017d017c0174027c003c006400530029034e72100000007a1e6f6e6c79206f70657261746f722063616e20736574206d657461646174612905722300000072240000007225000000da0e417373657274696f6e4572726f72da07646563696d616c2903722d000000722e000000722f000000722a000000722a000000722b000000da0f6368616e67655f6d6574616461746126000000730a00000000021001060104010801723200000029057205000000da0b6465736372697074696f6eda0e697066735f696d6167655f75726cda0c6e66745f6d65746164617461da06616d6f756e74630500000000000000050000000500000043000000736c0000007c0064016b037310740064028301820174017c00190064036b02732474006404830182017c0464036b04733474006405830182017c017c0264067c009b0064079d037c0464089c0474017c003c007c0374017c00640966023c007c04740274036a047c0066023c0064005300290a4e722b0000007a144e616d652063616e6e6f7420626520656d70747972010000007a134e616d6520616c7265616479206578697374737a24596f752063616e6e6f74207472616e73666572206e6567617469766520616d6f756e74737a1453656520636f6c6c656374696f6e5f6e6674735b7a102c276e66745f6d65746164617461275d29047233000000723400000072350000007236000000723500000029057230000000da115f5f636f6c6c656374696f6e5f6e667473da155f5f636f6c6c656374696f6e5f62616c616e63657372230000007224000000290572050000007233000000723400000072350000007236000000722a000000722a000000722b000000da0a5f5f6d696e745f6e66742f000000731000000000021001140110010201020116010c017239000000290372050000007236000000da02746f63030000000000000003000000040000004300000073680000007c0164016b04731074006402830182017c0064036b0373207400640483018201740174026a037c00660219007c016b05733a7400640583018201740174026a037c006602050019007c01380003003c0074017c027c006602050019007c01370003003c006400530029064e72010000007a24596f752063616e6e6f74207472616e73666572206e6567617469766520616d6f756e7473722b0000007a37506c65617365207370656369667920746865206e616d65206f6620746865204e465420796f752077616e7420746f207472616e736665727a22596f7520646f6e2774206861766520656e6f756768204e46547320746f2073656e6429047230000000723800000072230000007224000000290372050000007236000000723a000000722a000000722a000000722b000000da087472616e736665723b000000730c0000000002100110010c010e011601723b000000290372360000007205000000723a000000630300000000000000030000000400000043000000732c0000007c0064016b0473107400640283018201740174026a037c027c016603050019007c00370003003c006400530029034e72010000007a1f43616e6e6f7420617070726f7665206e6567617469766520616d6f756e747329047230000000da1f5f5f636f6c6c656374696f6e5f62616c616e6365735f617070726f76616c7372230000007224000000290372360000007205000000723a000000722a000000722a000000722b000000da07617070726f766545000000730400000000021001723d000000290472050000007236000000723a000000da0c6d61696e5f6163636f756e7463040000000000000004000000060000004300000073960000007c0164016b047310740064028301820174017c037c027c00660319007c016b05733c740064036a0274017c037c027c00660319007c0183028301820174037c037c00660219007c016b057354740064048301820174017c037c027c006603050019007c01380003003c0074037c037c006602050019007c01380003003c0074037c027c006602050019007c01370003003c006400530029054e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a484e6f7420656e6f756768204e46547320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a184e6f7420656e6f756768204e46547320746f2073656e642129047230000000723c000000da06666f726d61747238000000290472050000007236000000723a000000723e000000722a000000722a000000722b000000da0d7472616e736665725f66726f6d4b0000007312000000000210010c010c0114010a010e0116011401724000000063000000000000000003000000040000004300000073de00000074006a01830074026a036b02731674046401830182017405640219007d007c0064036b02732e74046404830182017406640519007d017405640619007d027c02640737007d026408740564023c007407740564093c00740774086a097c01640a8d0117007405640b3c00740774086a097c01640c1700640a8d01170074057c02640d66023c007c02740564063c00640e74057c02640f66023c00640e74057c02641066023c00640e74057c02641166023c00640e74057c02641266023c00740774086a097c0164131700640a8d01170074057c02641466023c006400530029154e7a2a4f6e6c7920746865206f776e65722063616e20737461727420612067726f77696e6720736561736f6e2e7216000000467a1d497420697320616c72656164792067726f77696e6720736561736f6e2e7212000000721a00000072190000005472170000002901da0464617973da1767726f77696e675f736561736f6e5f656e645f74696d65e903000000da0d66696e616c697a655f74696d657201000000da0d746f74616c5f62657272696573da1073656c6c61626c655f62657272696573da09746f74616c5f746175da0d636c61696d61626c655f746175e91e000000da107374616c655f636c61696d5f74696d65290a7222000000da03676574722300000072240000007230000000722600000072250000007227000000da086461746574696d65da0974696d6564656c74612903da0b67726f775f736561736f6e7212000000da0a6163746976655f67656e722a000000722a000000722b000000da1473746172745f67726f77696e675f736561736f6e580000007328000000000206011001080110010801080108010801080106010e010601160108010c010c010c010c01060172500000002901da046e69636b63010000000000000008000000100000004300000073c401000074006401190064026b0273147401640383018201740064041900740274036a04640564068d0117006b05733474016407830182017c006a0583000c0073467401640883018201740674077c001900830164096b02735e7401640a830182017c006a08830064026b0273727401640b830182017c00640c6b0373827401640d8301820174097c008301640e6b0573967401640f830182017400641019007d01740a6a0b641164128302740a6a0b6413641483026415740a6a0b641164128302740a6a0b641364148302641564167402740274026402740274036a04642864068d011700740274036a04642964068d011700641564179c0e7d027c02641819007c02641919007c02641a19007c02641b19006415641564156415641c9c087d037400641d1900641617007d04641e7c019b00641f7c049b009d047d057c017c04670274077c003c00740c7c01740d6420190083020100740e6a0f740d6421190083017d067c066a1083007d0774117c0564227c077c026416830501007c0374077c05642366023c007c047400641d3c007c02641819007c02642419007c02641919007c02641a19007c02641b19007c02642519007c02642619007c02642719007c0767095300292a4e7216000000547a3e5468652067726f77696e6720736561736f6e20686173206e6f7420737461727465642c20736f20796f752063616e6e6f7420627579206120706c616e742e7242000000e90c000000290172410000007a444974277320746f6f2066617220696e746f207468652067726f77696e6720736561736f6e20616e6420796f752063616e6e6f7420627579206120706c616e74206e6f772e7a2754686520706c616e74206e69636b6e616d652063616e277420626520616e20696e74656765722e467a1d54686973206e69636b6e616d6520616c7265616479206578697374732e7a254f6e6c7920616c7068616e756d65726963206368617261637465727320616c6c6f7765642e722b0000007a144e616d652063616e6e6f7420626520656d70747972430000007a23546865206d696e696d756d206c656e677468206973203320636861726163746572732e721a000000e946000000e95a0000007213000000e91900000072010000007219000000290eda0d63757272656e745f7761746572da0c63757272656e745f62756773da1663757272656e745f70686f746f73796e746865736973da1163757272656e745f6e75747269656e7473da0d63757272656e745f7765656473da1063757272656e745f746f786963697479da0f63757272656e745f77656174686572da106c6173745f696e746572616374696f6eda0a6c6173745f6461696c79da096c6173745f63616c63da05616c697665da106c6173745f7371756173685f77656564da0f6c6173745f67726f775f6c69676874da0b6275726e5f616d6f756e74725600000072570000007259000000725a0000002908da0e70726576696f75735f7761746572da0d70726576696f75735f62756773da1270726576696f75735f6e75747269656e7473da0e70726576696f75735f7765656473da0b746f74616c5f7761746572da0a746f74616c5f62756773da0f746f74616c5f6e75747269656e7473da0b746f74616c5f77656564737218000000da0447656e5fda015f7a0b706c616e7420707269636572150000007a5c54686973206973206120626c7565626572727920706c616e742e204b65657020697420616c69766520616e64206865616c7468792062792074656e64696e6720746f20697420647572696e672067726f77696e6720736561736f6e2eda0f706c616e745f63616c635f646174617258000000725b0000007263000000725c000000721f000000721f0000002912722600000072300000007227000000724c000000724d000000da0769736469676974da04626f6f6c7237000000da076973616c6e756dda036c656eda0672616e646f6dda0772616e64696e74da095f5f7061796d656e747225000000da09696d706f72746c6962da0d696d706f72745f6d6f64756c65da0b7069636b5f72616e646f6d723900000029087251000000da10706c616e745f67656e65726174696f6eda0a706c616e745f64617461726e000000da07705f636f756e747205000000da06697066735f637234000000722a000000722a000000722b000000da096275795f706c616e74700000007352000000000206010e010c010e01060112010a010e0114011001140108010a010c010a010e01060110010e01080106010601080108010a010c0110010c010e010e010801040102010a010c01080108010c010c010c01727d00000029027279000000da0c706c616e745f6e756d626572630200000000000000060000000600000043000000733a0100007400640119007d027c007c026b027320740164027c029b0064039d038301820164047c009b0064057c019b009d047d03740274036a047c036602190064066b02734a740164078301820174057400640819006b01735e740164098301820174036a046a06640a8301726e6400530074077c03640b660219007d047c04640c1900640d6b02738e7401640e8301820174057c04640f190074086a09641064118d0117006b04900172087c04641205001900740a6a0b641364148302380003003c007c04641505001900740a6a0b641364148302370003003c007c04641605001900740a6a0b641364148302380003003c007c04641705001900740a6a0b641364148302370003003c00740c7c047c0083027d04740d7c047c0383027d04740e7c0483017d0474057c04640f3c007c047c0364189c027d057c05530029194e721a0000007a6b54686520706c616e7420796f752061726520747279696e6720746f20696e7465726163742077697468206973206e6f742070617274206f66207468652063757272656e742067656e65726174696f6e2e205468652063757272656e742067656e65726174696f6e20697320da012e726c000000726d00000072190000007a1a596f7520646f206e6f74206f776e207468697320706c616e742e72420000007a495468652067726f77696e6720736561736f6e206973206e6f74206163746976652c20736f20796f752063616e6e6f7420696e746572616374207769746820796f757220706c616e742eda04636f6e5f72350000007260000000547a64596f757220706c616e7420697320646561642064756520746f206e65676c65637420616e6420796f75206d757374206275792061206e657720706c616e7420746f2074727920616761696e2e20547279206e6f7420746f206b696c6c20697420746f6f2e725d00000072520000002901da05686f75727372560000007213000000e90f00000072570000007259000000725a0000002902727a0000007205000000290f722600000072300000007238000000722300000072240000007227000000da0a737461727473776974687237000000724c000000724d00000072730000007274000000da125f5f6461696c795f636f6e646974696f6e73da105f5f746f74616c697a65725f63616c63da0c5f5f646561645f636865636b29067279000000727e000000721a0000007205000000727a000000da09706c616e745f616c6c722a000000722a000000722b000000da0e5f5f616374696f6e5f73657475709d000000732e00000000010801180110010c010e010e0106010c0104010c0106010e011a0118011801180118010a010a01080108010a01728800000063020000000000000003000000060000004300000073ce010000900178c674007c0064011900180074016a02640264038d016b046f36740074037c0164046602190074016a02641864068d0117006b00900172c874046a056407640583027d027c0264076b02727e7c0064080500190074046a056409640a8302380003003c007c00640b0500190074046a05640c640d8302370003003c007c02640e6b0272b67c0064080500190074046a056405640f8302380003003c007c00640b0500190074046a05640e640c8302370003003c007c0264056b0272ee7c0064080500190074046a05640564028302370003003c007c00640b0500190074046a056407640e8302370003003c007c0064100500190074046a056405640a8302370003003c007c0064110500190074046a05640e64098302380003003c007c0064120500190074046a05640e640a8302370003003c007c0064010500190074016a02640264038d01370003003c007c027c0064133c007c0064140500190074046a056415640e8302380003003c007c006414190064156b009001728464157c0064143c007c006408190064166b049001729a64167c0064083c007c00640b190064166b0472047c006417050019007c00640b190064161800370003003c0064167c00640b3c00710457007c00530029194e725e0000007252000000290172810000007244000000724300000029017241000000721900000072560000007213000000e90a0000007258000000e904000000e907000000e902000000e90800000072570000007259000000725a000000725c000000725b0000007201000000e9640000007263000000e9fdffffff29067227000000724c000000724d0000007226000000727300000072740000002903727a0000007279000000725c000000722a000000722a000000722b0000007284000000b7000000733800000000011c010c0112010c010801180118010801180118010801180118011801180118011801080118010e0108010e0108010c010e010a010c01728400000063020000000000000005000000080000004300000073ac01000074007c006401190074016a02640264038d0117006b04900172a874007c006401190018007d027c026a0364041b007d0374047c016405660219007d047c046406050019007c03640713007c006408190064091b007c04640a190064091b0018007c031b00140064071b007c04640a190064091b007c0314001700370003003c007c04640b050019007c0364071300640c7c00640d190064091b001800640c7c04640e190064091b00180018007c031b00140064071b00640c7c04640e190064091b0018007c0314001700370003003c007c04640f050019007c03640713007c006410190064091b007c046411190064091b0018007c031b00140064071b007c046411190064091b007c0314001700370003003c007c046412050019007c0364071300640c7c006413190064091b001800640c7c046414190064091b00180018007c031b00140064071b00640c7c046414190064091b0018007c0314001700370003003c0074007c0064013c007c00640819007c04640a3c007c00640d19007c04640e3c007c00641019007c0464113c007c00641319007c0464143c007c0474047c01640566023c007c00530029154e725f0000007243000000290172810000006980510100726e0000007268000000728c0000007256000000728e00000072640000007269000000721900000072570000007265000000726a00000072590000007266000000726b000000725a000000726700000029057227000000724c000000724d000000da077365636f6e647372370000002905727a0000007205000000da0564656c7461da0764656c74615f64726e000000722a000000722a000000722b0000007285000000d6000000732e00000000011a010c010a010c0108022601160108023c010c0108022601160108023c010c0108010c010c010c010c010c017285000000630100000000000000010000000300000043000000735c0000007c006401190064026b0573307c006403190064026b0573307c006404190064026b0573307c006405190064026b05723864067c0064073c007c006408190064096b0173507c00640a190064096b01725864067c0064073c007c005300290b4e725b000000728e0000007257000000725a0000007263000000467260000000725600000072010000007259000000722a0000002901727a000000722a000000722a000000722b0000007286000000f400000073100000000001120114010a0108011201060108017286000000721900000029037279000000727e000000da096e756d5f74696d6573630300000000000000070000000900000043000000739a00000074007c007c0183027d037c03640119007d047c03640219007d05782a740164037c02830244005d1c7d067c0464040500190074026a03640564068302370003003c00712657007c046404190064076b04725a64077c0464043c007c0474047c05640866023c007c04640419007c04640919007c04640a19007c04640b19007c04640c19007c04640d19007c04640e19007c04640f19006708530029104e727a00000072050000007201000000725600000072130000007282000000728e0000007235000000725800000072570000007259000000725a000000725b0000007263000000725c00000029057288000000da0572616e676572730000007274000000723700000029077279000000727e00000072930000007287000000727a0000007205000000da0178722a000000722a000000722b000000da057761746572ff000000731a00000000020a010801080110011c010c0108010c0108010c010c010c01729600000063020000000000000006000000090000004300000073ba00000074007c007c0183027d027c02640119007d037c02640219007d047c036403190074016a02640464058d0117007d0574037c056b047346740464067c059b0064079d03830182017c0364080500190074056a06640964048302380003003c007c0364081900640a6b007272640a7c0364083c0074037c0364033c007c0374077c04640b66023c007c03640c19007c03640d19007c03640819007c03640e19007c03640f19007c03641019007c03641119007c03641219006708530029134e727a0000007205000000726100000072130000002901da076d696e757465737a3c596f7520617265207374696c6c20737175617368696e672062756773206f722070756c6c696e672077656564732e2054727920616761696e20617420727f0000007257000000728c00000072010000007235000000725600000072580000007259000000725a000000725b0000007263000000725c00000029087288000000724c000000724d0000007227000000723000000072730000007274000000723700000029067279000000727e0000007287000000727a0000007205000000da07745f64656c7461722a000000722a000000722b000000da0673717561736810010000731e00000000020a01080108011401180118010c01080108010c0108010c010c010c01729900000063020000000000000005000000090000004300000073a800000074007c007c0183027d027c02640119007d037c02640219007d047c0364030500190074016a02640464058302370003003c007c0364060500190074016a02640764088302380003003c007c036406190064096b00725e64097c0364063c0074037c00640a830201007c0374047c04640b66023c007c03640c19007c03640d19007c03640619007c03640e19007c03640f19007c03640319007c03641019007c03641119006708530029124e727a0000007205000000725b0000007219000000724300000072570000007289000000e914000000720100000072130000007235000000725600000072580000007259000000725a0000007263000000725c00000029057288000000727300000072740000007275000000723700000029057279000000727e0000007287000000727a0000007205000000722a000000722a000000722b000000da0973707261796275677323010000731c00000000020a0108010801180118010c0108010a010c0108010c010c010c01729b00000063020000000000000006000000090000004300000073dc00000074007c007c0183027d027c02640119007d037c02640219007d047c036403190074016a02640464058d0117007d0574037c056b047346740464067c059b0064079d038301820174057c006408830201007c0364090500190074066a07640a64088302370003003c0074037c0364033c007c0364091900640b6b04729c7c03640c050019007c0364091900640b1800370003003c00640b7c0364093c007c0374087c04640d66023c007c03640e19007c03640919007c03640f19007c03641019007c03641119007c03641219007c03640c19007c03641319006708530029144e727a000000720500000072620000007252000000290172810000007a3f596f752068617665207573656420612067726f77206c69676874206f7220736861646520746f6f20726563656e746c792e2054727920616761696e20617420727f000000721300000072580000007243000000728e00000072630000007235000000725600000072570000007259000000725a000000725b000000725c00000029097288000000724c000000724d00000072270000007230000000727500000072730000007274000000723700000029067279000000727e0000007287000000727a00000072050000007298000000722a000000722a000000722b000000da0a67726f776c696768747335010000732200000000020a0108010801140118010a01180108010c01180108010c0108010c010c010c01729c00000063020000000000000006000000090000004300000073ba00000074007c007c0183027d027c02640119007d037c02640219007d047c036403190074016a02640464058d0117007d0574037c056b047346740464067c059b0064079d03830182017c0364080500190074056a066409640a8302380003003c0074037c0364033c007c0364081900640b6b00727a640b7c0364083c007c0374077c04640c66023c007c03640d19007c03640819007c03640e19007c03640f19007c03641019007c03641119007c03641219007c03641319006708530029144e727a000000720500000072620000007252000000290172810000007a3f596f752068617665207573656420612067726f77206c69676874206f7220736861646520746f6f20726563656e746c792e2054727920616761696e20617420727f00000072580000007243000000721300000072010000007235000000725600000072570000007259000000725a000000725b0000007263000000725c00000029087288000000724c000000724d0000007227000000723000000072730000007274000000723700000029067279000000727e0000007287000000727a00000072050000007298000000722a000000722a000000722b000000da0573686164654a010000731e00000000020a010801080114011801180108010c0108010c0108010c010c010c01729d00000063030000000000000007000000090000004300000073b200000074007c007c0183027d037c03640119007d047c03640219007d05782a740164037c02830244005d1c7d067c0464040500190074026a03640564068302370003003c00712657007c046404190064076b0472727c046408050019007c046404190064071800370003003c0064077c0464043c007c0474047c05640966023c007c04640a19007c04640b19007c04640c19007c04640419007c04640d19007c04640e19007c04640819007c04640f19006708530029104e727a000000720500000072010000007259000000728a000000e906000000728e00000072630000007235000000725600000072580000007257000000725a000000725b000000725c00000029057288000000729400000072730000007274000000723700000029077279000000727e00000072930000007287000000727a00000072050000007295000000722a000000722a000000722b000000da0966657274696c697a655d010000731c00000000020a010801080110011c010c01180108010c0108010c010c010c01729f00000063020000000000000006000000090000004300000073ba00000074007c007c0183027d027c02640119007d037c02640219007d047c036403190074016a02640464058d0117007d0574037c056b047346740464067c059b0064079d03830182017c0364080500190074056a06640964048302380003003c007c0364081900640a6b007272640a7c0364083c0074037c0364033c007c0374077c04640b66023c007c03640c19007c03640d19007c03640e19007c03640f19007c03640819007c03641019007c03641119007c03641219006708530029134e727a000000720500000072610000007213000000290172970000007a3c596f7520617265207374696c6c20737175617368696e672062756773206f722070756c6c696e672077656564732e2054727920616761696e20617420727f000000725a000000728c000000720100000072350000007256000000725800000072570000007259000000725b0000007263000000725c00000029087288000000724c000000724d0000007227000000723000000072730000007274000000723700000029067279000000727e0000007287000000727a00000072050000007298000000722a000000722a000000722b000000da0970756c6c77656564736f010000731e00000000020a01080108011401180118010c01080108010c0108010c010c010c0172a000000063020000000000000005000000090000004300000073a800000074007c007c0183027d027c02640119007d037c02640219007d047c0364030500190074016a02640464058302370003003c007c0364060500190074016a02640764088302380003003c007c036406190064096b00725e64097c0364063c0074037c00640a830201007c0374047c04640b66023c007c03640c19007c03640d19007c03640e19007c03640f19007c03640619007c03640319007c03641019007c03641119006708530029124e727a0000007205000000725b00000072190000007243000000725a0000007289000000729a00000072010000007213000000723500000072560000007258000000725700000072590000007263000000725c00000029057288000000727300000072740000007275000000723700000029057279000000727e0000007287000000727a0000007205000000722a000000722a000000722b000000da0a7370726179776565647382010000731c00000000020a0108010801180118010c0108010a010c0108010c010c010c0172a10000006302000000000000000c000000080000004300000073460300007400640119007d027c007c026b027320740164027c029b0064039d038301820164047c009b0064057c019b009d047d03740274036a047c036602190064066b02734a740164078301820174057c0364086602190064096b0273627401640a830182017400640b19007d0474007c00640c660219007d0574067c056b01728674067c046b05739a7401640d7c049b00640e7c059b009d048301820174036a046a07640f830172aa6400530074057c036410660219007d0674087c067c0083027d0674097c0683017d067c066411190064096b0272ec74067c0664123c007c0674057c03641066023c006413530074006414190064156b029001720a6409740064143c006416740064173c007c047c066412190018007d077c076a0a64181b007d0874057c036419660219007d097c09641a050019007c08641b13007c06641c1900641d1b007c09641e1900641d1b0018007c081b001400641b1b007c09641e1900641d1b007c0814001700370003003c007c09641f050019007c08641b130064067c0664201900641d1b00180064067c0964211900641d1b00180018007c081b001400641b1b0064067c0964211900641d1b0018007c0814001700370003003c007c096422050019007c08641b13007c0664231900641d1b007c0964241900641d1b0018007c081b001400641b1b007c0964241900641d1b007c0814001700370003003c007c096425050019007c08641b130064067c0664261900641d1b00180064067c0964271900641d1b00180018007c081b001400641b1b0064067c0964271900641d1b0018007c0814001700370003003c007c0974057c03641966023c0074067c0664123c007c0674057c03641066023c00740b642819007d0a740c64297c09641a19007c09641f190014007c096422190014007c096425190014007c0a642a13001b00140064067c06642b1900641d1b00180014007c06642c1900641d1b00140064067c06642d1900641d1b001800140083017d0b7c0b74057c03642e66023c007c0b74057c03642f66023c0074007c0064306602050019007c0b370003003c0074007c0064316602190064166b029003722a74007c0064326602190074007c00643166023c0074057c0364086602190064156b020100740d7c0b83017d0b7c0b530029334e721a0000007a6b54686520706c616e7420796f752061726520747279696e6720746f20696e7465726163742077697468206973206e6f742070617274206f66207468652063757272656e742067656e65726174696f6e2e205468652063757272656e742067656e65726174696f6e20697320727f000000726c000000726d00000072190000007a1a596f7520646f206e6f74206f776e207468697320706c616e742eda0966696e616c697a6564467a265468697320706c616e742068617320616c7265616479206265656e2066696e616c697a65642e724200000072440000007a334974206973206e6f742074696d6520746f2066696e616c697a6520796f757220706c616e742e20547279206265747765656e207a0520616e6420728000000072350000007260000000725f0000007a59596f757220706c616e7420697320646561642064756520746f206e65676c65637420616e6420796f752063616e6e6f742067726f7720616e7920626572726965732e2054727920616761696e206e65787420736561736f6e2e721600000054720100000072180000006980510100726e0000007268000000728c0000007256000000728e0000007264000000726900000072570000007265000000726a00000072590000007266000000726b000000725a0000007267000000721200000069e8030000728a000000725b00000072580000007263000000da0762657272696573da0b66696e616c5f73636f7265724500000072480000007247000000290e722600000072300000007238000000722300000072240000007237000000722700000072830000007284000000728600000072900000007225000000da03696e74da03737472290c7279000000727e000000721a0000007205000000da08656e645f74696d657244000000727a00000072910000007292000000726e000000da066c656e67746872a3000000722a000000722a000000722b000000da0866696e616c697a6594010000736600000000020801180110010c010e010a010e0108010c0124010c0104010c010a0108010c0108010c0204020e01080108010c010a010c0108023c0108023c010c0108022601160108023c010c010c0108010c01080102045a010c010c0114011201020112011001080172a900000063020000000000000006000000050000004300000073ca00000064017c009b0064027c019b009d047d02740074016a027c026602190064036b02732a740364048301820174047c026405660219007d037c0364066b0473467403640783018201740574067c006408660219006b05736e7403640974067c006408660219009b00640a9d038301820174067c00640b6602190074067c00640c660219001b007d047c047c0314007d0574076a087c0574016a02640d8d020100640674047c02640566023c0074067c00640e6602050019007c05380003003c0074097c0583017d057c055300290f4e726c000000726d00000072190000007a1a596f7520646f206e6f74206f776e207468697320706c616e742e72a300000072010000007a23596f7520646f6e2774206861766520616e79206265727269657320746f2073656c6c2e72440000007a24596f752063616e27742073656c6c207965742e2054727920616761696e206166746572207a1a2062757420646f206e6f74207761697420746f6f206c6f6e672e7247000000724500000029027236000000723a0000007248000000290a7238000000722300000072240000007230000000723700000072270000007226000000da0863757272656e6379723b00000072a600000029067279000000727e000000720500000072a3000000da0a73656c6c5f7072696365da0870726f6365656473722a000000722a000000722b000000da0b73656c6c62657272696573d4010000731e000000000210010c010e010c011001120116010c010c01080110010c011401080172ad000000630200000000000000030000000600000043000000735e0000007400640183017d0274016a027c0164027c021800140074036a0474036a0564038d03010074016a027c017c02140074066404190074036a0564038d03010074077c0064056602050019007c0164027c0218001400370003003c006400530029064e7a04302e3035721900000029037236000000723a000000723e000000721000000072470000002908723100000072aa00000072400000007223000000da0474686973722400000072250000007226000000290372790000007236000000da0a6465765f726577617264722a000000722a000000722b0000007275000000e7010000730c0000000001080112010a010c010e017275000000290272790000007236000000630200000000000000020000000500000043000000732c00000074006a017c0174026a0374026a0464018d03010074057c0064026602050019007c01370003003c006400530029034e29037236000000723a000000723e0000007247000000290672aa0000007240000000722300000072ae00000072240000007226000000290272790000007236000000722a000000722a000000722b000000da116d616e75616c5f7265776172645f616464f001000073040000000002140172b000000029017279000000630100000000000000030000000400000043000000736800000074006401190074016a026b027316740364028301820174047c006403660219007d0174057c016b057338740364047c019b009d028301820174047c006405660219007d027c0264066b047354740364078301820174066a077c0274016a0264088d0201006400530029094e72100000007a264f6e6c7920746865206f70657261746f722063616e20636c61696d207374616c65207461752e724a0000007a4054686520746175206973206e6f74207374616c652079657420616e642063616e6e6f7420626520636c61696d65642e2054727920616761696e20616674657220724800000072010000007a1f5468657265206973206e6f207374616c652074617520746f20636c61696d2e29027236000000723a000000290872250000007223000000722400000072300000007226000000722700000072aa000000723b00000029037279000000724a000000da097374616c655f746175722a000000722a000000722b000000da0c7374616c655f636c61696d73f6010000730e0000000002060110010c0116010c01100172b2000000630000000000000000000000000300000043000000733e00000074006401190074016a026b027316740364028301820174047405640319006b04732a74036404830182016405740564063c006407740564083c006400530029094e72100000007a1e4f6e6c7920746865206f70657261746f722063616e20646f20746869732e72420000007a2d596f752063616e277420656e642074686520736561736f6e206265666f72652074686520656e645f74696d652e467216000000720100000072180000002906722500000072230000007224000000723000000072270000007226000000722a000000722a000000722a000000722b000000da116d616e75616c5f736561736f6e5f656e6401020000730c0000000002060110010e010601080172b300000029037279000000727e000000725100000063030000000000000004000000040000004300000073a600000064017c009b0064027c019b009d047d03740074016a027c036602190064036b02732a74036404830182017c026a0483000c00733c7403640583018201740574067c021900830164066b02735474036407830182017c026a07830064086b02736874036409830182017c02640a6b0373787403640b8301820174087c028301640c6b05738c7403640d8301820174097c00640e830201007c007c01670274067c023c0064005300290f4e726c000000726d00000072190000007a1a596f7520646f206e6f74206f776e207468697320706c616e742e7a2754686520706c616e74206e69636b6e616d652063616e277420626520616e20696e74656765722e467a1d54686973206e69636b6e616d6520616c7265616479206578697374732e547a254f6e6c7920616c7068616e756d65726963206368617261637465727320616c6c6f7765642e722b0000007a144e616d652063616e6e6f7420626520656d70747972430000007a23546865206d696e696d756d206c656e677468206973203320636861726163746572732e7255000000290a7238000000722300000072240000007230000000726f0000007270000000723700000072710000007272000000727500000029047279000000727e00000072510000007205000000722a000000722a000000722b000000da0c6e65775f6e69636b6e616d650b0200007316000000000210010c010e0112010a010e011401100114010a0172b40000002902da086e69636b6e616d65da0d66756e6374696f6e5f6e616d65630200000000000000040000000b00000043000000733800000074007c0019007d02740174027403740474057406740774087409740a64019c0a7d037c037c0119007c02640219007c02640319008302530029044e290a72960000007299000000729b000000729c000000729d000000729f00000072a000000072a100000072a900000072ad00000072010000007219000000290b723700000072960000007299000000729b000000729c000000729d000000729f00000072a000000072a100000072a900000072ad000000290472b500000072b60000007251000000da0e66756e6374696f6e5f6e616d6573722a000000722a000000722b000000da146e69636b6e616d655f696e746572616374696f6e1a020000730c000000000208010401060106010a0172b80000002901da06656e61626c65630100000000000000030000000300000043000000733a0000007400640119007d0174016a027d027c027c016a0383006b067322740464028301820174057c0083017c017c023c007c01740064013c006400530029034e721e0000007a20596f7520617265206e6f7420617070726f76656420746f20646f20746869732e2906722800000072230000007224000000da046b657973723000000072a5000000290372b9000000da13656d657267656e63795f616464726573736573da0c63616c6c5f61646472657373722a000000722a000000722b000000da0e655f77647261775f656e61626c6524020000730c0000000002080106010e0106010c0172bd0000002901723600000063010000000000000004000000040000004300000073500000007400640119007d0174016a027d0274037c016a04830083017d037c0364026b05732a74056403830182017406640419007c026b02733e740564058301820174076a087c007c0264068d0201006400530029074e721e000000728c0000007a28416e20656d657267656e6379207769746864726177616c206973206e6f7420617070726f7665642e72100000007a204f6e6c7920746865206f70657261746f722063616e20636c61696d207461752e29027236000000723a0000002909722800000072230000007224000000da0373756dda0676616c7565737230000000722500000072aa000000723b0000002904723600000072bb00000072bc000000da0e617070726f76616c5f636865636b722a000000722a000000722b000000da17736166655f656d657267656e63795f77697468647261772e020000730e0000000002080106010c01100106010e0172c1000000630100000000000000010000000400000043000000732a00000074006401190074016a026b027316740364028301820174046a057c0074016a0264038d0201006400530029044e72100000007a204f6e6c7920746865206f70657261746f722063616e20636c61696d207461752e29027236000000723a0000002906722500000072230000007224000000723000000072aa000000723b00000029017236000000722a000000722a000000722b000000da12656d657267656e63795f776974686472617739020000730600000000020601100172c20000002901462901721900000029017219000000293372aa000000da085661726961626c6572200000007222000000da044861736872370000007238000000723c00000072260000007225000000722900000072280000007273000000da0473656564722c000000da085f5f6578706f727472a600000072700000007232000000da046469637472a50000007239000000723b000000723d00000072400000007250000000727d000000728800000072840000007285000000728600000072960000007299000000729b000000729c000000729d000000729f00000072a000000072a100000072a900000072ad000000727500000072b000000072b200000072b300000072b400000072b800000072bd000000da05666c6f617472c100000072c2000000722a000000722a000000722a000000722b000000da083c6d6f64756c653e01000000738800000008010c0104010801060108010601080104010a010e010c010c010c0108030814060116080601100b06011409060114050601160c10180601102c101a081f081e080b06011610060112120601121106011214060112120601161106011212060112110601123f060112120809060112050601100a100a0601140e06011209060110090601100a0601