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/tXRyOLTQLgAAAAAObmF0aW9uc0FkZHJlc3MBAAAAGgFUTYXo3vT4RGtZEDtwX8O3uWUOUfVERm2gAAAAAAthZG1pbldhbGxldAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01wTnRpUFNSU3E2Tm5hUVlrMzhCZld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kAAAACBQAAAAdhc3NldElkBQAAAAlhc3NldFNoZWcFAAAAA25pbAUAAAAIb2xkT3duZXIAAAABaQEAAAAaVHJhbnNmZXJBc3NldFRvTWFya2V0cGxhY2UAAAACAAAAB2Fzc2V0SWQAAAAJc2VsbHByaWNlAwkBAAAAASEAAAABCQEAAAAPY2hlY2tBc3NldE93bmVyAAAAAgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIFAAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAjWW91IGFyZSBub3QgdGhlIG93bmVyIG9mIHRoaXMgYXNzZXQEAAAACWFzc2V0U2hlZwkBAAAADXRyeUdldEludGVnZXIAAAABBQAAAAdhc3NldElkBAAAAAJ0cgkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEFAAAAEm1hcmtldHBsYWNlQWRkcmVzcwIAAAAJcHV0T25TYWxlCQAETAAAAAIFAAAAB2Fzc2V0SWQJAARMAAAAAgUAAAAJYXNzZXRTaGVnCQAETAAAAAIFAAAACXNlbGxwcmljZQUAAAADbmlsBQAAAANuaWwEAAAAByRtYXRjaDAFAAAAAnRyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXQFAAAAByRtYXRjaDAJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAFmdldEFzc2V0T3duZXJLZXlTdHJpbmcAAAABBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAAClFcnJvciBwdXR0aW5nIHRoZSBpdGVtIG9uIHRoZSBtYXJrZXRwbGFjZQAAAACXVvOo", "height": 2096036, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D7j759sdyeFc1fHRd4DbhL386hUQ3xwpnLLrp1v5sdbq Next: G28scJJKkeyMHMtJrUvHodLtJ1zf6hiRMcLnCWJW7ktP Diff:
Old | New | Differences | |
---|---|---|---|
143 | 143 | } | |
144 | 144 | ||
145 | 145 | ||
146 | - | func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = { | |
146 | + | func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey,transactionId) = { | |
147 | 147 | let chunks = getAssetTypeLevel(assetStr) | |
148 | 148 | let strAssetType = chunks._1 | |
149 | 149 | let level = chunks._2 | |
150 | - | let k = getALKey(strAssetType, level) | |
151 | 150 | let buildingFinishHeight = getIntegerValue(this, finishHeightKey) | |
152 | 151 | if ((buildingFinishHeight > height)) | |
153 | 152 | then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes")) | |
154 | 153 | else if ((take(strAssetType, 4) == "TECH")) | |
155 | 154 | then { | |
156 | - | let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, | |
155 | + | let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, assetStr], nil) | |
157 | 156 | if ((discovered == true)) | |
158 | 157 | then [DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
159 | 158 | else throw("error discovering technology") | |
160 | 159 | } | |
161 | 160 | else { | |
162 | - | let assetPower = confTryGetInteger(( | |
163 | - | let assetCoins = ((confTryGetInteger(( | |
161 | + | let assetPower = confTryGetInteger((assetStr + "_Power")) | |
162 | + | let assetCoins = ((confTryGetInteger((assetStr + "_Cost")) * 20) / 100) | |
164 | 163 | let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil) | |
165 | 164 | if ((refCall == refCall)) | |
166 | 165 | then if ((assetPower > 0)) | |
168 | 167 | let currentPower = nationsTryGetInteger((caller + "_Power")) | |
169 | 168 | let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil) | |
170 | 169 | 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)] | |
172 | 178 | else throw("Strict value is not equal to itself.") | |
173 | 179 | } | |
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)] | |
175 | 188 | else throw("Strict value is not equal to itself.") | |
176 | 189 | } | |
177 | 190 | } | |
304 | 317 | let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil) | |
305 | 318 | match transfer { | |
306 | 319 | case t: Int => | |
307 | - | [StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, | |
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))] | |
308 | 321 | case _ => | |
309 | 322 | throw("Error Distributing asset rewards") | |
310 | 323 | } | |
326 | 339 | let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil) | |
327 | 340 | match transfer { | |
328 | 341 | case t: Int => | |
329 | - | [DeleteEntry(SacrificeKey), StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, | |
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))] | |
330 | 343 | case _ => | |
331 | 344 | throw("Error Distributing asset rewards") | |
332 | 345 | } | |
344 | 357 | let pw = invoke(Address(treasuryAddress), "Deposit", nil, [AttachedPayment(shinywggid, UnitStakeSheg)]) | |
345 | 358 | match pw { | |
346 | 359 | case r: Int => | |
347 | - | [StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, | |
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)] | |
348 | 361 | case _ => | |
349 | 362 | throw("Incorrect invoke result") | |
350 | 363 | } | |
358 | 371 | @Callable(i) | |
359 | 372 | func FinishBuild (txIdStr,assetStr,Level,NationKey) = { | |
360 | 373 | 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)) | |
365 | 379 | if (isNationReservedAsset(assetStr, Level)) | |
366 | 380 | then if (if (!(checkAssetOwner(toString(i.caller), NationKey))) | |
367 | 381 | then !(checkAdmin(i.caller)) | |
368 | 382 | else false) | |
369 | 383 | then throw("You are not authorized to perform this operation") | |
370 | - | else internalFinishBuild(NationKey, | |
384 | + | else internalFinishBuild(NationKey, ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId) | |
371 | 385 | else if ((assetOwner != toString(i.caller))) | |
372 | 386 | then throw(("You cannot claim other's players " + assetStr)) | |
373 | 387 | else { | |
374 | 388 | let buildingTxStatus = tryGetString(BuildingStatusKey) | |
375 | 389 | if ((buildingTxStatus == "")) | |
376 | 390 | then throw("No pending operations for this asset") | |
377 | - | else internalFinishBuild(toString(i.caller), | |
391 | + | else internalFinishBuild(toString(i.caller), ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId) | |
378 | 392 | } | |
379 | 393 | } | |
380 | 394 | ||
381 | 395 | ||
382 | 396 | ||
383 | 397 | @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) | |
390 | 401 | ||
391 | 402 | ||
392 | 403 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let shinywggid = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf' | |
5 | 5 | ||
6 | 6 | let treasuryAddress = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ' | |
7 | 7 | ||
8 | 8 | let assetsAddress = base58'3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb' | |
9 | 9 | ||
10 | 10 | let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A' | |
11 | 11 | ||
12 | 12 | let configurationAddress = base58'3N9tj3b2djcaZozn97VkYchL9S1i6cdEbC1' | |
13 | 13 | ||
14 | 14 | let nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy' | |
15 | 15 | ||
16 | 16 | let adminWallet = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9") | |
17 | 17 | ||
18 | 18 | let dailyGameRewardsWallet = addressFromStringValue("3MuSrXTTiwo9bdoD6FeaBpMUYMiU5saDv2U") | |
19 | 19 | ||
20 | 20 | let dailyStakingRewardsWallet = addressFromStringValue("3Mv3mr3uNXdpgkVPApbGEJjMQXqau37DY5i") | |
21 | 21 | ||
22 | 22 | func checkAdmin (caller) = if (if (if (if ((caller == adminWallet)) | |
23 | 23 | then true | |
24 | 24 | else (caller == this)) | |
25 | 25 | then true | |
26 | 26 | else (caller.bytes == assetsAddress)) | |
27 | 27 | then true | |
28 | 28 | else (caller.bytes == treasuryAddress)) | |
29 | 29 | then true | |
30 | 30 | else (caller.bytes == marketplaceAddress) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func tryGetInteger (key) = match getInteger(this, key) { | |
34 | 34 | case b: Int => | |
35 | 35 | b | |
36 | 36 | case _ => | |
37 | 37 | 0 | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
42 | 42 | case b: Boolean => | |
43 | 43 | b | |
44 | 44 | case _ => | |
45 | 45 | false | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func tryGetString (key) = match getString(this, key) { | |
50 | 50 | case b: String => | |
51 | 51 | b | |
52 | 52 | case _ => | |
53 | 53 | "" | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getALKey (Name,Level) = ((Name + "_lvl") + toString(Level)) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func confTryGetInteger (key) = match getInteger(Address(configurationAddress), key) { | |
61 | 61 | case b: Int => | |
62 | 62 | b | |
63 | 63 | case _ => | |
64 | 64 | 0 | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func confTryGetString (key) = match getString(Address(configurationAddress), key) { | |
69 | 69 | case b: String => | |
70 | 70 | b | |
71 | 71 | case _ => | |
72 | 72 | "" | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func confTryGetBoolean (key) = match getBoolean(Address(configurationAddress), key) { | |
77 | 77 | case b: Boolean => | |
78 | 78 | b | |
79 | 79 | case _ => | |
80 | 80 | false | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func getTreasuryKey (nationid) = (nationid + "_Treasury") | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) { | |
88 | 88 | case b: Int => | |
89 | 89 | b | |
90 | 90 | case _ => | |
91 | 91 | 0 | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) { | |
96 | 96 | case b: Int => | |
97 | 97 | b | |
98 | 98 | case _ => | |
99 | 99 | 0 | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func nationsTryGetBoolean (key) = match getBoolean(Address(nationsAddress), key) { | |
104 | 104 | case b: Boolean => | |
105 | 105 | b | |
106 | 106 | case _ => | |
107 | 107 | false | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func nationsTryGetString (key) = match getString(Address(nationsAddress), key) { | |
112 | 112 | case b: String => | |
113 | 113 | b | |
114 | 114 | case _ => | |
115 | 115 | "" | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getAssetOwnerKeyString (assetId) = (assetId + "_Owner") | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | let BuildStarted = "BUILD_STARTED" | |
123 | 123 | ||
124 | 124 | let BuildFinished = "BUILD_FINISHED" | |
125 | 125 | ||
126 | 126 | func getAssetIdKey (txId,assetType) = ((assetType + "_") + toBase58String(txId)) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getAssetOwnerKey (txId,assetType) = (getAssetIdKey(txId, assetType) + "_Owner") | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getBuildingFinishHeightKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_fh") | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getBuildingStatusKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_status") | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func getAssetTypeLevel (assetStr) = { | |
139 | 139 | let chunks = split(assetStr, "_") | |
140 | 140 | let strAssetType = chunks[0] | |
141 | 141 | let level = parseIntValue(drop(chunks[1], 3)) | |
142 | 142 | $Tuple2(strAssetType, level) | |
143 | 143 | } | |
144 | 144 | ||
145 | 145 | ||
146 | - | func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = { | |
146 | + | func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey,transactionId) = { | |
147 | 147 | let chunks = getAssetTypeLevel(assetStr) | |
148 | 148 | let strAssetType = chunks._1 | |
149 | 149 | let level = chunks._2 | |
150 | - | let k = getALKey(strAssetType, level) | |
151 | 150 | let buildingFinishHeight = getIntegerValue(this, finishHeightKey) | |
152 | 151 | if ((buildingFinishHeight > height)) | |
153 | 152 | then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes")) | |
154 | 153 | else if ((take(strAssetType, 4) == "TECH")) | |
155 | 154 | then { | |
156 | - | let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, | |
155 | + | let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, assetStr], nil) | |
157 | 156 | if ((discovered == true)) | |
158 | 157 | then [DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
159 | 158 | else throw("error discovering technology") | |
160 | 159 | } | |
161 | 160 | else { | |
162 | - | let assetPower = confTryGetInteger(( | |
163 | - | let assetCoins = ((confTryGetInteger(( | |
161 | + | let assetPower = confTryGetInteger((assetStr + "_Power")) | |
162 | + | let assetCoins = ((confTryGetInteger((assetStr + "_Cost")) * 20) / 100) | |
164 | 163 | let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil) | |
165 | 164 | if ((refCall == refCall)) | |
166 | 165 | then if ((assetPower > 0)) | |
167 | 166 | then { | |
168 | 167 | let currentPower = nationsTryGetInteger((caller + "_Power")) | |
169 | 168 | let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil) | |
170 | 169 | 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)] | |
172 | 178 | else throw("Strict value is not equal to itself.") | |
173 | 179 | } | |
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)] | |
175 | 188 | else throw("Strict value is not equal to itself.") | |
176 | 189 | } | |
177 | 190 | } | |
178 | 191 | ||
179 | 192 | ||
180 | 193 | func checkAssetOwner (caller,assetKey) = { | |
181 | 194 | let assetOwner = tryGetString(getAssetOwnerKeyString(assetKey)) | |
182 | 195 | (assetOwner == caller) | |
183 | 196 | } | |
184 | 197 | ||
185 | 198 | ||
186 | 199 | func isNationReservedAsset (Name,Level) = { | |
187 | 200 | let k = getALKey(Name, Level) | |
188 | 201 | confTryGetBoolean((k + "_NationReserved")) | |
189 | 202 | } | |
190 | 203 | ||
191 | 204 | ||
192 | 205 | func internalTrasnferOwnership (assetId,newOwner) = { | |
193 | 206 | let chunks = getAssetTypeLevel(assetId) | |
194 | 207 | let strAssetType = chunks._1 | |
195 | 208 | let level = chunks._2 | |
196 | 209 | let k = getALKey(strAssetType, level) | |
197 | 210 | let oldOwner = tryGetString(getAssetOwnerKeyString(assetId)) | |
198 | 211 | let assetPower = confTryGetInteger((k + "_Power")) | |
199 | 212 | if ((assetPower > 0)) | |
200 | 213 | then { | |
201 | 214 | let currentPower = nationsTryGetInteger((oldOwner + "_Power")) | |
202 | 215 | let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil) | |
203 | 216 | if ((pw == pw)) | |
204 | 217 | then if ((pw != (currentPower - assetPower))) | |
205 | 218 | then throw("Incorrect invoke result") | |
206 | 219 | else { | |
207 | 220 | let newcurrentPower = nationsTryGetInteger((newOwner + "_Power")) | |
208 | 221 | let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil) | |
209 | 222 | if ((pw2 == pw2)) | |
210 | 223 | then match pw2 { | |
211 | 224 | case r: Int => | |
212 | 225 | [StringEntry(getAssetOwnerKeyString(assetId), newOwner)] | |
213 | 226 | case _ => | |
214 | 227 | throw("Incorrect invoke result") | |
215 | 228 | } | |
216 | 229 | else throw("Strict value is not equal to itself.") | |
217 | 230 | } | |
218 | 231 | else throw("Strict value is not equal to itself.") | |
219 | 232 | } | |
220 | 233 | else [StringEntry(getAssetOwnerKeyString(assetId), newOwner)] | |
221 | 234 | } | |
222 | 235 | ||
223 | 236 | ||
224 | 237 | func CheckAssetBuildableSacrifice (ALKey,caller,SacrificeKey) = { | |
225 | 238 | let assetSac = confTryGetString((ALKey + "_SacrificeAsset")) | |
226 | 239 | let assetSaclvl = confTryGetInteger((ALKey + "_SacrificeAssetLevel")) | |
227 | 240 | if ((assetSac == "")) | |
228 | 241 | then true | |
229 | 242 | else if (!(checkAssetOwner(caller, SacrificeKey))) | |
230 | 243 | then throw("you are not the owner of the asset") | |
231 | 244 | else { | |
232 | 245 | let chunks = getAssetTypeLevel(SacrificeKey) | |
233 | 246 | if (if ((assetSac != chunks._1)) | |
234 | 247 | then true | |
235 | 248 | else (assetSaclvl != chunks._2)) | |
236 | 249 | then throw("the sacrificeAsset has the wrong type or level") | |
237 | 250 | else true | |
238 | 251 | } | |
239 | 252 | } | |
240 | 253 | ||
241 | 254 | ||
242 | 255 | func CheckAssetBuildableNation (Name,Level,NationKey,SacrificeKey) = { | |
243 | 256 | let cnfgKey = getALKey(Name, Level) | |
244 | 257 | let tec = confTryGetString((cnfgKey + "_Tecnhology_discovered")) | |
245 | 258 | if ((tec != "")) | |
246 | 259 | then if (nationsTryGetBoolean(((NationKey + "_") + tec))) | |
247 | 260 | then CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey) | |
248 | 261 | else false | |
249 | 262 | else CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey) | |
250 | 263 | } | |
251 | 264 | ||
252 | 265 | ||
253 | 266 | func CheckAssetBuildableUser (Name,Level,caller,SacrificeKey) = { | |
254 | 267 | let cnfKey = getALKey(Name, Level) | |
255 | 268 | let nationId = nationsTryGetInteger(caller) | |
256 | 269 | if ((nationId == 0)) | |
257 | 270 | then false | |
258 | 271 | else { | |
259 | 272 | let tec = confTryGetString((cnfKey + "_Tecnhology_discovered")) | |
260 | 273 | if ((tec != "")) | |
261 | 274 | then { | |
262 | 275 | let NationKey = nationsTryGetString(toString(nationId)) | |
263 | 276 | if (nationsTryGetBoolean(((NationKey + "_") + tec))) | |
264 | 277 | then CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey) | |
265 | 278 | else false | |
266 | 279 | } | |
267 | 280 | else CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey) | |
268 | 281 | } | |
269 | 282 | } | |
270 | 283 | ||
271 | 284 | ||
272 | 285 | func CheckAssetBuildable (Name,Level,Caller,NationKey,SacrificeKey) = if ((NationKey == "")) | |
273 | 286 | then CheckAssetBuildableNation(Name, Level, NationKey, SacrificeKey) | |
274 | 287 | else CheckAssetBuildableUser(Name, Level, Caller, SacrificeKey) | |
275 | 288 | ||
276 | 289 | ||
277 | 290 | @Callable(i) | |
278 | 291 | func StartBuild (strAssetType,Level,NationKey,SacrificeKey) = if (!(CheckAssetBuildable(strAssetType, Level, toString(i.caller), NationKey, SacrificeKey))) | |
279 | 292 | then throw("You cannot build this Item") | |
280 | 293 | else { | |
281 | 294 | let cnfgKey = getALKey(strAssetType, Level) | |
282 | 295 | let delayForBuilding = confTryGetInteger((cnfgKey + "_BuildTime")) | |
283 | 296 | let assetBuildCost = confTryGetInteger((cnfgKey + "_Cost")) | |
284 | 297 | let ToAdminWallet = ((assetBuildCost * 5) / 100) | |
285 | 298 | let ToGameRewardsWallet = ((assetBuildCost * 10) / 100) | |
286 | 299 | let ToStakingRewardsWallet = ((assetBuildCost * 65) / 100) | |
287 | 300 | let UnitStakeSheg = (((assetBuildCost - ToAdminWallet) - ToGameRewardsWallet) - ToStakingRewardsWallet) | |
288 | 301 | if (isNationReservedAsset(strAssetType, Level)) | |
289 | 302 | then if (if (!(checkAssetOwner(toString(i.caller), NationKey))) | |
290 | 303 | then !(checkAdmin(i.caller)) | |
291 | 304 | else false) | |
292 | 305 | then throw("You are not the owner of the nation") | |
293 | 306 | else { | |
294 | 307 | let nationsheg = treasuryTryGetInteger(getTreasuryKey(NationKey)) | |
295 | 308 | if ((assetBuildCost > nationsheg)) | |
296 | 309 | then throw("The nation hasn't enough funds") | |
297 | 310 | else { | |
298 | 311 | let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil) | |
299 | 312 | match d { | |
300 | 313 | case r: Int => | |
301 | 314 | let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, UnitStakeSheg], nil) | |
302 | 315 | match pw { | |
303 | 316 | case b: Int => | |
304 | 317 | let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil) | |
305 | 318 | match transfer { | |
306 | 319 | case t: Int => | |
307 | - | [StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, | |
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))] | |
308 | 321 | case _ => | |
309 | 322 | throw("Error Distributing asset rewards") | |
310 | 323 | } | |
311 | 324 | case _ => | |
312 | 325 | throw("Error Depositing nation funds") | |
313 | 326 | } | |
314 | 327 | case _ => | |
315 | 328 | throw("Error Depositing nation funds") | |
316 | 329 | } | |
317 | 330 | } | |
318 | 331 | } | |
319 | 332 | else { | |
320 | 333 | let assetSac = confTryGetString((cnfgKey + "_SacrificeAsset")) | |
321 | 334 | if ((assetSac != "")) | |
322 | 335 | then { | |
323 | 336 | let pw = invoke(Address(treasuryAddress), "NoPaymentDeposit", [toString(i.caller), UnitStakeSheg], nil) | |
324 | 337 | match pw { | |
325 | 338 | case r: Int => | |
326 | 339 | let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil) | |
327 | 340 | match transfer { | |
328 | 341 | case t: Int => | |
329 | - | [DeleteEntry(SacrificeKey), StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, | |
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))] | |
330 | 343 | case _ => | |
331 | 344 | throw("Error Distributing asset rewards") | |
332 | 345 | } | |
333 | 346 | case _ => | |
334 | 347 | throw("Error adding deposit") | |
335 | 348 | } | |
336 | 349 | } | |
337 | 350 | else { | |
338 | 351 | let amountIn = value(i.payments[0].amount) | |
339 | 352 | if ((assetBuildCost > amountIn)) | |
340 | 353 | then throw(("You provided less $heg than the needed cost for building this " + strAssetType)) | |
341 | 354 | else if ((i.payments[0].assetId != shinywggid)) | |
342 | 355 | then throw("Only $HEG payments allowed") | |
343 | 356 | else { | |
344 | 357 | let pw = invoke(Address(treasuryAddress), "Deposit", nil, [AttachedPayment(shinywggid, UnitStakeSheg)]) | |
345 | 358 | match pw { | |
346 | 359 | case r: Int => | |
347 | - | [StringEntry(getBuildingStatusKey(toString(i.originCaller), i.transactionId, | |
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)] | |
348 | 361 | case _ => | |
349 | 362 | throw("Incorrect invoke result") | |
350 | 363 | } | |
351 | 364 | } | |
352 | 365 | } | |
353 | 366 | } | |
354 | 367 | } | |
355 | 368 | ||
356 | 369 | ||
357 | 370 | ||
358 | 371 | @Callable(i) | |
359 | 372 | func FinishBuild (txIdStr,assetStr,Level,NationKey) = { | |
360 | 373 | 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)) | |
365 | 379 | if (isNationReservedAsset(assetStr, Level)) | |
366 | 380 | then if (if (!(checkAssetOwner(toString(i.caller), NationKey))) | |
367 | 381 | then !(checkAdmin(i.caller)) | |
368 | 382 | else false) | |
369 | 383 | then throw("You are not authorized to perform this operation") | |
370 | - | else internalFinishBuild(NationKey, | |
384 | + | else internalFinishBuild(NationKey, ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId) | |
371 | 385 | else if ((assetOwner != toString(i.caller))) | |
372 | 386 | then throw(("You cannot claim other's players " + assetStr)) | |
373 | 387 | else { | |
374 | 388 | let buildingTxStatus = tryGetString(BuildingStatusKey) | |
375 | 389 | if ((buildingTxStatus == "")) | |
376 | 390 | then throw("No pending operations for this asset") | |
377 | - | else internalFinishBuild(toString(i.caller), | |
391 | + | else internalFinishBuild(toString(i.caller), ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId) | |
378 | 392 | } | |
379 | 393 | } | |
380 | 394 | ||
381 | 395 | ||
382 | 396 | ||
383 | 397 | @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) | |
390 | 401 | ||
391 | 402 | ||
392 | 403 | ||
393 | 404 | @Callable(i) | |
394 | 405 | func destroyAssetAndTransfer (assetId,toAddress) = { | |
395 | 406 | let chunks = getAssetTypeLevel(assetId) | |
396 | 407 | let strAssetType = chunks._1 | |
397 | 408 | let level = chunks._2 | |
398 | 409 | let k = getALKey(strAssetType, level) | |
399 | 410 | if (!(checkAdmin(i.caller))) | |
400 | 411 | then throw("Only the admin can perform this operation") | |
401 | 412 | else { | |
402 | 413 | let oldOwner = tryGetString(getAssetOwnerKeyString(assetId)) | |
403 | 414 | let assetCoins = tryGetInteger(assetId) | |
404 | 415 | let refCall = invoke(Address(treasuryAddress), "adminTransfer", [addressFromStringValue(toAddress), assetCoins], nil) | |
405 | 416 | if ((refCall == refCall)) | |
406 | 417 | then { | |
407 | 418 | let currentPower = nationsTryGetInteger((oldOwner + "_Power")) | |
408 | 419 | let assetPower = confTryGetInteger((k + "_Power")) | |
409 | 420 | let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil) | |
410 | 421 | if ((pw == pw)) | |
411 | 422 | then match pw { | |
412 | 423 | case r: Int => | |
413 | 424 | [DeleteEntry(assetId)] | |
414 | 425 | case _ => | |
415 | 426 | throw("Error setting user power") | |
416 | 427 | } | |
417 | 428 | else throw("Strict value is not equal to itself.") | |
418 | 429 | } | |
419 | 430 | else throw("Strict value is not equal to itself.") | |
420 | 431 | } | |
421 | 432 | } | |
422 | 433 | ||
423 | 434 | ||
424 | 435 | ||
425 | 436 | @Callable(i) | |
426 | 437 | func destroyAssetFromUser (assetId) = { | |
427 | 438 | let chunks = getAssetTypeLevel(assetId) | |
428 | 439 | let strAssetType = chunks._1 | |
429 | 440 | let level = chunks._2 | |
430 | 441 | let k = getALKey(strAssetType, level) | |
431 | 442 | if (!(checkAssetOwner(toString(i.caller), assetId))) | |
432 | 443 | then throw("You don't own this asset") | |
433 | 444 | else { | |
434 | 445 | let assetCoins = tryGetInteger(assetId) | |
435 | 446 | let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power")) | |
436 | 447 | let assetPower = confTryGetInteger((k + "_Power")) | |
437 | 448 | let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil) | |
438 | 449 | if ((pw == pw)) | |
439 | 450 | then match pw { | |
440 | 451 | case r: Int => | |
441 | 452 | let tr = invoke(Address(treasuryAddress), "adminTransfer", [toString(i.caller), assetCoins], nil) | |
442 | 453 | match tr { | |
443 | 454 | case t: Int => | |
444 | 455 | [DeleteEntry(assetId)] | |
445 | 456 | case _ => | |
446 | 457 | throw("Error transferring coins") | |
447 | 458 | } | |
448 | 459 | case _ => | |
449 | 460 | throw("Error setting user power") | |
450 | 461 | } | |
451 | 462 | else throw("Strict value is not equal to itself.") | |
452 | 463 | } | |
453 | 464 | } | |
454 | 465 | ||
455 | 466 | ||
456 | 467 | ||
457 | 468 | @Callable(i) | |
458 | 469 | func setNationOwner (nationKey,newOwner) = if (checkAdmin(i.caller)) | |
459 | 470 | then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true) | |
460 | 471 | else { | |
461 | 472 | let currentOwner = tryGetString((nationKey + "_Owner")) | |
462 | 473 | if ((currentOwner != toString(i.caller))) | |
463 | 474 | then throw("You are not the nation owner") | |
464 | 475 | else [StringEntry((nationKey + "_Owner"), newOwner)] | |
465 | 476 | } | |
466 | 477 | ||
467 | 478 | ||
468 | 479 | ||
469 | 480 | @Callable(i) | |
470 | 481 | func buyNationItem (assetId,NationKey) = { | |
471 | 482 | let chunks = getAssetTypeLevel(assetId) | |
472 | 483 | let strAssetType = chunks._1 | |
473 | 484 | let level = chunks._2 | |
474 | 485 | let k = getALKey(strAssetType, level) | |
475 | 486 | let n = nationsTryGetInteger(toString(i.caller)) | |
476 | 487 | let nid = nationsTryGetInteger(NationKey) | |
477 | 488 | if ((n != nid)) | |
478 | 489 | then throw("you can buy assets only from your nation") | |
479 | 490 | else if (!(checkAssetOwner(NationKey, assetId))) | |
480 | 491 | then throw("The asset does not belong to the nation") | |
481 | 492 | else if (!(isNationReservedAsset(strAssetType, level))) | |
482 | 493 | then throw("this asset cannot be sold by the nation") | |
483 | 494 | else { | |
484 | 495 | let assetPrice = confTryGetInteger((getALKey(strAssetType, level) + "_SellPrice")) | |
485 | 496 | let amountIn = value(i.payments[0].amount) | |
486 | 497 | if ((assetPrice > amountIn)) | |
487 | 498 | then throw(("You provided less $heg than the needed cost for buying this " + strAssetType)) | |
488 | 499 | else if ((i.payments[0].assetId != shinywggid)) | |
489 | 500 | then throw("Only $HEG payments allowed") | |
490 | 501 | else { | |
491 | 502 | let a = invoke(Address(treasuryAddress), "increaseNationWallet", [NationKey, amountIn], nil) | |
492 | 503 | match a { | |
493 | 504 | case b: Int => | |
494 | 505 | (internalTrasnferOwnership(assetId, toString(i.caller)) :+ ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid)) | |
495 | 506 | case _ => | |
496 | 507 | throw("Error transferring SHEG to nations wallet") | |
497 | 508 | } | |
498 | 509 | } | |
499 | 510 | } | |
500 | 511 | } | |
501 | 512 | ||
502 | 513 | ||
503 | 514 | ||
504 | 515 | @Callable(i) | |
505 | 516 | func AddAssetFromMarkeplace (assetId,oldOwner,assetSheg) = if (!(checkAdmin(i.caller))) | |
506 | 517 | then throw("You are not allowed to perform this operation") | |
507 | 518 | else $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), oldOwner), IntegerEntry(assetId, assetSheg)], oldOwner) | |
508 | 519 | ||
509 | 520 | ||
510 | 521 | ||
511 | 522 | @Callable(i) | |
512 | 523 | func TransferAssetToMarketplace (assetId,sellprice) = if (!(checkAssetOwner(toString(i.caller), assetId))) | |
513 | 524 | then throw("You are not the owner of this asset") | |
514 | 525 | else { | |
515 | 526 | let assetSheg = tryGetInteger(assetId) | |
516 | 527 | let tr = invoke(Address(marketplaceAddress), "putOnSale", [assetId, assetSheg, sellprice], nil) | |
517 | 528 | match tr { | |
518 | 529 | case t: Int => | |
519 | 530 | [DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(assetId)] | |
520 | 531 | case _ => | |
521 | 532 | throw("Error putting the item on the marketplace") | |
522 | 533 | } | |
523 | 534 | } | |
524 | 535 | ||
525 | 536 |
github/deemru/w8io/169f3d6 90.20 ms ◑