tx · G28scJJKkeyMHMtJrUvHodLtJ1zf6hiRMcLnCWJW7ktP

3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb:  -0.02300000 Waves

2022.06.20 16:52 [2104782] smart account 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb > SELF 0.00000000 Waves

{ "type": 13, "id": "G28scJJKkeyMHMtJrUvHodLtJ1zf6hiRMcLnCWJW7ktP", "fee": 2300000, "feeAssetId": null, "timestamp": 1655733200520, "version": 2, "chainId": 84, "sender": "3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb", "senderPublicKey": "FWSsBbeCwLVkekWhvNKtX6JkrZiruRybKKVuiS3F4bqN", "proofs": [ "c14XxvD7vhq6cbgfZGnmmSxxpxa9ziEUDsCQkZFqShQeeCQBNfzcAvjVCg2mBzRCQKw2K21fQPMsx1JdXBYjPap" ], "script": "base64:AAIFAAAAAAAAAD0IAhIGCgQIAQgIEgYKBAgIAQgSBAoCCAgSBAoCCAgSBAoCCAESBAoCCAgSBAoCCAgSBQoDCAgBEgQKAggBAAAAJgAAAAAKc2hpbnl3Z2dpZAEAAAAgiWnPAv+2urnUcZbXebiZdiawdNB3efRzbobw9HOfBiYAAAAAD3RyZWFzdXJ5QWRkcmVzcwEAAAAaAVRl+PAWCwTAWUJwGp5IjJf/ftwcYvLdu/0AAAAADWFzc2V0c0FkZHJlc3MBAAAAGgFUy+a0wXfXHSctaxYQS8qRSOspiwoalaeaAAAAABJtYXJrZXRwbGFjZUFkZHJlc3MBAAAAGgFUHSG5k/H8GMOnG0lxFkOWUXTrrFQuJbzvAAAAABRjb25maWd1cmF0aW9uQWRkcmVzcwEAAAAaAVTbIMuXkVY/Qg5sp2U1gothv7V0cji00C4AAAAADm5hdGlvbnNBZGRyZXNzAQAAABoBVE2F6N70+ERrWRA7cF/Dt7llDlH1REZtoAAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5u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AgAAAClFcnJvciBwdXR0aW5nIHRoZSBpdGVtIG9uIHRoZSBtYXJrZXRwbGFjZQAAAABGGwKG", "height": 2104782, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5qoMJoDxaiEykem7rHiQQwFfCcLspyC1TJ9MukhtoEQ7 Next: A6k1ebbNzaMxRJt1oUp1pt2rAc6WeJDxy9uHLensCESy Diff:
OldNewDifferences
434434
435435
436436 @Callable(i)
437-func destroyAssetFromUser (assetId) = {
437+func destroyAssetFromUser (assetId,qty) = {
438438 let chunks = getAssetTypeLevel(assetId)
439439 let strAssetType = chunks._1
440440 let level = chunks._2
445445 let assetCoins = tryGetInteger(assetId)
446446 let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power"))
447447 let assetPower = confTryGetInteger((k + "_Power"))
448- let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
449- if ((pw == pw))
450- then match pw {
451- case r: Int =>
452- let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), assetCoins], nil)
453- match tr {
454- case t: Int =>
448+ if (confTryGetBoolean((k + "_Aggregated")))
449+ then {
450+ let unitAssetCoins = ((confTryGetInteger((k + "_Cost")) * 20) / 100)
451+ let qtyAsset = tryGetInteger((k + "_Qty"))
452+ if ((0 > (qtyAsset - qty)))
453+ then throw(("you don't have enough " + strAssetType))
454+ else {
455+ let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - (assetPower * qty))], nil)
456+ match pw {
457+ case r: Int =>
458+ let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), (unitAssetCoins * qty)], nil)
459+ match tr {
460+ case t: Int =>
461+ if (((qtyAsset - qty) > 0))
462+ then [IntegerEntry((k + "_Qty"), (qtyAsset - qty))]
463+ else [DeleteEntry(assetId)]
464+ case _ =>
465+ throw("Error transferring coins")
466+ }
467+ case _ =>
468+ throw("Error setting user power")
469+ }
470+ }
471+ }
472+ else {
473+ let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
474+ match pw {
475+ case r: Int =>
476+ let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), assetCoins], nil)
477+ match tr {
478+ case t: Int =>
455479 [DeleteEntry(assetId)]
456- case _ =>
457- throw("Error transferring coins")
458- }
459- case _ =>
460- throw("Error setting user power")
461- }
462- else throw("Strict value is not equal to itself.")
480+ case _ =>
481+ throw("Error transferring coins")
482+ }
483+ case _ =>
484+ throw("Error setting user power")
485+ }
486+ }
463487 }
464488 }
465489
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let shinywggid = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf'
55
66 let treasuryAddress = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ'
77
88 let assetsAddress = base58'3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb'
99
1010 let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A'
1111
1212 let configurationAddress = base58'3N9tj3b2djcaZozn97VkYchL9S1i6cdEbC1'
1313
1414 let nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy'
1515
1616 let adminWallet = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9")
1717
1818 let dailyGameRewardsWallet = addressFromStringValue("3MuSrXTTiwo9bdoD6FeaBpMUYMiU5saDv2U")
1919
2020 let dailyStakingRewardsWallet = addressFromStringValue("3Mv3mr3uNXdpgkVPApbGEJjMQXqau37DY5i")
2121
2222 func checkAdmin (caller) = if (if (if (if ((caller == adminWallet))
2323 then true
2424 else (caller == this))
2525 then true
2626 else (caller.bytes == assetsAddress))
2727 then true
2828 else (caller.bytes == treasuryAddress))
2929 then true
3030 else (caller.bytes == marketplaceAddress)
3131
3232
3333 func tryGetInteger (key) = match getInteger(this, key) {
3434 case b: Int =>
3535 b
3636 case _ =>
3737 0
3838 }
3939
4040
4141 func tryGetBoolean (key) = match getBoolean(this, key) {
4242 case b: Boolean =>
4343 b
4444 case _ =>
4545 false
4646 }
4747
4848
4949 func tryGetString (key) = match getString(this, key) {
5050 case b: String =>
5151 b
5252 case _ =>
5353 ""
5454 }
5555
5656
5757 func getALKey (Name,Level) = ((Name + "_lvl") + toString(Level))
5858
5959
6060 func confTryGetInteger (key) = match getInteger(Address(configurationAddress), key) {
6161 case b: Int =>
6262 b
6363 case _ =>
6464 0
6565 }
6666
6767
6868 func confTryGetString (key) = match getString(Address(configurationAddress), key) {
6969 case b: String =>
7070 b
7171 case _ =>
7272 ""
7373 }
7474
7575
7676 func confTryGetBoolean (key) = match getBoolean(Address(configurationAddress), key) {
7777 case b: Boolean =>
7878 b
7979 case _ =>
8080 false
8181 }
8282
8383
8484 func getTreasuryKey (nationid) = (nationid + "_Treasury")
8585
8686
8787 func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) {
8888 case b: Int =>
8989 b
9090 case _ =>
9191 0
9292 }
9393
9494
9595 func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) {
9696 case b: Int =>
9797 b
9898 case _ =>
9999 0
100100 }
101101
102102
103103 func nationsTryGetBoolean (key) = match getBoolean(Address(nationsAddress), key) {
104104 case b: Boolean =>
105105 b
106106 case _ =>
107107 false
108108 }
109109
110110
111111 func nationsTryGetString (key) = match getString(Address(nationsAddress), key) {
112112 case b: String =>
113113 b
114114 case _ =>
115115 ""
116116 }
117117
118118
119119 func getAssetOwnerKeyString (assetId) = (assetId + "_Owner")
120120
121121
122122 let BuildStarted = "BUILD_STARTED"
123123
124124 let BuildFinished = "BUILD_FINISHED"
125125
126126 func getAssetIdKey (txId,assetType) = ((assetType + "_") + toBase58String(txId))
127127
128128
129129 func getAssetOwnerKey (txId,assetType) = (getAssetIdKey(txId, assetType) + "_Owner")
130130
131131
132132 func getBuildingFinishHeightKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_fh")
133133
134134
135135 func getBuildingStatusKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_status")
136136
137137
138138 func getAssetTypeLevel (assetStr) = {
139139 let chunks = split(assetStr, "_")
140140 let strAssetType = chunks[0]
141141 let level = parseIntValue(drop(chunks[1], 3))
142142 $Tuple2(strAssetType, level)
143143 }
144144
145145
146146 func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey,transactionId) = {
147147 let chunks = getAssetTypeLevel(assetStr)
148148 let strAssetType = chunks._1
149149 let level = chunks._2
150150 let buildingFinishHeight = getIntegerValue(this, finishHeightKey)
151151 if ((buildingFinishHeight > height))
152152 then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes"))
153153 else if ((take(strAssetType, 4) == "TECH"))
154154 then {
155155 let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, assetStr], nil)
156156 if ((discovered == true))
157157 then [DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
158158 else throw("error discovering technology")
159159 }
160160 else {
161161 let assetPower = confTryGetInteger((assetStr + "_Power"))
162162 let assetCoins = ((confTryGetInteger((assetStr + "_Cost")) * 20) / 100)
163163 let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil)
164164 if ((refCall == refCall))
165165 then if ((assetPower > 0))
166166 then {
167167 let currentPower = nationsTryGetInteger((caller + "_Power"))
168168 let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil)
169169 if ((pw == pw))
170170 then if (confTryGetBoolean((assetStr + "_Aggregated")))
171171 then {
172172 let aggrAssetkey = ((assetStr + "_") + caller)
173173 let coins = tryGetInteger(aggrAssetkey)
174174 let qty = tryGetInteger((aggrAssetkey + "_Qty"))
175175 [DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
176176 }
177177 else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
178178 else throw("Strict value is not equal to itself.")
179179 }
180180 else if (confTryGetBoolean((assetStr + "_Aggregated")))
181181 then {
182182 let aggrAssetkey = ((assetStr + "_") + caller)
183183 let coins = tryGetInteger(aggrAssetkey)
184184 let qty = tryGetInteger((aggrAssetkey + "_Qty"))
185185 [DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
186186 }
187187 else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
188188 else throw("Strict value is not equal to itself.")
189189 }
190190 }
191191
192192
193193 func checkAssetOwner (caller,assetKey) = {
194194 let assetOwner = tryGetString(getAssetOwnerKeyString(assetKey))
195195 (assetOwner == caller)
196196 }
197197
198198
199199 func isNationReservedAsset (Name,Level) = {
200200 let k = getALKey(Name, Level)
201201 confTryGetBoolean((k + "_NationReserved"))
202202 }
203203
204204
205205 func internalTrasnferOwnership (assetId,newOwner) = {
206206 let chunks = getAssetTypeLevel(assetId)
207207 let strAssetType = chunks._1
208208 let level = chunks._2
209209 let k = getALKey(strAssetType, level)
210210 let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
211211 let assetPower = confTryGetInteger((k + "_Power"))
212212 if ((assetPower > 0))
213213 then {
214214 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
215215 let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
216216 if ((pw == pw))
217217 then if ((pw != (currentPower - assetPower)))
218218 then throw("Incorrect invoke result")
219219 else {
220220 let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
221221 let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil)
222222 if ((pw2 == pw2))
223223 then match pw2 {
224224 case r: Int =>
225225 [StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
226226 case _ =>
227227 throw("Incorrect invoke result")
228228 }
229229 else throw("Strict value is not equal to itself.")
230230 }
231231 else throw("Strict value is not equal to itself.")
232232 }
233233 else [StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
234234 }
235235
236236
237237 func CheckAssetBuildableSacrifice (ALKey,caller,SacrificeKey) = {
238238 let assetSac = confTryGetString((ALKey + "_SacrificeAsset"))
239239 let assetSaclvl = confTryGetInteger((ALKey + "_SacrificeAssetLevel"))
240240 if ((assetSac == ""))
241241 then true
242242 else if (!(checkAssetOwner(caller, SacrificeKey)))
243243 then throw("you are not the owner of the asset")
244244 else {
245245 let chunks = getAssetTypeLevel(SacrificeKey)
246246 if (if ((assetSac != chunks._1))
247247 then true
248248 else (assetSaclvl != chunks._2))
249249 then throw("the sacrificeAsset has the wrong type or level")
250250 else true
251251 }
252252 }
253253
254254
255255 func CheckAssetBuildableNation (Name,Level,NationKey,SacrificeKey) = {
256256 let cnfgKey = getALKey(Name, Level)
257257 let tec = confTryGetString((cnfgKey + "_Tecnhology_discovered"))
258258 if ((tec != ""))
259259 then if (nationsTryGetBoolean(((NationKey + "_") + tec)))
260260 then CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey)
261261 else false
262262 else CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey)
263263 }
264264
265265
266266 func CheckAssetBuildableUser (Name,Level,caller,SacrificeKey) = {
267267 let cnfKey = getALKey(Name, Level)
268268 let nationId = nationsTryGetInteger(caller)
269269 if ((nationId == 0))
270270 then false
271271 else {
272272 let tec = confTryGetString((cnfKey + "_Tecnhology_discovered"))
273273 if ((tec != ""))
274274 then {
275275 let NationKey = nationsTryGetString(toString(nationId))
276276 if (nationsTryGetBoolean(((NationKey + "_") + tec)))
277277 then CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey)
278278 else false
279279 }
280280 else CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey)
281281 }
282282 }
283283
284284
285285 func CheckAssetBuildable (Name,Level,Caller,NationKey,SacrificeKey) = if ((NationKey == ""))
286286 then CheckAssetBuildableNation(Name, Level, NationKey, SacrificeKey)
287287 else CheckAssetBuildableUser(Name, Level, Caller, SacrificeKey)
288288
289289
290290 @Callable(i)
291291 func StartBuild (strAssetType,Level,NationKey,SacrificeKey) = if (!(CheckAssetBuildable(strAssetType, Level, toString(i.caller), NationKey, SacrificeKey)))
292292 then throw("You cannot build this Item")
293293 else {
294294 let cnfgKey = getALKey(strAssetType, Level)
295295 let delayForBuilding = confTryGetInteger((cnfgKey + "_BuildTime"))
296296 let assetBuildCost = confTryGetInteger((cnfgKey + "_Cost"))
297297 let ToAdminWallet = ((assetBuildCost * 5) / 100)
298298 let ToGameRewardsWallet = ((assetBuildCost * 10) / 100)
299299 let ToStakingRewardsWallet = ((assetBuildCost * 65) / 100)
300300 let UnitStakeSheg = (((assetBuildCost - ToAdminWallet) - ToGameRewardsWallet) - ToStakingRewardsWallet)
301301 if (isNationReservedAsset(strAssetType, Level))
302302 then if (if (!(checkAssetOwner(toString(i.caller), NationKey)))
303303 then !(checkAdmin(i.caller))
304304 else false)
305305 then throw("You are not the owner of the nation")
306306 else {
307307 let nationsheg = treasuryTryGetInteger(getTreasuryKey(NationKey))
308308 if ((assetBuildCost > nationsheg))
309309 then throw("The nation hasn't enough funds")
310310 else {
311311 let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil)
312312 match d {
313313 case r: Int =>
314314 let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, UnitStakeSheg], nil)
315315 match pw {
316316 case b: Int =>
317317 let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil)
318318 match transfer {
319319 case t: Int =>
320320 [StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, cnfgKey), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, cnfgKey), NationKey), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, cnfgKey), (height + delayForBuilding))]
321321 case _ =>
322322 throw("Error Distributing asset rewards")
323323 }
324324 case _ =>
325325 throw("Error Depositing nation funds")
326326 }
327327 case _ =>
328328 throw("Error Depositing nation funds")
329329 }
330330 }
331331 }
332332 else {
333333 let assetSac = confTryGetString((cnfgKey + "_SacrificeAsset"))
334334 if ((assetSac != ""))
335335 then {
336336 let pw = invoke(Address(treasuryAddress), "NoPaymentDeposit", [toString(i.caller), UnitStakeSheg], nil)
337337 match pw {
338338 case r: Int =>
339339 let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil)
340340 match transfer {
341341 case t: Int =>
342342 [DeleteEntry(SacrificeKey), StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, cnfgKey), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, cnfgKey), NationKey), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, cnfgKey), (height + delayForBuilding))]
343343 case _ =>
344344 throw("Error Distributing asset rewards")
345345 }
346346 case _ =>
347347 throw("Error adding deposit")
348348 }
349349 }
350350 else {
351351 let amountIn = value(i.payments[0].amount)
352352 if ((assetBuildCost > amountIn))
353353 then throw(("You provided less $heg than the needed cost for building this " + strAssetType))
354354 else if ((i.payments[0].assetId != shinywggid))
355355 then throw("Only $HEG payments allowed")
356356 else {
357357 let pw = invoke(Address(treasuryAddress), "Deposit", nil, [AttachedPayment(shinywggid, UnitStakeSheg)])
358358 match pw {
359359 case r: Int =>
360360 [StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, cnfgKey), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, cnfgKey), toString(i.originCaller)), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, cnfgKey), (height + delayForBuilding)), ScriptTransfer(adminWallet, ToAdminWallet, shinywggid), ScriptTransfer(dailyGameRewardsWallet, ToGameRewardsWallet, shinywggid), ScriptTransfer(dailyStakingRewardsWallet, ToStakingRewardsWallet, shinywggid)]
361361 case _ =>
362362 throw("Incorrect invoke result")
363363 }
364364 }
365365 }
366366 }
367367 }
368368
369369
370370
371371 @Callable(i)
372372 func FinishBuild (txIdStr,assetStr,Level,NationKey) = {
373373 let txId = fromBase58String(txIdStr)
374374 let ALKey = getALKey(assetStr, Level)
375375 let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, ALKey)
376376 let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, ALKey)
377377 let assetKey = getAssetIdKey(txId, ALKey)
378378 let assetOwner = tryGetString(getAssetOwnerKey(txId, ALKey))
379379 if (isNationReservedAsset(assetStr, Level))
380380 then if (if (!(checkAssetOwner(toString(i.caller), NationKey)))
381381 then !(checkAdmin(i.caller))
382382 else false)
383383 then throw("You are not authorized to perform this operation")
384384 else internalFinishBuild(NationKey, ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId)
385385 else if ((assetOwner != toString(i.caller)))
386386 then throw(("You cannot claim other's players " + assetStr))
387387 else {
388388 let buildingTxStatus = tryGetString(BuildingStatusKey)
389389 if ((buildingTxStatus == ""))
390390 then throw("No pending operations for this asset")
391391 else internalFinishBuild(toString(i.caller), ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId)
392392 }
393393 }
394394
395395
396396
397397 @Callable(i)
398398 func transferOwnership (assetId,newOwner) = if (!(checkAdmin(i.caller)))
399399 then throw("Only the admin can perform this operation")
400400 else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner)
401401
402402
403403
404404 @Callable(i)
405405 func destroyAssetAndTransfer (assetId,toAddress) = {
406406 let chunks = getAssetTypeLevel(assetId)
407407 let strAssetType = chunks._1
408408 let level = chunks._2
409409 let k = getALKey(strAssetType, level)
410410 if (!(checkAdmin(i.caller)))
411411 then throw("Only the admin can perform this operation")
412412 else {
413413 let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
414414 let assetCoins = tryGetInteger(assetId)
415415 let refCall = invoke(Address(treasuryAddress), "adminTransfer", [addressFromStringValue(toAddress), assetCoins], nil)
416416 if ((refCall == refCall))
417417 then {
418418 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
419419 let assetPower = confTryGetInteger((k + "_Power"))
420420 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
421421 if ((pw == pw))
422422 then match pw {
423423 case r: Int =>
424424 [DeleteEntry(assetId)]
425425 case _ =>
426426 throw("Error setting user power")
427427 }
428428 else throw("Strict value is not equal to itself.")
429429 }
430430 else throw("Strict value is not equal to itself.")
431431 }
432432 }
433433
434434
435435
436436 @Callable(i)
437-func destroyAssetFromUser (assetId) = {
437+func destroyAssetFromUser (assetId,qty) = {
438438 let chunks = getAssetTypeLevel(assetId)
439439 let strAssetType = chunks._1
440440 let level = chunks._2
441441 let k = getALKey(strAssetType, level)
442442 if (!(checkAssetOwner(toString(i.caller), assetId)))
443443 then throw("You don't own this asset")
444444 else {
445445 let assetCoins = tryGetInteger(assetId)
446446 let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power"))
447447 let assetPower = confTryGetInteger((k + "_Power"))
448- let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
449- if ((pw == pw))
450- then match pw {
451- case r: Int =>
452- let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), assetCoins], nil)
453- match tr {
454- case t: Int =>
448+ if (confTryGetBoolean((k + "_Aggregated")))
449+ then {
450+ let unitAssetCoins = ((confTryGetInteger((k + "_Cost")) * 20) / 100)
451+ let qtyAsset = tryGetInteger((k + "_Qty"))
452+ if ((0 > (qtyAsset - qty)))
453+ then throw(("you don't have enough " + strAssetType))
454+ else {
455+ let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - (assetPower * qty))], nil)
456+ match pw {
457+ case r: Int =>
458+ let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), (unitAssetCoins * qty)], nil)
459+ match tr {
460+ case t: Int =>
461+ if (((qtyAsset - qty) > 0))
462+ then [IntegerEntry((k + "_Qty"), (qtyAsset - qty))]
463+ else [DeleteEntry(assetId)]
464+ case _ =>
465+ throw("Error transferring coins")
466+ }
467+ case _ =>
468+ throw("Error setting user power")
469+ }
470+ }
471+ }
472+ else {
473+ let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
474+ match pw {
475+ case r: Int =>
476+ let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), assetCoins], nil)
477+ match tr {
478+ case t: Int =>
455479 [DeleteEntry(assetId)]
456- case _ =>
457- throw("Error transferring coins")
458- }
459- case _ =>
460- throw("Error setting user power")
461- }
462- else throw("Strict value is not equal to itself.")
480+ case _ =>
481+ throw("Error transferring coins")
482+ }
483+ case _ =>
484+ throw("Error setting user power")
485+ }
486+ }
463487 }
464488 }
465489
466490
467491
468492 @Callable(i)
469493 func setNationOwner (nationKey,newOwner) = if (checkAdmin(i.caller))
470494 then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true)
471495 else {
472496 let currentOwner = tryGetString((nationKey + "_Owner"))
473497 if ((currentOwner != toString(i.caller)))
474498 then throw("You are not the nation owner")
475499 else [StringEntry((nationKey + "_Owner"), newOwner)]
476500 }
477501
478502
479503
480504 @Callable(i)
481505 func buyNationItem (assetId,NationKey) = {
482506 let chunks = getAssetTypeLevel(assetId)
483507 let strAssetType = chunks._1
484508 let level = chunks._2
485509 let k = getALKey(strAssetType, level)
486510 let n = nationsTryGetInteger(toString(i.caller))
487511 let nid = nationsTryGetInteger(NationKey)
488512 if ((n != nid))
489513 then throw("you can buy assets only from your nation")
490514 else if (!(checkAssetOwner(NationKey, assetId)))
491515 then throw("The asset does not belong to the nation")
492516 else if (!(isNationReservedAsset(strAssetType, level)))
493517 then throw("this asset cannot be sold by the nation")
494518 else {
495519 let assetPrice = confTryGetInteger((getALKey(strAssetType, level) + "_SellPrice"))
496520 let amountIn = value(i.payments[0].amount)
497521 if ((assetPrice > amountIn))
498522 then throw(("You provided less $heg than the needed cost for buying this " + strAssetType))
499523 else if ((i.payments[0].assetId != shinywggid))
500524 then throw("Only $HEG payments allowed")
501525 else {
502526 let a = invoke(Address(treasuryAddress), "increaseNationWallet", [NationKey, amountIn], nil)
503527 match a {
504528 case b: Int =>
505529 (internalTrasnferOwnership(assetId, toString(i.caller)) :+ ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid))
506530 case _ =>
507531 throw("Error transferring SHEG to nations wallet")
508532 }
509533 }
510534 }
511535 }
512536
513537
514538
515539 @Callable(i)
516540 func AddAssetFromMarkeplace (assetId,oldOwner,assetSheg) = if (!(checkAdmin(i.caller)))
517541 then throw("You are not allowed to perform this operation")
518542 else $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), oldOwner), IntegerEntry(assetId, assetSheg)], oldOwner)
519543
520544
521545
522546 @Callable(i)
523547 func TransferAssetToMarketplace (assetId,sellprice) = if (!(checkAssetOwner(toString(i.caller), assetId)))
524548 then throw("You are not the owner of this asset")
525549 else {
526550 let assetSheg = tryGetInteger(assetId)
527551 let tr = invoke(Address(marketplaceAddress), "putOnSale", [assetId, assetSheg, sellprice], nil)
528552 match tr {
529553 case t: Int =>
530554 [DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(assetId)]
531555 case _ =>
532556 throw("Error putting the item on the marketplace")
533557 }
534558 }
535559
536560

github/deemru/w8io/026f985 
80.47 ms