tx · BRbp6BPth9MxRvtSUV4DbvrgSoSxGURgccJWViMhbCh4 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb: -0.01000000 Waves 2022.05.11 16:32 [2047071] smart account 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb > SELF 0.00000000 Waves
{ "type": 13, "id": "BRbp6BPth9MxRvtSUV4DbvrgSoSxGURgccJWViMhbCh4", "fee": 1000000, "feeAssetId": null, "timestamp": 1652275947333, "version": 2, "chainId": 84, "sender": "3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb", "senderPublicKey": "FWSsBbeCwLVkekWhvNKtX6JkrZiruRybKKVuiS3F4bqN", "proofs": [ "58AfczV29Pv35762zGN66pcJPzcggRUsvRqhUyUbRYBQ4dLPfePhEXfF36HcXZgRJsiefJNa1K2ZzxtaECwj9dma" ], "script": "base64:AAIFAAAAAAAAACkIAhIECgIICBIFCgMICAgSBQoDCAgIEgUKAwgICBIECgIICBIECgIICAAAABcAAAAACnNoaW55d2dnaWQBAAAAIIlpzwL/trq51HGW13m4mXYmsHTQd3n0c26G8PRznwYmAAAAAA90cmVhc3VyeUFkZHJlc3MBAAAAGgFUZfjwFgsEwFlCcBqeSIyX/37cHGLy3bv9AAAAAA5uYXRpb25zQWRkcmVzcwEAAAAaAVRNheje9PhEa1kQO3Bfw7e5ZQ5R9URGbaAAAAAADGFkbWluQWRkcmVzcwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01wTnRpUFNSU3E2Tm5hUVlrMzhCZldTelpjZ0FZVHlyUTkAAAAADEJ1aWxkU3RhcnRlZAIAAAANQlVJTERfU1RBUlRFRAAAAAANQnVpbGRGaW5pc2hlZAIAAAAOQlVJTERfRklOSVNIRUQAAAAABkFzc2V0cwkABEwAAAACAgAAAAZOYXRpb24JAARMAAAAAgIAAAAEQ2l0eQkABEwAAAACAgAAAAdCYXJyYWNrCQAETAAAAAICAAAABEJhcm4JAARMAAAAAgIAAAAHV2Fycmlvcgk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XIFAAAACmFzc2V0Q29pbnMFAAAACnNoaW55d2dnaWQFAAAAA25pbAkAAAIAAAABAgAAABdJbmNvcnJlY3QgaW52b2tlIHJlc3VsdAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAOc2V0TmF0aW9uT3duZXIAAAACAAAACW5hdGlvbktleQAAAAhuZXdPd25lcgMJAQAAAApjaGVja0FkbWluAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAFFAAAAAIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACBQAAAAluYXRpb25LZXkCAAAABl9Pd25lcgUAAAAIbmV3T3duZXIFAAAAA25pbAYEAAAADGN1cnJlbnRPd25lcgkBAAAADHRyeUdldFN0cmluZwAAAAEJAAEsAAAAAgUAAAAJbmF0aW9uS2V5AgAAAAZfT3duZXIDCQEAAAACIT0AAAACBQAAAAxjdXJyZW50T3duZXIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAAAgAAAAECAAAAHFlvdSBhcmUgbm90IHRoZSBuYXRpb24gb3duZXIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACBQAAAAluYXRpb25LZXkCAAAABl9Pd25lcgUAAAAIbmV3T3duZXIFAAAAA25pbAAAAADpesov", "height": 2047071, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4W3xtbVdcV5UVKjcPwGATnA8SsBry968uSD5VTTVDc8a Next: BBHrZLFur5Q2ufDu1G6bTecDmkt2XRdzT4qrsgwhv1Qp Diff:
Old | New | Differences | |
---|---|---|---|
130 | 130 | then throw("The nation hasn't enough funds") | |
131 | 131 | else { | |
132 | 132 | let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil) | |
133 | - | let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, assetBuildCost], nil) | |
134 | - | match pw { | |
133 | + | match d { | |
135 | 134 | case r: Int => | |
135 | + | let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, assetBuildCost], nil) | |
136 | + | match pw { | |
137 | + | case b: Int => | |
136 | 138 | [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))] | |
139 | + | case _ => | |
140 | + | throw("Error Depositing nation funds") | |
141 | + | } | |
137 | 142 | case _ => | |
138 | - | throw(" | |
143 | + | throw("Error Depositing nation funds") | |
139 | 144 | } | |
140 | 145 | } | |
141 | 146 | } |
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 nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy' | |
9 | 9 | ||
10 | 10 | let adminAddress = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9") | |
11 | 11 | ||
12 | 12 | let BuildStarted = "BUILD_STARTED" | |
13 | 13 | ||
14 | 14 | let BuildFinished = "BUILD_FINISHED" | |
15 | 15 | ||
16 | 16 | let Assets = ["Nation", "City", "Barrack", "Barn", "Warrior", "Settler", "Explorer"] | |
17 | 17 | ||
18 | 18 | let assetsCost = [0, 1000000000, 5000000000, 5000000000, 500000000, 10000000000, 100000000] | |
19 | 19 | ||
20 | 20 | let assetsDelay = [0, 4, 4, 4, 2, 2, 2] | |
21 | 21 | ||
22 | 22 | let assetsPower = [0, 1000, 500, 500, 0, 0, 0] | |
23 | 23 | ||
24 | 24 | func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) { | |
25 | 25 | case b: Int => | |
26 | 26 | b | |
27 | 27 | case _ => | |
28 | 28 | 0 | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) { | |
33 | 33 | case b: Int => | |
34 | 34 | b | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func tryGetString (key) = match getString(this, key) { | |
41 | 41 | case b: String => | |
42 | 42 | b | |
43 | 43 | case _ => | |
44 | 44 | "" | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func tryGetInteger (key) = match getInteger(this, key) { | |
49 | 49 | case b: Int => | |
50 | 50 | b | |
51 | 51 | case _ => | |
52 | 52 | 0 | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getAssetIdKey (txId,assetType) = ((assetType + "_") + toBase58String(txId)) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getAssetOwnerKey (txId,assetType) = (getAssetIdKey(txId, assetType) + "_Owner") | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getBuildingFinishHeightKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_fh") | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getBuildingStatusKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_status") | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getTreasuryKey (nationid) = (nationid + "_Treasury") | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func checkAdmin (caller) = if (if (if ((caller == adminAddress)) | |
72 | 72 | then true | |
73 | 73 | else (caller == this)) | |
74 | 74 | then true | |
75 | 75 | else (caller.bytes == nationsAddress)) | |
76 | 76 | then true | |
77 | 77 | else (caller.bytes == treasuryAddress) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = { | |
81 | 81 | let buildingFinishHeight = getIntegerValue(this, finishHeightKey) | |
82 | 82 | if ((buildingFinishHeight > height)) | |
83 | 83 | then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes")) | |
84 | 84 | else { | |
85 | 85 | let idx = value(indexOf(Assets, assetStr)) | |
86 | 86 | let assetPower = assetsPower[idx] | |
87 | 87 | let assetCoins = assetsCost[idx] | |
88 | 88 | let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil) | |
89 | 89 | if ((refCall == refCall)) | |
90 | 90 | then if ((assetPower > 0)) | |
91 | 91 | then { | |
92 | 92 | let currentPower = nationsTryGetInteger((caller + "_Power")) | |
93 | 93 | let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil) | |
94 | 94 | if ((pw == pw)) | |
95 | 95 | then [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
96 | 96 | else throw("Strict value is not equal to itself.") | |
97 | 97 | } | |
98 | 98 | else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
99 | 99 | else throw("Strict value is not equal to itself.") | |
100 | 100 | } | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func checkAssetOwner (caller,assetKey) = { | |
105 | 105 | let assetOwner = tryGetString((assetKey + "_Owner")) | |
106 | 106 | (assetOwner == toString(caller)) | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func isNationReservedAsset (strAssetType) = if ((strAssetType == "Settler")) | |
111 | 111 | then true | |
112 | 112 | else (strAssetType == "Explorer") | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(i) | |
116 | 116 | func StartBuild (strAssetType,NationKey) = if (!(containsElement(Assets, strAssetType))) | |
117 | 117 | then throw("This asset is not amanged by the system") | |
118 | 118 | else { | |
119 | 119 | let ind = value(indexOf(Assets, strAssetType)) | |
120 | 120 | let delayForBuilding = assetsDelay[ind] | |
121 | 121 | let assetBuildCost = assetsCost[ind] | |
122 | 122 | if (isNationReservedAsset(strAssetType)) | |
123 | 123 | then if (if (!(checkAssetOwner(i.caller, NationKey))) | |
124 | 124 | then !(checkAdmin(i.caller)) | |
125 | 125 | else false) | |
126 | 126 | then throw("You are not authorized to perform this operation") | |
127 | 127 | else { | |
128 | 128 | let nationsheg = treasuryTryGetInteger(getTreasuryKey(NationKey)) | |
129 | 129 | if ((assetBuildCost > nationsheg)) | |
130 | 130 | then throw("The nation hasn't enough funds") | |
131 | 131 | else { | |
132 | 132 | let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil) | |
133 | - | let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, assetBuildCost], nil) | |
134 | - | match pw { | |
133 | + | match d { | |
135 | 134 | case r: Int => | |
135 | + | let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, assetBuildCost], nil) | |
136 | + | match pw { | |
137 | + | case b: Int => | |
136 | 138 | [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))] | |
139 | + | case _ => | |
140 | + | throw("Error Depositing nation funds") | |
141 | + | } | |
137 | 142 | case _ => | |
138 | - | throw(" | |
143 | + | throw("Error Depositing nation funds") | |
139 | 144 | } | |
140 | 145 | } | |
141 | 146 | } | |
142 | 147 | else { | |
143 | 148 | let amountIn = value(i.payments[0].amount) | |
144 | 149 | if ((assetBuildCost > amountIn)) | |
145 | 150 | then throw(("You provided less $heg than the needed cost for building this " + strAssetType)) | |
146 | 151 | else if ((i.payments[0].assetId != shinywggid)) | |
147 | 152 | then throw("Only $HEG payments allowed") | |
148 | 153 | else { | |
149 | 154 | let pw = invoke(Address(treasuryAddress), "Deposit", nil, i.payments) | |
150 | 155 | match pw { | |
151 | 156 | case r: Int => | |
152 | 157 | [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))] | |
153 | 158 | case _ => | |
154 | 159 | throw("Incorrect invoke result") | |
155 | 160 | } | |
156 | 161 | } | |
157 | 162 | } | |
158 | 163 | } | |
159 | 164 | ||
160 | 165 | ||
161 | 166 | ||
162 | 167 | @Callable(i) | |
163 | 168 | func FinishBuild (txIdStr,assetStr,NationKey) = { | |
164 | 169 | let txId = fromBase58String(txIdStr) | |
165 | 170 | let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, assetStr) | |
166 | 171 | let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, assetStr) | |
167 | 172 | let assetKey = getAssetIdKey(txId, assetStr) | |
168 | 173 | let assetOwner = tryGetString(getAssetOwnerKey(txId, assetStr)) | |
169 | 174 | if (isNationReservedAsset(assetStr)) | |
170 | 175 | then if (if (!(checkAssetOwner(i.caller, NationKey))) | |
171 | 176 | then !(checkAdmin(i.caller)) | |
172 | 177 | else false) | |
173 | 178 | then throw("You are not authorized to perform this operation") | |
174 | 179 | else internalFinishBuild(NationKey, assetStr, assetKey, BuildingStatusKey, finishHeightKey) | |
175 | 180 | else if ((assetOwner != toString(i.caller))) | |
176 | 181 | then throw(("You cannot claim other's players " + assetStr)) | |
177 | 182 | else { | |
178 | 183 | let buildingTxStatus = tryGetString(BuildingStatusKey) | |
179 | 184 | if ((buildingTxStatus == "")) | |
180 | 185 | then throw("No pending operations for this asset") | |
181 | 186 | else internalFinishBuild(toString(i.caller), assetStr, assetKey, BuildingStatusKey, finishHeightKey) | |
182 | 187 | } | |
183 | 188 | } | |
184 | 189 | ||
185 | 190 | ||
186 | 191 | ||
187 | 192 | @Callable(i) | |
188 | 193 | func transferOwnership (assetId,newOwner,strAssetType) = if (!(checkAdmin(i.caller))) | |
189 | 194 | then throw("Only the admin can perform this operation") | |
190 | 195 | else { | |
191 | 196 | let oldOwner = tryGetString((assetId + "_Owner")) | |
192 | 197 | let currentPower = nationsTryGetInteger((oldOwner + "_Power")) | |
193 | 198 | let assetPower = assetsPower[value(indexOf(Assets, strAssetType))] | |
194 | 199 | let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil) | |
195 | 200 | if ((pw == pw)) | |
196 | 201 | then if ((pw != (currentPower - assetPower))) | |
197 | 202 | then throw("Incorrect invoke result") | |
198 | 203 | else { | |
199 | 204 | let newcurrentPower = nationsTryGetInteger((newOwner + "_Power")) | |
200 | 205 | let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil) | |
201 | 206 | if ((pw2 == pw2)) | |
202 | 207 | then match pw2 { | |
203 | 208 | case r: Int => | |
204 | 209 | [StringEntry((assetId + "_Owner"), newOwner)] | |
205 | 210 | case _ => | |
206 | 211 | throw("Incorrect invoke result") | |
207 | 212 | } | |
208 | 213 | else throw("Strict value is not equal to itself.") | |
209 | 214 | } | |
210 | 215 | else throw("Strict value is not equal to itself.") | |
211 | 216 | } | |
212 | 217 | ||
213 | 218 | ||
214 | 219 | ||
215 | 220 | @Callable(i) | |
216 | 221 | func destroyAssetAndTransfer (assetId,toAddress,strAssetType) = if (!(checkAdmin(i.caller))) | |
217 | 222 | then throw("Only the admin can perform this operation") | |
218 | 223 | else { | |
219 | 224 | let oldOwner = tryGetString((assetId + "_Owner")) | |
220 | 225 | let assetCoins = tryGetInteger(assetId) | |
221 | 226 | let refCall = invoke(Address(treasuryAddress), "arbitraryAddCoins", [toAddress, assetCoins], nil) | |
222 | 227 | if ((refCall == refCall)) | |
223 | 228 | then { | |
224 | 229 | let currentPower = nationsTryGetInteger((oldOwner + "_Power")) | |
225 | 230 | let assetPower = assetsPower[value(indexOf(Assets, strAssetType))] | |
226 | 231 | let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil) | |
227 | 232 | if ((pw == pw)) | |
228 | 233 | then match pw { | |
229 | 234 | case r: Int => | |
230 | 235 | [DeleteEntry(assetId)] | |
231 | 236 | case _ => | |
232 | 237 | throw("Incorrect invoke result") | |
233 | 238 | } | |
234 | 239 | else throw("Strict value is not equal to itself.") | |
235 | 240 | } | |
236 | 241 | else throw("Strict value is not equal to itself.") | |
237 | 242 | } | |
238 | 243 | ||
239 | 244 | ||
240 | 245 | ||
241 | 246 | @Callable(i) | |
242 | 247 | func destroyAssetFromUser (assetId,strAssetType) = if (!(checkAssetOwner(i.caller, assetId))) | |
243 | 248 | then throw("You don't own this asset") | |
244 | 249 | else { | |
245 | 250 | let assetCoins = tryGetInteger(assetId) | |
246 | 251 | let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power")) | |
247 | 252 | let assetPower = assetsPower[value(indexOf(Assets, strAssetType))] | |
248 | 253 | let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil) | |
249 | 254 | if ((pw == pw)) | |
250 | 255 | then match pw { | |
251 | 256 | case r: Int => | |
252 | 257 | [DeleteEntry(assetId), ScriptTransfer(i.caller, assetCoins, shinywggid)] | |
253 | 258 | case _ => | |
254 | 259 | throw("Incorrect invoke result") | |
255 | 260 | } | |
256 | 261 | else throw("Strict value is not equal to itself.") | |
257 | 262 | } | |
258 | 263 | ||
259 | 264 | ||
260 | 265 | ||
261 | 266 | @Callable(i) | |
262 | 267 | func setNationOwner (nationKey,newOwner) = if (checkAdmin(i.caller)) | |
263 | 268 | then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true) | |
264 | 269 | else { | |
265 | 270 | let currentOwner = tryGetString((nationKey + "_Owner")) | |
266 | 271 | if ((currentOwner != toString(i.caller))) | |
267 | 272 | then throw("You are not the nation owner") | |
268 | 273 | else [StringEntry((nationKey + "_Owner"), newOwner)] | |
269 | 274 | } | |
270 | 275 | ||
271 | 276 |
github/deemru/w8io/169f3d6 74.80 ms ◑