tx · A8et2oNQnuJ8XYKd38qhzmUTW7pcdoJgqVS15ceCie8p

3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb:  -0.01000000 Waves

2022.05.11 14:00 [2046912] smart account 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb > SELF 0.00000000 Waves

{ "type": 13, "id": "A8et2oNQnuJ8XYKd38qhzmUTW7pcdoJgqVS15ceCie8p", "fee": 1000000, "feeAssetId": null, "timestamp": 1652266874569, "version": 2, "chainId": 84, "sender": "3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb", "senderPublicKey": "FWSsBbeCwLVkekWhvNKtX6JkrZiruRybKKVuiS3F4bqN", "proofs": [ "5qYia9ogiBA9CNuEX5FJS1zXEp6ro7KPJpu4zE92reiLi2FxTgJfRfEcc59XGtxfQwGewjSwrmbF34fcCbjdwZjN" ], "script": "base64:AAIFAAAAAAAAACkIAhIECgIICBIFCgMICAgSBQoDCAgIEgUKAwgICBIECgIICBIECgIICAAAABgAAAAACnNoaW55d2dnaWQBAAAAIIlpzwL/trq51HGW13m4mXYmsHTQd3n0c26G8PRznwYmAAAAAA90cmVhc3VyeUFkZHJlc3MBAAAAGgFUZfjwFgsEwFlCcBqeSIyX/37cHGLy3bv9AAAAAA5uYXRpb25zQWRkcmVzcwEAAAAaAVRNheje9PhEa1kQO3Bfw7e5ZQ5R9URGbaAAAAAADGFkbWluQWRkcmVzcwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01wTnRpUFNSU3E2Tm5hUVlrMzhCZldTelpjZ0FZVHlyUTkAAAAADEJ1aWxkU3RhcnRlZAIAAAANQlVJTERfU1RBUlRFRAAAAAANQnVpbGRGaW5pc2hlZAIAAAAOQlVJTERfRklOSVNIRUQAAAAABkFzc2V0cwkABEwAAAACAgAAAAZOYXRpb24JAARMAAAAAgIAAAAEQ2l0eQkABEwAAAACAgAAAAdCYXJyYWNrCQAETAAAAAICAAAABEJhcm4JAARMAAAAAgIAAAAHV2F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yaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACmFzc2V0Q29pbnMFAAAACnNoaW55d2dnaWQFAAAAA25pbAkAAAIAAAABAgAAABdJbmNvcnJlY3QgaW52b2tlIHJlc3VsdAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAOc2V0TmF0aW9uT3duZXIAAAACAAAACW5hdGlvbktleQAAAAhuZXdPd25lcgMJAQAAAAEhAAAAAQkBAAAACmNoZWNrQWRtaW4AAAABCAUAAAABaQAAAAZjYWxsZXIJAAUUAAAAAgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIFAAAACW5hdGlvbktleQIAAAAGX093bmVyBQAAAAhuZXdPd25lcgUAAAADbmlsBgQAAAAMY3VycmVudE93bmVyCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACBQAAAAluYXRpb25LZXkCAAAABl9Pd25lcgMJAQAAAAIhPQAAAAIFAAAADGN1cnJlbnRPd25lcgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIJAAACAAAAAQIAAAAcWW91IGFyZSBub3QgdGhlIG5hdGlvbiBvd25lcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIFAAAACW5hdGlvbktleQIAAAAGX093bmVyBQAAAAhuZXdPd25lcgUAAAADbmlsAAAAAKIDREM=", "height": 2046912, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Jwxe1iYboFa511bbijPCRCXJT98ABHqrT6oDYs7UeKi Next: GMbyUuT3t2XNz7iihoCAfS8Bn2FPTcwWdVogHtmryUWb Diff:
OldNewDifferences
104104 func checkNationOwner (caller,NationKey) = {
105105 let nationOwner = tryGetString((NationKey + "_Owner"))
106106 (nationOwner == toString(caller))
107+ }
108+
109+
110+func checkAssetOwner (caller,assetKey) = {
111+ let assetOwner = tryGetString((assetKey + "_Owner"))
112+ (assetOwner == toString(caller))
107113 }
108114
109115
239245
240246
241247 @Callable(i)
248+func destroyAssetFromUser (assetId,strAssetType) = if (!(checkAssetOwner(i.caller, assetId)))
249+ then throw("You don't own this asset")
250+ else {
251+ let assetCoins = tryGetInteger(assetId)
252+ let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power"))
253+ let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
254+ let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
255+ if ((pw == pw))
256+ then match pw {
257+ case r: Int =>
258+[DeleteEntry(assetId), ScriptTransfer(i.caller, assetCoins, shinywggid)]
259+ case _ =>
260+ throw("Incorrect invoke result")
261+ }
262+ else throw("Strict value is not equal to itself.")
263+ }
264+
265+
266+
267+@Callable(i)
242268 func setNationOwner (nationKey,newOwner) = if (!(checkAdmin(i.caller)))
243269 then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true)
244270 else {
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 nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy'
99
1010 let adminAddress = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9")
1111
1212 let BuildStarted = "BUILD_STARTED"
1313
1414 let BuildFinished = "BUILD_FINISHED"
1515
1616 let Assets = ["Nation", "City", "Barrack", "Barn", "Warrior", "Settler", "Explorer"]
1717
1818 let assetsCost = [0, 1000000000, 5000000000, 5000000000, 500000000, 10000000000, 100000000]
1919
2020 let assetsDelay = [0, 4, 4, 4, 2, 2, 2]
2121
2222 let assetsPower = [0, 1000, 500, 500, 0, 0, 0]
2323
2424 func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) {
2525 case b: Int =>
2626 b
2727 case _ =>
2828 0
2929 }
3030
3131
3232 func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) {
3333 case b: Int =>
3434 b
3535 case _ =>
3636 0
3737 }
3838
3939
4040 func tryGetString (key) = match getString(this, key) {
4141 case b: String =>
4242 b
4343 case _ =>
4444 ""
4545 }
4646
4747
4848 func tryGetInteger (key) = match getInteger(this, key) {
4949 case b: Int =>
5050 b
5151 case _ =>
5252 0
5353 }
5454
5555
5656 func getAssetIdKey (txId,assetType) = ((assetType + "_") + toBase58String(txId))
5757
5858
5959 func getAssetOwnerKey (txId,assetType) = (getAssetIdKey(txId, assetType) + "_Owner")
6060
6161
6262 func getBuildingFinishHeightKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_fh")
6363
6464
6565 func getBuildingStatusKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_status")
6666
6767
6868 func getTreasuryKey (nationid) = (nationid + "_Treasury")
6969
7070
7171 func checkAdmin (caller) = if (if (if ((caller == adminAddress))
7272 then true
7373 else (caller == this))
7474 then true
7575 else (caller.bytes == nationsAddress))
7676 then true
7777 else (caller.bytes == treasuryAddress)
7878
7979
8080 func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = {
8181 let buildingFinishHeight = getIntegerValue(this, finishHeightKey)
8282 if ((buildingFinishHeight > height))
8383 then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes"))
8484 else {
8585 let idx = value(indexOf(Assets, assetStr))
8686 let assetPower = assetsPower[idx]
8787 let assetCoins = assetsCost[idx]
8888 let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil)
8989 if ((refCall == refCall))
9090 then if ((assetPower > 0))
9191 then {
9292 let currentPower = nationsTryGetInteger((caller + "_Power"))
9393 let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil)
9494 if ((pw == pw))
9595 then [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
9696 else throw("Strict value is not equal to itself.")
9797 }
9898 else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
9999 else throw("Strict value is not equal to itself.")
100100 }
101101 }
102102
103103
104104 func checkNationOwner (caller,NationKey) = {
105105 let nationOwner = tryGetString((NationKey + "_Owner"))
106106 (nationOwner == toString(caller))
107+ }
108+
109+
110+func checkAssetOwner (caller,assetKey) = {
111+ let assetOwner = tryGetString((assetKey + "_Owner"))
112+ (assetOwner == toString(caller))
107113 }
108114
109115
110116 func isNationReservedAsset (strAssetType) = if ((strAssetType == "Settler"))
111117 then true
112118 else (strAssetType == "Explorer")
113119
114120
115121 @Callable(i)
116122 func StartBuild (strAssetType,NationKey) = if (!(containsElement(Assets, strAssetType)))
117123 then throw("This asset is not amanged by the system")
118124 else {
119125 let ind = value(indexOf(Assets, strAssetType))
120126 let delayForBuilding = assetsDelay[ind]
121127 let assetBuildCost = assetsCost[ind]
122128 if (isNationReservedAsset(strAssetType))
123129 then if (if (!(checkNationOwner(i.caller, NationKey)))
124130 then !(checkAdmin(i.caller))
125131 else false)
126132 then throw("You are not authorized to perform this operation")
127133 else {
128134 let nationsheg = treasuryTryGetInteger(getTreasuryKey(NationKey))
129135 if ((assetBuildCost > nationsheg))
130136 then throw("The nation hasn't enough funds")
131137 else {
132138 let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil)
133139 let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, assetBuildCost], nil)
134140 match pw {
135141 case r: Int =>
136142 [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))]
137143 case _ =>
138144 throw("Incorrect invoke result")
139145 }
140146 }
141147 }
142148 else {
143149 let amountIn = value(i.payments[0].amount)
144150 if ((assetBuildCost > amountIn))
145151 then throw(("You provided less $heg than the needed cost for building this " + strAssetType))
146152 else if ((i.payments[0].assetId != shinywggid))
147153 then throw("Only $HEG payments allowed")
148154 else {
149155 let pw = invoke(Address(treasuryAddress), "Deposit", nil, i.payments)
150156 match pw {
151157 case r: Int =>
152158 [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))]
153159 case _ =>
154160 throw("Incorrect invoke result")
155161 }
156162 }
157163 }
158164 }
159165
160166
161167
162168 @Callable(i)
163169 func FinishBuild (txIdStr,assetStr,NationKey) = {
164170 let txId = fromBase58String(txIdStr)
165171 let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, assetStr)
166172 let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, assetStr)
167173 let assetKey = getAssetIdKey(txId, assetStr)
168174 let assetOwner = tryGetString(getAssetOwnerKey(txId, assetStr))
169175 if (isNationReservedAsset(assetStr))
170176 then if (if (!(checkNationOwner(i.caller, NationKey)))
171177 then !(checkAdmin(i.caller))
172178 else false)
173179 then throw("You are not authorized to perform this operation")
174180 else internalFinishBuild(NationKey, assetStr, assetKey, BuildingStatusKey, finishHeightKey)
175181 else if ((assetOwner != toString(i.caller)))
176182 then throw(("You cannot claim other's players " + assetStr))
177183 else {
178184 let buildingTxStatus = tryGetString(BuildingStatusKey)
179185 if ((buildingTxStatus == ""))
180186 then throw("No pending operations for this asset")
181187 else internalFinishBuild(toString(i.caller), assetStr, assetKey, BuildingStatusKey, finishHeightKey)
182188 }
183189 }
184190
185191
186192
187193 @Callable(i)
188194 func transferOwnership (assetId,newOwner,strAssetType) = if (!(checkAdmin(i.caller)))
189195 then throw("Only the admin can perform this operation")
190196 else {
191197 let oldOwner = tryGetString((assetId + "_Owner"))
192198 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
193199 let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
194200 let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
195201 if ((pw == pw))
196202 then if ((pw != (currentPower - assetPower)))
197203 then throw("Incorrect invoke result")
198204 else {
199205 let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
200206 let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil)
201207 if ((pw2 == pw2))
202208 then match pw2 {
203209 case r: Int =>
204210 [StringEntry((assetId + "_Owner"), newOwner)]
205211 case _ =>
206212 throw("Incorrect invoke result")
207213 }
208214 else throw("Strict value is not equal to itself.")
209215 }
210216 else throw("Strict value is not equal to itself.")
211217 }
212218
213219
214220
215221 @Callable(i)
216222 func destroyAssetAndTransfer (assetId,toAddress,strAssetType) = if (!(checkAdmin(i.caller)))
217223 then throw("Only the admin can perform this operation")
218224 else {
219225 let oldOwner = tryGetString((assetId + "_Owner"))
220226 let assetCoins = tryGetInteger(assetId)
221227 let refCall = invoke(Address(treasuryAddress), "arbitraryAddCoins", [toAddress, assetCoins], nil)
222228 if ((refCall == refCall))
223229 then {
224230 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
225231 let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
226232 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
227233 if ((pw == pw))
228234 then match pw {
229235 case r: Int =>
230236 [DeleteEntry(assetId)]
231237 case _ =>
232238 throw("Incorrect invoke result")
233239 }
234240 else throw("Strict value is not equal to itself.")
235241 }
236242 else throw("Strict value is not equal to itself.")
237243 }
238244
239245
240246
241247 @Callable(i)
248+func destroyAssetFromUser (assetId,strAssetType) = if (!(checkAssetOwner(i.caller, assetId)))
249+ then throw("You don't own this asset")
250+ else {
251+ let assetCoins = tryGetInteger(assetId)
252+ let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power"))
253+ let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
254+ let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
255+ if ((pw == pw))
256+ then match pw {
257+ case r: Int =>
258+[DeleteEntry(assetId), ScriptTransfer(i.caller, assetCoins, shinywggid)]
259+ case _ =>
260+ throw("Incorrect invoke result")
261+ }
262+ else throw("Strict value is not equal to itself.")
263+ }
264+
265+
266+
267+@Callable(i)
242268 func setNationOwner (nationKey,newOwner) = if (!(checkAdmin(i.caller)))
243269 then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true)
244270 else {
245271 let currentOwner = tryGetString((nationKey + "_Owner"))
246272 if ((currentOwner != toString(i.caller)))
247273 then throw("You are not the nation owner")
248274 else [StringEntry((nationKey + "_Owner"), newOwner)]
249275 }
250276
251277

github/deemru/w8io/169f3d6 
41.42 ms