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/Dt7llDlH1REZtoAAAAAALYWRtaW5XYWxsZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uY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gAAAClFcnJvciBwdXR0aW5nIHRoZSBpdGVtIG9uIHRoZSBtYXJrZXRwbGFjZQAAAABGGwKG", "height": 2104782, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5qoMJoDxaiEykem7rHiQQwFfCcLspyC1TJ9MukhtoEQ7 Next: A6k1ebbNzaMxRJt1oUp1pt2rAc6WeJDxy9uHLensCESy Diff:
Old | New | Differences | |
---|---|---|---|
434 | 434 | ||
435 | 435 | ||
436 | 436 | @Callable(i) | |
437 | - | func destroyAssetFromUser (assetId) = { | |
437 | + | func destroyAssetFromUser (assetId,qty) = { | |
438 | 438 | let chunks = getAssetTypeLevel(assetId) | |
439 | 439 | let strAssetType = chunks._1 | |
440 | 440 | let level = chunks._2 | |
445 | 445 | let assetCoins = tryGetInteger(assetId) | |
446 | 446 | let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power")) | |
447 | 447 | 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 => | |
455 | 479 | [DeleteEntry(assetId)] | |
456 | - | case _ => | |
457 | - | throw("Error transferring coins") | |
458 | - | } | |
459 | - | case _ => | |
460 | - | throw("Error setting user power") | |
461 | - | } | |
462 | - | | |
480 | + | case _ => | |
481 | + | throw("Error transferring coins") | |
482 | + | } | |
483 | + | case _ => | |
484 | + | throw("Error setting user power") | |
485 | + | } | |
486 | + | } | |
463 | 487 | } | |
464 | 488 | } | |
465 | 489 |
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 | 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 | 150 | let buildingFinishHeight = getIntegerValue(this, finishHeightKey) | |
151 | 151 | if ((buildingFinishHeight > height)) | |
152 | 152 | then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes")) | |
153 | 153 | else if ((take(strAssetType, 4) == "TECH")) | |
154 | 154 | then { | |
155 | 155 | let discovered = invoke(Address(nationsAddress), "setTecnhnologyDiscovered", [caller, assetStr], nil) | |
156 | 156 | if ((discovered == true)) | |
157 | 157 | then [DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
158 | 158 | else throw("error discovering technology") | |
159 | 159 | } | |
160 | 160 | else { | |
161 | 161 | let assetPower = confTryGetInteger((assetStr + "_Power")) | |
162 | 162 | let assetCoins = ((confTryGetInteger((assetStr + "_Cost")) * 20) / 100) | |
163 | 163 | let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil) | |
164 | 164 | if ((refCall == refCall)) | |
165 | 165 | then if ((assetPower > 0)) | |
166 | 166 | then { | |
167 | 167 | let currentPower = nationsTryGetInteger((caller + "_Power")) | |
168 | 168 | let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil) | |
169 | 169 | if ((pw == pw)) | |
170 | 170 | then if (confTryGetBoolean((assetStr + "_Aggregated"))) | |
171 | 171 | then { | |
172 | 172 | let aggrAssetkey = ((assetStr + "_") + caller) | |
173 | 173 | let coins = tryGetInteger(aggrAssetkey) | |
174 | 174 | let qty = tryGetInteger((aggrAssetkey + "_Qty")) | |
175 | 175 | [DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
176 | 176 | } | |
177 | 177 | else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
178 | 178 | else throw("Strict value is not equal to itself.") | |
179 | 179 | } | |
180 | 180 | else if (confTryGetBoolean((assetStr + "_Aggregated"))) | |
181 | 181 | then { | |
182 | 182 | let aggrAssetkey = ((assetStr + "_") + caller) | |
183 | 183 | let coins = tryGetInteger(aggrAssetkey) | |
184 | 184 | let qty = tryGetInteger((aggrAssetkey + "_Qty")) | |
185 | 185 | [DeleteEntry(getAssetOwnerKey(transactionId, assetStr)), StringEntry((aggrAssetkey + "_Owner"), caller), IntegerEntry(aggrAssetkey, (coins + assetCoins)), IntegerEntry((aggrAssetkey + "_Qty"), (qty + 1)), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
186 | 186 | } | |
187 | 187 | else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
188 | 188 | else throw("Strict value is not equal to itself.") | |
189 | 189 | } | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func checkAssetOwner (caller,assetKey) = { | |
194 | 194 | let assetOwner = tryGetString(getAssetOwnerKeyString(assetKey)) | |
195 | 195 | (assetOwner == caller) | |
196 | 196 | } | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func isNationReservedAsset (Name,Level) = { | |
200 | 200 | let k = getALKey(Name, Level) | |
201 | 201 | confTryGetBoolean((k + "_NationReserved")) | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func internalTrasnferOwnership (assetId,newOwner) = { | |
206 | 206 | let chunks = getAssetTypeLevel(assetId) | |
207 | 207 | let strAssetType = chunks._1 | |
208 | 208 | let level = chunks._2 | |
209 | 209 | let k = getALKey(strAssetType, level) | |
210 | 210 | let oldOwner = tryGetString(getAssetOwnerKeyString(assetId)) | |
211 | 211 | let assetPower = confTryGetInteger((k + "_Power")) | |
212 | 212 | if ((assetPower > 0)) | |
213 | 213 | then { | |
214 | 214 | let currentPower = nationsTryGetInteger((oldOwner + "_Power")) | |
215 | 215 | let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil) | |
216 | 216 | if ((pw == pw)) | |
217 | 217 | then if ((pw != (currentPower - assetPower))) | |
218 | 218 | then throw("Incorrect invoke result") | |
219 | 219 | else { | |
220 | 220 | let newcurrentPower = nationsTryGetInteger((newOwner + "_Power")) | |
221 | 221 | let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil) | |
222 | 222 | if ((pw2 == pw2)) | |
223 | 223 | then match pw2 { | |
224 | 224 | case r: Int => | |
225 | 225 | [StringEntry(getAssetOwnerKeyString(assetId), newOwner)] | |
226 | 226 | case _ => | |
227 | 227 | throw("Incorrect invoke result") | |
228 | 228 | } | |
229 | 229 | else throw("Strict value is not equal to itself.") | |
230 | 230 | } | |
231 | 231 | else throw("Strict value is not equal to itself.") | |
232 | 232 | } | |
233 | 233 | else [StringEntry(getAssetOwnerKeyString(assetId), newOwner)] | |
234 | 234 | } | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func CheckAssetBuildableSacrifice (ALKey,caller,SacrificeKey) = { | |
238 | 238 | let assetSac = confTryGetString((ALKey + "_SacrificeAsset")) | |
239 | 239 | let assetSaclvl = confTryGetInteger((ALKey + "_SacrificeAssetLevel")) | |
240 | 240 | if ((assetSac == "")) | |
241 | 241 | then true | |
242 | 242 | else if (!(checkAssetOwner(caller, SacrificeKey))) | |
243 | 243 | then throw("you are not the owner of the asset") | |
244 | 244 | else { | |
245 | 245 | let chunks = getAssetTypeLevel(SacrificeKey) | |
246 | 246 | if (if ((assetSac != chunks._1)) | |
247 | 247 | then true | |
248 | 248 | else (assetSaclvl != chunks._2)) | |
249 | 249 | then throw("the sacrificeAsset has the wrong type or level") | |
250 | 250 | else true | |
251 | 251 | } | |
252 | 252 | } | |
253 | 253 | ||
254 | 254 | ||
255 | 255 | func CheckAssetBuildableNation (Name,Level,NationKey,SacrificeKey) = { | |
256 | 256 | let cnfgKey = getALKey(Name, Level) | |
257 | 257 | let tec = confTryGetString((cnfgKey + "_Tecnhology_discovered")) | |
258 | 258 | if ((tec != "")) | |
259 | 259 | then if (nationsTryGetBoolean(((NationKey + "_") + tec))) | |
260 | 260 | then CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey) | |
261 | 261 | else false | |
262 | 262 | else CheckAssetBuildableSacrifice(cnfgKey, NationKey, SacrificeKey) | |
263 | 263 | } | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func CheckAssetBuildableUser (Name,Level,caller,SacrificeKey) = { | |
267 | 267 | let cnfKey = getALKey(Name, Level) | |
268 | 268 | let nationId = nationsTryGetInteger(caller) | |
269 | 269 | if ((nationId == 0)) | |
270 | 270 | then false | |
271 | 271 | else { | |
272 | 272 | let tec = confTryGetString((cnfKey + "_Tecnhology_discovered")) | |
273 | 273 | if ((tec != "")) | |
274 | 274 | then { | |
275 | 275 | let NationKey = nationsTryGetString(toString(nationId)) | |
276 | 276 | if (nationsTryGetBoolean(((NationKey + "_") + tec))) | |
277 | 277 | then CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey) | |
278 | 278 | else false | |
279 | 279 | } | |
280 | 280 | else CheckAssetBuildableSacrifice(cnfKey, caller, SacrificeKey) | |
281 | 281 | } | |
282 | 282 | } | |
283 | 283 | ||
284 | 284 | ||
285 | 285 | func CheckAssetBuildable (Name,Level,Caller,NationKey,SacrificeKey) = if ((NationKey == "")) | |
286 | 286 | then CheckAssetBuildableNation(Name, Level, NationKey, SacrificeKey) | |
287 | 287 | else CheckAssetBuildableUser(Name, Level, Caller, SacrificeKey) | |
288 | 288 | ||
289 | 289 | ||
290 | 290 | @Callable(i) | |
291 | 291 | func StartBuild (strAssetType,Level,NationKey,SacrificeKey) = if (!(CheckAssetBuildable(strAssetType, Level, toString(i.caller), NationKey, SacrificeKey))) | |
292 | 292 | then throw("You cannot build this Item") | |
293 | 293 | else { | |
294 | 294 | let cnfgKey = getALKey(strAssetType, Level) | |
295 | 295 | let delayForBuilding = confTryGetInteger((cnfgKey + "_BuildTime")) | |
296 | 296 | let assetBuildCost = confTryGetInteger((cnfgKey + "_Cost")) | |
297 | 297 | let ToAdminWallet = ((assetBuildCost * 5) / 100) | |
298 | 298 | let ToGameRewardsWallet = ((assetBuildCost * 10) / 100) | |
299 | 299 | let ToStakingRewardsWallet = ((assetBuildCost * 65) / 100) | |
300 | 300 | let UnitStakeSheg = (((assetBuildCost - ToAdminWallet) - ToGameRewardsWallet) - ToStakingRewardsWallet) | |
301 | 301 | if (isNationReservedAsset(strAssetType, Level)) | |
302 | 302 | then if (if (!(checkAssetOwner(toString(i.caller), NationKey))) | |
303 | 303 | then !(checkAdmin(i.caller)) | |
304 | 304 | else false) | |
305 | 305 | then throw("You are not the owner of the nation") | |
306 | 306 | else { | |
307 | 307 | let nationsheg = treasuryTryGetInteger(getTreasuryKey(NationKey)) | |
308 | 308 | if ((assetBuildCost > nationsheg)) | |
309 | 309 | then throw("The nation hasn't enough funds") | |
310 | 310 | else { | |
311 | 311 | let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil) | |
312 | 312 | match d { | |
313 | 313 | case r: Int => | |
314 | 314 | let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, UnitStakeSheg], nil) | |
315 | 315 | match pw { | |
316 | 316 | case b: Int => | |
317 | 317 | let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil) | |
318 | 318 | match transfer { | |
319 | 319 | case t: Int => | |
320 | 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))] | |
321 | 321 | case _ => | |
322 | 322 | throw("Error Distributing asset rewards") | |
323 | 323 | } | |
324 | 324 | case _ => | |
325 | 325 | throw("Error Depositing nation funds") | |
326 | 326 | } | |
327 | 327 | case _ => | |
328 | 328 | throw("Error Depositing nation funds") | |
329 | 329 | } | |
330 | 330 | } | |
331 | 331 | } | |
332 | 332 | else { | |
333 | 333 | let assetSac = confTryGetString((cnfgKey + "_SacrificeAsset")) | |
334 | 334 | if ((assetSac != "")) | |
335 | 335 | then { | |
336 | 336 | let pw = invoke(Address(treasuryAddress), "NoPaymentDeposit", [toString(i.caller), UnitStakeSheg], nil) | |
337 | 337 | match pw { | |
338 | 338 | case r: Int => | |
339 | 339 | let transfer = invoke(Address(treasuryAddress), "distributeNationPayRewards", [assetBuildCost], nil) | |
340 | 340 | match transfer { | |
341 | 341 | case t: Int => | |
342 | 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))] | |
343 | 343 | case _ => | |
344 | 344 | throw("Error Distributing asset rewards") | |
345 | 345 | } | |
346 | 346 | case _ => | |
347 | 347 | throw("Error adding deposit") | |
348 | 348 | } | |
349 | 349 | } | |
350 | 350 | else { | |
351 | 351 | let amountIn = value(i.payments[0].amount) | |
352 | 352 | if ((assetBuildCost > amountIn)) | |
353 | 353 | then throw(("You provided less $heg than the needed cost for building this " + strAssetType)) | |
354 | 354 | else if ((i.payments[0].assetId != shinywggid)) | |
355 | 355 | then throw("Only $HEG payments allowed") | |
356 | 356 | else { | |
357 | 357 | let pw = invoke(Address(treasuryAddress), "Deposit", nil, [AttachedPayment(shinywggid, UnitStakeSheg)]) | |
358 | 358 | match pw { | |
359 | 359 | case r: Int => | |
360 | 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)] | |
361 | 361 | case _ => | |
362 | 362 | throw("Incorrect invoke result") | |
363 | 363 | } | |
364 | 364 | } | |
365 | 365 | } | |
366 | 366 | } | |
367 | 367 | } | |
368 | 368 | ||
369 | 369 | ||
370 | 370 | ||
371 | 371 | @Callable(i) | |
372 | 372 | func FinishBuild (txIdStr,assetStr,Level,NationKey) = { | |
373 | 373 | let txId = fromBase58String(txIdStr) | |
374 | 374 | let ALKey = getALKey(assetStr, Level) | |
375 | 375 | let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, ALKey) | |
376 | 376 | let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, ALKey) | |
377 | 377 | let assetKey = getAssetIdKey(txId, ALKey) | |
378 | 378 | let assetOwner = tryGetString(getAssetOwnerKey(txId, ALKey)) | |
379 | 379 | if (isNationReservedAsset(assetStr, Level)) | |
380 | 380 | then if (if (!(checkAssetOwner(toString(i.caller), NationKey))) | |
381 | 381 | then !(checkAdmin(i.caller)) | |
382 | 382 | else false) | |
383 | 383 | then throw("You are not authorized to perform this operation") | |
384 | 384 | else internalFinishBuild(NationKey, ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId) | |
385 | 385 | else if ((assetOwner != toString(i.caller))) | |
386 | 386 | then throw(("You cannot claim other's players " + assetStr)) | |
387 | 387 | else { | |
388 | 388 | let buildingTxStatus = tryGetString(BuildingStatusKey) | |
389 | 389 | if ((buildingTxStatus == "")) | |
390 | 390 | then throw("No pending operations for this asset") | |
391 | 391 | else internalFinishBuild(toString(i.caller), ALKey, assetKey, BuildingStatusKey, finishHeightKey, txId) | |
392 | 392 | } | |
393 | 393 | } | |
394 | 394 | ||
395 | 395 | ||
396 | 396 | ||
397 | 397 | @Callable(i) | |
398 | 398 | func transferOwnership (assetId,newOwner) = if (!(checkAdmin(i.caller))) | |
399 | 399 | then throw("Only the admin can perform this operation") | |
400 | 400 | else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner) | |
401 | 401 | ||
402 | 402 | ||
403 | 403 | ||
404 | 404 | @Callable(i) | |
405 | 405 | func destroyAssetAndTransfer (assetId,toAddress) = { | |
406 | 406 | let chunks = getAssetTypeLevel(assetId) | |
407 | 407 | let strAssetType = chunks._1 | |
408 | 408 | let level = chunks._2 | |
409 | 409 | let k = getALKey(strAssetType, level) | |
410 | 410 | if (!(checkAdmin(i.caller))) | |
411 | 411 | then throw("Only the admin can perform this operation") | |
412 | 412 | else { | |
413 | 413 | let oldOwner = tryGetString(getAssetOwnerKeyString(assetId)) | |
414 | 414 | let assetCoins = tryGetInteger(assetId) | |
415 | 415 | let refCall = invoke(Address(treasuryAddress), "adminTransfer", [addressFromStringValue(toAddress), assetCoins], nil) | |
416 | 416 | if ((refCall == refCall)) | |
417 | 417 | then { | |
418 | 418 | let currentPower = nationsTryGetInteger((oldOwner + "_Power")) | |
419 | 419 | let assetPower = confTryGetInteger((k + "_Power")) | |
420 | 420 | let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil) | |
421 | 421 | if ((pw == pw)) | |
422 | 422 | then match pw { | |
423 | 423 | case r: Int => | |
424 | 424 | [DeleteEntry(assetId)] | |
425 | 425 | case _ => | |
426 | 426 | throw("Error setting user power") | |
427 | 427 | } | |
428 | 428 | else throw("Strict value is not equal to itself.") | |
429 | 429 | } | |
430 | 430 | else throw("Strict value is not equal to itself.") | |
431 | 431 | } | |
432 | 432 | } | |
433 | 433 | ||
434 | 434 | ||
435 | 435 | ||
436 | 436 | @Callable(i) | |
437 | - | func destroyAssetFromUser (assetId) = { | |
437 | + | func destroyAssetFromUser (assetId,qty) = { | |
438 | 438 | let chunks = getAssetTypeLevel(assetId) | |
439 | 439 | let strAssetType = chunks._1 | |
440 | 440 | let level = chunks._2 | |
441 | 441 | let k = getALKey(strAssetType, level) | |
442 | 442 | if (!(checkAssetOwner(toString(i.caller), assetId))) | |
443 | 443 | then throw("You don't own this asset") | |
444 | 444 | else { | |
445 | 445 | let assetCoins = tryGetInteger(assetId) | |
446 | 446 | let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power")) | |
447 | 447 | 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 => | |
455 | 479 | [DeleteEntry(assetId)] | |
456 | - | case _ => | |
457 | - | throw("Error transferring coins") | |
458 | - | } | |
459 | - | case _ => | |
460 | - | throw("Error setting user power") | |
461 | - | } | |
462 | - | | |
480 | + | case _ => | |
481 | + | throw("Error transferring coins") | |
482 | + | } | |
483 | + | case _ => | |
484 | + | throw("Error setting user power") | |
485 | + | } | |
486 | + | } | |
463 | 487 | } | |
464 | 488 | } | |
465 | 489 | ||
466 | 490 | ||
467 | 491 | ||
468 | 492 | @Callable(i) | |
469 | 493 | func setNationOwner (nationKey,newOwner) = if (checkAdmin(i.caller)) | |
470 | 494 | then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true) | |
471 | 495 | else { | |
472 | 496 | let currentOwner = tryGetString((nationKey + "_Owner")) | |
473 | 497 | if ((currentOwner != toString(i.caller))) | |
474 | 498 | then throw("You are not the nation owner") | |
475 | 499 | else [StringEntry((nationKey + "_Owner"), newOwner)] | |
476 | 500 | } | |
477 | 501 | ||
478 | 502 | ||
479 | 503 | ||
480 | 504 | @Callable(i) | |
481 | 505 | func buyNationItem (assetId,NationKey) = { | |
482 | 506 | let chunks = getAssetTypeLevel(assetId) | |
483 | 507 | let strAssetType = chunks._1 | |
484 | 508 | let level = chunks._2 | |
485 | 509 | let k = getALKey(strAssetType, level) | |
486 | 510 | let n = nationsTryGetInteger(toString(i.caller)) | |
487 | 511 | let nid = nationsTryGetInteger(NationKey) | |
488 | 512 | if ((n != nid)) | |
489 | 513 | then throw("you can buy assets only from your nation") | |
490 | 514 | else if (!(checkAssetOwner(NationKey, assetId))) | |
491 | 515 | then throw("The asset does not belong to the nation") | |
492 | 516 | else if (!(isNationReservedAsset(strAssetType, level))) | |
493 | 517 | then throw("this asset cannot be sold by the nation") | |
494 | 518 | else { | |
495 | 519 | let assetPrice = confTryGetInteger((getALKey(strAssetType, level) + "_SellPrice")) | |
496 | 520 | let amountIn = value(i.payments[0].amount) | |
497 | 521 | if ((assetPrice > amountIn)) | |
498 | 522 | then throw(("You provided less $heg than the needed cost for buying this " + strAssetType)) | |
499 | 523 | else if ((i.payments[0].assetId != shinywggid)) | |
500 | 524 | then throw("Only $HEG payments allowed") | |
501 | 525 | else { | |
502 | 526 | let a = invoke(Address(treasuryAddress), "increaseNationWallet", [NationKey, amountIn], nil) | |
503 | 527 | match a { | |
504 | 528 | case b: Int => | |
505 | 529 | (internalTrasnferOwnership(assetId, toString(i.caller)) :+ ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid)) | |
506 | 530 | case _ => | |
507 | 531 | throw("Error transferring SHEG to nations wallet") | |
508 | 532 | } | |
509 | 533 | } | |
510 | 534 | } | |
511 | 535 | } | |
512 | 536 | ||
513 | 537 | ||
514 | 538 | ||
515 | 539 | @Callable(i) | |
516 | 540 | func AddAssetFromMarkeplace (assetId,oldOwner,assetSheg) = if (!(checkAdmin(i.caller))) | |
517 | 541 | then throw("You are not allowed to perform this operation") | |
518 | 542 | else $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), oldOwner), IntegerEntry(assetId, assetSheg)], oldOwner) | |
519 | 543 | ||
520 | 544 | ||
521 | 545 | ||
522 | 546 | @Callable(i) | |
523 | 547 | func TransferAssetToMarketplace (assetId,sellprice) = if (!(checkAssetOwner(toString(i.caller), assetId))) | |
524 | 548 | then throw("You are not the owner of this asset") | |
525 | 549 | else { | |
526 | 550 | let assetSheg = tryGetInteger(assetId) | |
527 | 551 | let tr = invoke(Address(marketplaceAddress), "putOnSale", [assetId, assetSheg, sellprice], nil) | |
528 | 552 | match tr { | |
529 | 553 | case t: Int => | |
530 | 554 | [DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(assetId)] | |
531 | 555 | case _ => | |
532 | 556 | throw("Error putting the item on the marketplace") | |
533 | 557 | } | |
534 | 558 | } | |
535 | 559 | ||
536 | 560 |
github/deemru/w8io/026f985 80.47 ms ◑