tx · 5qoMJoDxaiEykem7rHiQQwFfCcLspyC1TJ9MukhtoEQ7

3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb:  -0.02200000 Waves

2022.06.14 15:19 [2096036] smart account 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb > SELF 0.00000000 Waves

{ "type": 13, "id": "5qoMJoDxaiEykem7rHiQQwFfCcLspyC1TJ9MukhtoEQ7", "fee": 2200000, "feeAssetId": null, "timestamp": 1655209174739, "version": 2, "chainId": 84, "sender": "3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb", "senderPublicKey": "FWSsBbeCwLVkekWhvNKtX6JkrZiruRybKKVuiS3F4bqN", "proofs": [ "21HpMN7584TEuj6CrbqTb9C3vjDFSmvewhTmnDUpmPAoAHsuUf5w12WoqeLziQkoHmLemwsjkk22eXHeEryW9J4a" ], "script": "base64:AAIFAAAAAAAAADwIAhIGCgQIAQgIEgYKBAgIAQgSBAoCCAgSBAoCCAgSAwoBCBIECgIICBIECgIICBIFCgMICAESBAoCCAEAAAAmAAAAAApzaGlueXdnZ2lkAQAAACCJac8C/7a6udRxltd5uJl2JrB00Hd59HNuhvD0c58GJgAAAAAPdHJlYXN1cnlBZGRyZXNzAQAAABoBVGX48BYLBMBZQnAankiMl/9+3Bxi8t27/QAAAAANYXNzZXRzQWRkcmVzcwEAAAAaAVTL5rTBd9cdJy1rFhBLypFI6ymLChqVp5oAAAAAEm1hcmtldHBsYWNlQWRkcmVzcwEAAAAaAVQdIbmT8fwYw6cbSXEWQ5ZRdOusVC4lvO8AAAAAFGNvbmZpZ3VyYXRpb25BZGRyZXNzAQAAABoBVNsgy5eRVj9CDmynZTWCi2G/tXRyOLTQLgAAAAAObmF0aW9uc0FkZHJlc3MBAAAAGgFUTYXo3vT4RGtZEDtwX8O3uWUOUfVERm2gAAAAAAthZG1pbldhbGxldAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01wTnRpUFNSU3E2Tm5hUVlrMzhCZ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nkAAAACBQAAAAdhc3NldElkBQAAAAlhc3NldFNoZWcFAAAAA25pbAUAAAAIb2xkT3duZXIAAAABaQEAAAAaVHJhbnNmZXJBc3NldFRvTWFya2V0cGxhY2UAAAACAAAAB2Fzc2V0SWQAAAAJc2VsbHByaWNlAwkBAAAAASEAAAABCQEAAAAPY2hlY2tBc3NldE93bmVyAAAAAgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIFAAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAjWW91IGFyZSBub3QgdGhlIG93bmVyIG9mIHRoaXMgYXNzZXQEAAAACWFzc2V0U2hlZwkBAAAADXRyeUdldEludGVnZXIAAAABBQAAAAdhc3NldElkBAAAAAJ0cgkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEFAAAAEm1hcmtldHBsYWNlQWRkcmVzcwIAAAAJcHV0T25TYWxlCQAETAAAAAIFAAAAB2Fzc2V0SWQJAARMAAAAAgUAAAAJYXNzZXRTaGVnCQAETAAAAAIFAAAACXNlbGxwcmljZQUAAAADbmlsBQAAAANuaWwEAAAAByRtYXRjaDAFAAAAAnRyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXQFAAAAByRtYXRjaDAJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAFmdldEFzc2V0T3duZXJLZXlTdHJpbmcAAAABBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAAClFcnJvciBwdXR0aW5nIHRoZSBpdGVtIG9uIHRoZSBtYXJrZXRwbGFjZQAAAACXVvOo", "height": 2096036, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D7j759sdyeFc1fHRd4DbhL386hUQ3xwpnLLrp1v5sdbq Next: G28scJJKkeyMHMtJrUvHodLtJ1zf6hiRMcLnCWJW7ktP Diff:
OldNewDifferences
143143 }
144144
145145
146-func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = {
146+func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey,transactionId) = {
147147 let chunks = getAssetTypeLevel(assetStr)
148148 let strAssetType = chunks._1
149149 let level = chunks._2
150- let k = getALKey(strAssetType, level)
151150 let buildingFinishHeight = getIntegerValue(this, finishHeightKey)
152151 if ((buildingFinishHeight > height))
153152 then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes"))
154153 else if ((take(strAssetType, 4) == "TECH"))
155154 then {
156- let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, k], nil)
155+ let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, assetStr], nil)
157156 if ((discovered == true))
158157 then [DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
159158 else throw("error discovering technology")
160159 }
161160 else {
162- let assetPower = confTryGetInteger((k + "_Power"))
163- let assetCoins = ((confTryGetInteger((k + "_Cost")) * 20) / 100)
161+ let assetPower = confTryGetInteger((assetStr + "_Power"))
162+ let assetCoins = ((confTryGetInteger((assetStr + "_Cost")) * 20) / 100)
164163 let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil)
165164 if ((refCall == refCall))
166165 then if ((assetPower > 0))
168167 let currentPower = nationsTryGetInteger((caller + "_Power"))
169168 let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil)
170169 if ((pw == pw))
171- then [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
170+ then if (confTryGetBoolean((assetStr + "_Aggregated")))
171+ then {
172+ let aggrAssetkey = ((assetStr + "_") + caller)
173+ let coins = tryGetInteger(aggrAssetkey)
174+ let qty = tryGetInteger((aggrAssetkey + "_Qty"))
175+[DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
176+ }
177+ else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
172178 else throw("Strict value is not equal to itself.")
173179 }
174- else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
180+ else if (confTryGetBoolean((assetStr + "_Aggregated")))
181+ then {
182+ let aggrAssetkey = ((assetStr + "_") + caller)
183+ let coins = tryGetInteger(aggrAssetkey)
184+ let qty = tryGetInteger((aggrAssetkey + "_Qty"))
185+[DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
186+ }
187+ else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
175188 else throw("Strict value is not equal to itself.")
176189 }
177190 }
304317 let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil)
305318 match transfer {
306319 case t: Int =>
307-[StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, strAssetType), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, strAssetType), NationKey), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, strAssetType), (height + delayForBuilding))]
320+[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))]
308321 case _ =>
309322 throw("Error Distributing asset rewards")
310323 }
326339 let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil)
327340 match transfer {
328341 case t: Int =>
329-[DeleteEntry(SacrificeKey), StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, strAssetType), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, strAssetType), NationKey), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, strAssetType), (height + delayForBuilding))]
342+[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))]
330343 case _ =>
331344 throw("Error Distributing asset rewards")
332345 }
344357 let pw = invoke(Address(treasuryAddress), "Deposit", nil, [AttachedPayment(shinywggid, UnitStakeSheg)])
345358 match pw {
346359 case r: Int =>
347-[StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, strAssetType), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, strAssetType), toString(i.originCaller)), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, strAssetType), (height + delayForBuilding)), ScriptTransfer(adminWallet, ToAdminWallet, shinywggid), ScriptTransfer(dailyGameRewardsWallet, ToGameRewardsWallet, shinywggid), ScriptTransfer(dailyStakingRewardsWallet, ToStakingRewardsWallet, shinywggid)]
360+[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)]
348361 case _ =>
349362 throw("Incorrect invoke result")
350363 }
358371 @Callable(i)
359372 func FinishBuild (txIdStr,assetStr,Level,NationKey) = {
360373 let txId = fromBase58String(txIdStr)
361- let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, assetStr)
362- let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, assetStr)
363- let assetKey = getAssetIdKey(txId, assetStr)
364- let assetOwner = tryGetString(getAssetOwnerKey(txId, assetStr))
374+ let ALKey = getALKey(assetStr, Level)
375+ let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, ALKey)
376+ let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, ALKey)
377+ let assetKey = getAssetIdKey(txId, ALKey)
378+ let assetOwner = tryGetString(getAssetOwnerKey(txId, ALKey))
365379 if (isNationReservedAsset(assetStr, Level))
366380 then if (if (!(checkAssetOwner(toString(i.caller), NationKey)))
367381 then !(checkAdmin(i.caller))
368382 else false)
369383 then throw("You are not authorized to perform this operation")
370- else internalFinishBuild(NationKey, assetStr, assetKey, BuildingStatusKey, finishHeightKey)
384+ else internalFinishBuild(NationKey, ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId)
371385 else if ((assetOwner != toString(i.caller)))
372386 then throw(("You cannot claim other's players " + assetStr))
373387 else {
374388 let buildingTxStatus = tryGetString(BuildingStatusKey)
375389 if ((buildingTxStatus == ""))
376390 then throw("No pending operations for this asset")
377- else internalFinishBuild(toString(i.caller), assetStr, assetKey, BuildingStatusKey, finishHeightKey)
391+ else internalFinishBuild(toString(i.caller), ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId)
378392 }
379393 }
380394
381395
382396
383397 @Callable(i)
384-func transferOwnership (assetId,newOwner) = {
385- let strAssetType = split(assetId, "_")[0]
386- if (!(checkAdmin(i.caller)))
387- then throw("Only the admin can perform this operation")
388- else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner)
389- }
398+func transferOwnership (assetId,newOwner) = if (!(checkAdmin(i.caller)))
399+ then throw("Only the admin can perform this operation")
400+ else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner)
390401
391402
392403
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
146-func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = {
146+func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey,transactionId) = {
147147 let chunks = getAssetTypeLevel(assetStr)
148148 let strAssetType = chunks._1
149149 let level = chunks._2
150- let k = getALKey(strAssetType, level)
151150 let buildingFinishHeight = getIntegerValue(this, finishHeightKey)
152151 if ((buildingFinishHeight > height))
153152 then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes"))
154153 else if ((take(strAssetType, 4) == "TECH"))
155154 then {
156- let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, k], nil)
155+ let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, assetStr], nil)
157156 if ((discovered == true))
158157 then [DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
159158 else throw("error discovering technology")
160159 }
161160 else {
162- let assetPower = confTryGetInteger((k + "_Power"))
163- let assetCoins = ((confTryGetInteger((k + "_Cost")) * 20) / 100)
161+ let assetPower = confTryGetInteger((assetStr + "_Power"))
162+ let assetCoins = ((confTryGetInteger((assetStr + "_Cost")) * 20) / 100)
164163 let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil)
165164 if ((refCall == refCall))
166165 then if ((assetPower > 0))
167166 then {
168167 let currentPower = nationsTryGetInteger((caller + "_Power"))
169168 let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil)
170169 if ((pw == pw))
171- then [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
170+ then if (confTryGetBoolean((assetStr + "_Aggregated")))
171+ then {
172+ let aggrAssetkey = ((assetStr + "_") + caller)
173+ let coins = tryGetInteger(aggrAssetkey)
174+ let qty = tryGetInteger((aggrAssetkey + "_Qty"))
175+[DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
176+ }
177+ else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
172178 else throw("Strict value is not equal to itself.")
173179 }
174- else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
180+ else if (confTryGetBoolean((assetStr + "_Aggregated")))
181+ then {
182+ let aggrAssetkey = ((assetStr + "_") + caller)
183+ let coins = tryGetInteger(aggrAssetkey)
184+ let qty = tryGetInteger((aggrAssetkey + "_Qty"))
185+[DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
186+ }
187+ else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
175188 else throw("Strict value is not equal to itself.")
176189 }
177190 }
178191
179192
180193 func checkAssetOwner (caller,assetKey) = {
181194 let assetOwner = tryGetString(getAssetOwnerKeyString(assetKey))
182195 (assetOwner == caller)
183196 }
184197
185198
186199 func isNationReservedAsset (Name,Level) = {
187200 let k = getALKey(Name, Level)
188201 confTryGetBoolean((k + "_NationReserved"))
189202 }
190203
191204
192205 func internalTrasnferOwnership (assetId,newOwner) = {
193206 let chunks = getAssetTypeLevel(assetId)
194207 let strAssetType = chunks._1
195208 let level = chunks._2
196209 let k = getALKey(strAssetType, level)
197210 let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
198211 let assetPower = confTryGetInteger((k + "_Power"))
199212 if ((assetPower > 0))
200213 then {
201214 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
202215 let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
203216 if ((pw == pw))
204217 then if ((pw != (currentPower - assetPower)))
205218 then throw("Incorrect invoke result")
206219 else {
207220 let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
208221 let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil)
209222 if ((pw2 == pw2))
210223 then match pw2 {
211224 case r: Int =>
212225 [StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
213226 case _ =>
214227 throw("Incorrect invoke result")
215228 }
216229 else throw("Strict value is not equal to itself.")
217230 }
218231 else throw("Strict value is not equal to itself.")
219232 }
220233 else [StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
221234 }
222235
223236
224237 func CheckAssetBuildableSacrifice (ALKey,caller,SacrificeKey) = {
225238 let assetSac = confTryGetString((ALKey + "_SacrificeAsset"))
226239 let assetSaclvl = confTryGetInteger((ALKey + "_SacrificeAssetLevel"))
227240 if ((assetSac == ""))
228241 then true
229242 else if (!(checkAssetOwner(caller, SacrificeKey)))
230243 then throw("you are not the owner of the asset")
231244 else {
232245 let chunks = getAssetTypeLevel(SacrificeKey)
233246 if (if ((assetSac != chunks._1))
234247 then true
235248 else (assetSaclvl != chunks._2))
236249 then throw("the sacrificeAsset has the wrong type or level")
237250 else true
238251 }
239252 }
240253
241254
242255 func CheckAssetBuildableNation (Name,Level,NationKey,SacrificeKey) = {
243256 let cnfgKey = getALKey(Name, Level)
244257 let tec = confTryGetString((cnfgKey + "_Tecnhology_discovered"))
245258 if ((tec != ""))
246259 then if (nationsTryGetBoolean(((NationKey + "_") + tec)))
247260 then CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey)
248261 else false
249262 else CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey)
250263 }
251264
252265
253266 func CheckAssetBuildableUser (Name,Level,caller,SacrificeKey) = {
254267 let cnfKey = getALKey(Name, Level)
255268 let nationId = nationsTryGetInteger(caller)
256269 if ((nationId == 0))
257270 then false
258271 else {
259272 let tec = confTryGetString((cnfKey + "_Tecnhology_discovered"))
260273 if ((tec != ""))
261274 then {
262275 let NationKey = nationsTryGetString(toString(nationId))
263276 if (nationsTryGetBoolean(((NationKey + "_") + tec)))
264277 then CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey)
265278 else false
266279 }
267280 else CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey)
268281 }
269282 }
270283
271284
272285 func CheckAssetBuildable (Name,Level,Caller,NationKey,SacrificeKey) = if ((NationKey == ""))
273286 then CheckAssetBuildableNation(Name, Level, NationKey, SacrificeKey)
274287 else CheckAssetBuildableUser(Name, Level, Caller, SacrificeKey)
275288
276289
277290 @Callable(i)
278291 func StartBuild (strAssetType,Level,NationKey,SacrificeKey) = if (!(CheckAssetBuildable(strAssetType, Level, toString(i.caller), NationKey, SacrificeKey)))
279292 then throw("You cannot build this Item")
280293 else {
281294 let cnfgKey = getALKey(strAssetType, Level)
282295 let delayForBuilding = confTryGetInteger((cnfgKey + "_BuildTime"))
283296 let assetBuildCost = confTryGetInteger((cnfgKey + "_Cost"))
284297 let ToAdminWallet = ((assetBuildCost * 5) / 100)
285298 let ToGameRewardsWallet = ((assetBuildCost * 10) / 100)
286299 let ToStakingRewardsWallet = ((assetBuildCost * 65) / 100)
287300 let UnitStakeSheg = (((assetBuildCost - ToAdminWallet) - ToGameRewardsWallet) - ToStakingRewardsWallet)
288301 if (isNationReservedAsset(strAssetType, Level))
289302 then if (if (!(checkAssetOwner(toString(i.caller), NationKey)))
290303 then !(checkAdmin(i.caller))
291304 else false)
292305 then throw("You are not the owner of the nation")
293306 else {
294307 let nationsheg = treasuryTryGetInteger(getTreasuryKey(NationKey))
295308 if ((assetBuildCost > nationsheg))
296309 then throw("The nation hasn't enough funds")
297310 else {
298311 let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil)
299312 match d {
300313 case r: Int =>
301314 let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, UnitStakeSheg], nil)
302315 match pw {
303316 case b: Int =>
304317 let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil)
305318 match transfer {
306319 case t: Int =>
307-[StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, strAssetType), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, strAssetType), NationKey), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, strAssetType), (height + delayForBuilding))]
320+[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))]
308321 case _ =>
309322 throw("Error Distributing asset rewards")
310323 }
311324 case _ =>
312325 throw("Error Depositing nation funds")
313326 }
314327 case _ =>
315328 throw("Error Depositing nation funds")
316329 }
317330 }
318331 }
319332 else {
320333 let assetSac = confTryGetString((cnfgKey + "_SacrificeAsset"))
321334 if ((assetSac != ""))
322335 then {
323336 let pw = invoke(Address(treasuryAddress), "NoPaymentDeposit", [toString(i.caller), UnitStakeSheg], nil)
324337 match pw {
325338 case r: Int =>
326339 let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil)
327340 match transfer {
328341 case t: Int =>
329-[DeleteEntry(SacrificeKey), StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, strAssetType), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, strAssetType), NationKey), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, strAssetType), (height + delayForBuilding))]
342+[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))]
330343 case _ =>
331344 throw("Error Distributing asset rewards")
332345 }
333346 case _ =>
334347 throw("Error adding deposit")
335348 }
336349 }
337350 else {
338351 let amountIn = value(i.payments[0].amount)
339352 if ((assetBuildCost > amountIn))
340353 then throw(("You provided less $heg than the needed cost for building this " + strAssetType))
341354 else if ((i.payments[0].assetId != shinywggid))
342355 then throw("Only $HEG payments allowed")
343356 else {
344357 let pw = invoke(Address(treasuryAddress), "Deposit", nil, [AttachedPayment(shinywggid, UnitStakeSheg)])
345358 match pw {
346359 case r: Int =>
347-[StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, strAssetType), BuildStarted), StringEntry(getAssetOwnerKey(i.transactionId, strAssetType), toString(i.originCaller)), IntegerEntry(getBuildingFinishHeightKey(toString(i.originCaller), i.transactionId, strAssetType), (height + delayForBuilding)), ScriptTransfer(adminWallet, ToAdminWallet, shinywggid), ScriptTransfer(dailyGameRewardsWallet, ToGameRewardsWallet, shinywggid), ScriptTransfer(dailyStakingRewardsWallet, ToStakingRewardsWallet, shinywggid)]
360+[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)]
348361 case _ =>
349362 throw("Incorrect invoke result")
350363 }
351364 }
352365 }
353366 }
354367 }
355368
356369
357370
358371 @Callable(i)
359372 func FinishBuild (txIdStr,assetStr,Level,NationKey) = {
360373 let txId = fromBase58String(txIdStr)
361- let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, assetStr)
362- let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, assetStr)
363- let assetKey = getAssetIdKey(txId, assetStr)
364- let assetOwner = tryGetString(getAssetOwnerKey(txId, assetStr))
374+ let ALKey = getALKey(assetStr, Level)
375+ let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, ALKey)
376+ let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, ALKey)
377+ let assetKey = getAssetIdKey(txId, ALKey)
378+ let assetOwner = tryGetString(getAssetOwnerKey(txId, ALKey))
365379 if (isNationReservedAsset(assetStr, Level))
366380 then if (if (!(checkAssetOwner(toString(i.caller), NationKey)))
367381 then !(checkAdmin(i.caller))
368382 else false)
369383 then throw("You are not authorized to perform this operation")
370- else internalFinishBuild(NationKey, assetStr, assetKey, BuildingStatusKey, finishHeightKey)
384+ else internalFinishBuild(NationKey, ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId)
371385 else if ((assetOwner != toString(i.caller)))
372386 then throw(("You cannot claim other's players " + assetStr))
373387 else {
374388 let buildingTxStatus = tryGetString(BuildingStatusKey)
375389 if ((buildingTxStatus == ""))
376390 then throw("No pending operations for this asset")
377- else internalFinishBuild(toString(i.caller), assetStr, assetKey, BuildingStatusKey, finishHeightKey)
391+ else internalFinishBuild(toString(i.caller), ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId)
378392 }
379393 }
380394
381395
382396
383397 @Callable(i)
384-func transferOwnership (assetId,newOwner) = {
385- let strAssetType = split(assetId, "_")[0]
386- if (!(checkAdmin(i.caller)))
387- then throw("Only the admin can perform this operation")
388- else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner)
389- }
398+func transferOwnership (assetId,newOwner) = if (!(checkAdmin(i.caller)))
399+ then throw("Only the admin can perform this operation")
400+ else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner)
390401
391402
392403
393404 @Callable(i)
394405 func destroyAssetAndTransfer (assetId,toAddress) = {
395406 let chunks = getAssetTypeLevel(assetId)
396407 let strAssetType = chunks._1
397408 let level = chunks._2
398409 let k = getALKey(strAssetType, level)
399410 if (!(checkAdmin(i.caller)))
400411 then throw("Only the admin can perform this operation")
401412 else {
402413 let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
403414 let assetCoins = tryGetInteger(assetId)
404415 let refCall = invoke(Address(treasuryAddress), "adminTransfer", [addressFromStringValue(toAddress), assetCoins], nil)
405416 if ((refCall == refCall))
406417 then {
407418 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
408419 let assetPower = confTryGetInteger((k + "_Power"))
409420 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
410421 if ((pw == pw))
411422 then match pw {
412423 case r: Int =>
413424 [DeleteEntry(assetId)]
414425 case _ =>
415426 throw("Error setting user power")
416427 }
417428 else throw("Strict value is not equal to itself.")
418429 }
419430 else throw("Strict value is not equal to itself.")
420431 }
421432 }
422433
423434
424435
425436 @Callable(i)
426437 func destroyAssetFromUser (assetId) = {
427438 let chunks = getAssetTypeLevel(assetId)
428439 let strAssetType = chunks._1
429440 let level = chunks._2
430441 let k = getALKey(strAssetType, level)
431442 if (!(checkAssetOwner(toString(i.caller), assetId)))
432443 then throw("You don't own this asset")
433444 else {
434445 let assetCoins = tryGetInteger(assetId)
435446 let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power"))
436447 let assetPower = confTryGetInteger((k + "_Power"))
437448 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
438449 if ((pw == pw))
439450 then match pw {
440451 case r: Int =>
441452 let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), assetCoins], nil)
442453 match tr {
443454 case t: Int =>
444455 [DeleteEntry(assetId)]
445456 case _ =>
446457 throw("Error transferring coins")
447458 }
448459 case _ =>
449460 throw("Error setting user power")
450461 }
451462 else throw("Strict value is not equal to itself.")
452463 }
453464 }
454465
455466
456467
457468 @Callable(i)
458469 func setNationOwner (nationKey,newOwner) = if (checkAdmin(i.caller))
459470 then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true)
460471 else {
461472 let currentOwner = tryGetString((nationKey + "_Owner"))
462473 if ((currentOwner != toString(i.caller)))
463474 then throw("You are not the nation owner")
464475 else [StringEntry((nationKey + "_Owner"), newOwner)]
465476 }
466477
467478
468479
469480 @Callable(i)
470481 func buyNationItem (assetId,NationKey) = {
471482 let chunks = getAssetTypeLevel(assetId)
472483 let strAssetType = chunks._1
473484 let level = chunks._2
474485 let k = getALKey(strAssetType, level)
475486 let n = nationsTryGetInteger(toString(i.caller))
476487 let nid = nationsTryGetInteger(NationKey)
477488 if ((n != nid))
478489 then throw("you can buy assets only from your nation")
479490 else if (!(checkAssetOwner(NationKey, assetId)))
480491 then throw("The asset does not belong to the nation")
481492 else if (!(isNationReservedAsset(strAssetType, level)))
482493 then throw("this asset cannot be sold by the nation")
483494 else {
484495 let assetPrice = confTryGetInteger((getALKey(strAssetType, level) + "_SellPrice"))
485496 let amountIn = value(i.payments[0].amount)
486497 if ((assetPrice > amountIn))
487498 then throw(("You provided less $heg than the needed cost for buying this " + strAssetType))
488499 else if ((i.payments[0].assetId != shinywggid))
489500 then throw("Only $HEG payments allowed")
490501 else {
491502 let a = invoke(Address(treasuryAddress), "increaseNationWallet", [NationKey, amountIn], nil)
492503 match a {
493504 case b: Int =>
494505 (internalTrasnferOwnership(assetId, toString(i.caller)) :+ ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid))
495506 case _ =>
496507 throw("Error transferring SHEG to nations wallet")
497508 }
498509 }
499510 }
500511 }
501512
502513
503514
504515 @Callable(i)
505516 func AddAssetFromMarkeplace (assetId,oldOwner,assetSheg) = if (!(checkAdmin(i.caller)))
506517 then throw("You are not allowed to perform this operation")
507518 else $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), oldOwner), IntegerEntry(assetId, assetSheg)], oldOwner)
508519
509520
510521
511522 @Callable(i)
512523 func TransferAssetToMarketplace (assetId,sellprice) = if (!(checkAssetOwner(toString(i.caller), assetId)))
513524 then throw("You are not the owner of this asset")
514525 else {
515526 let assetSheg = tryGetInteger(assetId)
516527 let tr = invoke(Address(marketplaceAddress), "putOnSale", [assetId, assetSheg, sellprice], nil)
517528 match tr {
518529 case t: Int =>
519530 [DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(assetId)]
520531 case _ =>
521532 throw("Error putting the item on the marketplace")
522533 }
523534 }
524535
525536

github/deemru/w8io/169f3d6 
90.20 ms