tx · FFfGvxM1taiRhZrVSyuWPdVmP3nuuBRmvBXsmBg6VZk2

3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb:  -0.01000000 Waves

2022.05.12 12:01 [2048255] smart account 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb > SELF 0.00000000 Waves

{ "type": 13, "id": "FFfGvxM1taiRhZrVSyuWPdVmP3nuuBRmvBXsmBg6VZk2", "fee": 1000000, "feeAssetId": null, "timestamp": 1652346134451, "version": 2, "chainId": 84, "sender": "3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb", "senderPublicKey": "FWSsBbeCwLVkekWhvNKtX6JkrZiruRybKKVuiS3F4bqN", "proofs": [ "5MWn8UwJfwvLcNYzuk6pqGP3ZSjD684zwHFsZA2QLJvzfVLq3dWZ6ywMRuwgxztiU7QRgLahU8sxQ5hCr3aaHZnY" ], "script": "base64:AAIFAAAAAAAAADkIAhIECgIICBIFCgMICAgSBAoCCAgSBAoCCAgSAwoBCBIECgIICBIECgIICBIFCgMICAESBAoCCAEAAAAbAAAAAApzaGlueXdnZ2lkAQAAACCJac8C/7a6udRxltd5uJl2JrB00Hd59HNuhvD0c58GJgAAAAAPdHJlYXN1cnlBZGRyZXNzAQAAABoBVGX48BYLBMBZQnAankiMl/9+3Bxi8t27/QAAAAAObmF0aW9uc0FkZHJlc3MBAAAAGgFUTYXo3vT4RGtZEDtwX8O3uWUOUfVERm2gAAAAABJtYXJrZXRwbGFjZUFkZHJlc3MBAAAAGgFUHSG5k/H8GMOnG0lxFkOWUXTrrFQuJbzvAAAAAAxhZG1pbkFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAAAxCdWlsZFN0YXJ0ZWQCAAAADUJVSUxEX1NUQVJURUQAAAAADUJ1aWxkRmluaXNoZWQCAAAADkJVSUxEX0ZJTklTSEVEAAAAAAZBc3NldHMJAARMAAAA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jaGVja0Fzc2V0T3duZXIAAAACCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAAHYXNzZXRJZAkAAAIAAAABAgAAACNZb3UgYXJlIG5vdCB0aGUgb3duZXIgb2YgdGhpcyBhc3NldAQAAAAJYXNzZXRTaGVnCQEAAAANdHJ5R2V0SW50ZWdlcgAAAAEFAAAAB2Fzc2V0SWQEAAAAAnRyCQAD/AAAAAQJAQAAAAdBZGRyZXNzAAAAAQUAAAASbWFya2V0cGxhY2VBZGRyZXNzAgAAAAlwdXRPblNhbGUJAARMAAAAAgUAAAAHYXNzZXRJZAkABEwAAAACBQAAAAlhc3NldFNoZWcJAARMAAAAAgUAAAAJc2VsbHByaWNlBQAAAANuaWwFAAAAA25pbAQAAAAHJG1hdGNoMAUAAAACdHIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABdAUAAAAHJG1hdGNoMAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAWZ2V0QXNzZXRPd25lcktleVN0cmluZwAAAAEFAAAAB2Fzc2V0SWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAHYXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAAKUVycm9yIHB1dHRpbmcgdGhlIGl0ZW0gb24gdGhlIG1hcmtldHBsYWNlAAAAACgSt74=", "height": 2048255, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8BLVNGb9tCwPSVzen7iYcEumv3AdciiG5kMJfCMwBQYG Next: 37Q5ohmsCNj5zC74uLjtP2xJMoKVkrazLY8zBidUcmoz Diff:
OldNewDifferences
66 let treasuryAddress = base58'3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ'
77
88 let nationsAddress = base58'3MvyzDtzWWV5MZ1GP8JfQhhQqiGU4Nbifdy'
9+
10+let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A'
911
1012 let adminAddress = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9")
1113
6163 func getAssetOwnerKey (txId,assetType) = (getAssetIdKey(txId, assetType) + "_Owner")
6264
6365
66+func getAssetOwnerKeyString (assetId) = (assetId + "_Owner")
67+
68+
6469 func getBuildingFinishHeightKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_fh")
6570
6671
7075 func getTreasuryKey (nationid) = (nationid + "_Treasury")
7176
7277
73-func checkAdmin (caller) = if (if (if ((caller == adminAddress))
78+func checkAdmin (caller) = if (if (if (if ((caller == adminAddress))
7479 then true
7580 else (caller == this))
7681 then true
7782 else (caller.bytes == nationsAddress))
7883 then true
79- else (caller.bytes == treasuryAddress)
84+ else (caller.bytes == treasuryAddress))
85+ then true
86+ else (caller.bytes == marketplaceAddress)
8087
8188
8289 func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = {
112119 func isNationReservedAsset (strAssetType) = if ((strAssetType == "Settler"))
113120 then true
114121 else (strAssetType == "Explorer")
122+
123+
124+func internalTrasnferOwnership (assetId,newOwner) = {
125+ let strAssetType = split(assetId, "_")[0]
126+ let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
127+ let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
128+ if ((assetPower > 0))
129+ then {
130+ let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
131+ let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
132+ if ((pw == pw))
133+ then if ((pw != (currentPower - assetPower)))
134+ then throw("Incorrect invoke result")
135+ else {
136+ let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
137+ let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil)
138+ if ((pw2 == pw2))
139+ then match pw2 {
140+ case r: Int =>
141+[StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
142+ case _ =>
143+ throw("Incorrect invoke result")
144+ }
145+ else throw("Strict value is not equal to itself.")
146+ }
147+ else throw("Strict value is not equal to itself.")
148+ }
149+ else [StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
150+ }
115151
116152
117153 @Callable(i)
196232 let strAssetType = split(assetId, "_")[0]
197233 if (!(checkAdmin(i.caller)))
198234 then throw("Only the admin can perform this operation")
199- else {
200- let oldOwner = tryGetString((assetId + "_Owner"))
201- let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
202- if ((assetPower > 0))
203- then {
204- let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
205- let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
206- if ((pw == pw))
207- then if ((pw != (currentPower - assetPower)))
208- then throw("Incorrect invoke result")
209- else {
210- let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
211- let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil)
212- if ((pw2 == pw2))
213- then match pw2 {
214- case r: Int =>
215- $Tuple2([StringEntry((assetId + "_Owner"), newOwner)], newOwner)
216- case _ =>
217- throw("Incorrect invoke result")
218- }
219- else throw("Strict value is not equal to itself.")
220- }
221- else throw("Strict value is not equal to itself.")
222- }
223- else $Tuple2([StringEntry((assetId + "_Owner"), newOwner)], newOwner)
224- }
235+ else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner)
225236 }
226237
227238
232243 if (!(checkAdmin(i.caller)))
233244 then throw("Only the admin can perform this operation")
234245 else {
235- let oldOwner = tryGetString((assetId + "_Owner"))
246+ let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
236247 let assetCoins = tryGetInteger(assetId)
237248 let refCall = invoke(Address(treasuryAddress), "arbitraryAddCoins", [toAddress, assetCoins], nil)
238249 if ((refCall == refCall))
313324 let a = invoke(Address(treasuryAddress), "increaseNationWallet", [NationKey, amountIn], nil)
314325 match a {
315326 case b: Int =>
316- let p = invoke(this, "transferOwnership", [assetId, toString(i.caller)], nil)
317- match p {
318- case t: String =>
319-[ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid)]
320- case _ =>
321- throw("Error transferring Ownership")
322- }
327+ (internalTrasnferOwnership(assetId, toString(i.caller)) :+ ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid))
323328 case _ =>
324329 throw("Error transferring SHEG to nations wallet")
325330 }
328333 }
329334
330335
336+
337+@Callable(i)
338+func AddAssetFromMarkeplace (assetId,oldOwner,assetSheg) = if (!(checkAdmin(i.caller)))
339+ then throw("You are not allowed to perform this operation")
340+ else $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), oldOwner), IntegerEntry(assetId, assetSheg)], oldOwner)
341+
342+
343+
344+@Callable(i)
345+func TransferAssetToMarketplace (assetId,sellprice) = if (!(checkAssetOwner(toString(i.caller), assetId)))
346+ then throw("You are not the owner of this asset")
347+ else {
348+ let assetSheg = tryGetInteger(assetId)
349+ let tr = invoke(Address(marketplaceAddress), "putOnSale", [assetId, assetSheg, sellprice], nil)
350+ match tr {
351+ case t: Int =>
352+[DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(assetId)]
353+ case _ =>
354+ throw("Error putting the item on the marketplace")
355+ }
356+ }
357+
358+
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'
9+
10+let marketplaceAddress = base58'3Mra7mjPipcQd5sJaRmXK8xgS4scb8gPF4A'
911
1012 let adminAddress = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9")
1113
1214 let BuildStarted = "BUILD_STARTED"
1315
1416 let BuildFinished = "BUILD_FINISHED"
1517
1618 let Assets = ["Nation", "City", "Barrack", "Barn", "Warrior", "Settler", "Explorer"]
1719
1820 let assetsCost = [0, 1000000000, 5000000000, 5000000000, 500000000, 10000000000, 100000000]
1921
2022 let assetsSellPrice = [0, 0, 0, 0, 0, 10000000000, 100000000]
2123
2224 let assetsDelay = [0, 4, 4, 4, 2, 2, 2]
2325
2426 let assetsPower = [0, 1000, 500, 500, 0, 0, 0]
2527
2628 func treasuryTryGetInteger (key) = match getInteger(Address(treasuryAddress), key) {
2729 case b: Int =>
2830 b
2931 case _ =>
3032 0
3133 }
3234
3335
3436 func nationsTryGetInteger (key) = match getInteger(Address(nationsAddress), key) {
3537 case b: Int =>
3638 b
3739 case _ =>
3840 0
3941 }
4042
4143
4244 func tryGetString (key) = match getString(this, key) {
4345 case b: String =>
4446 b
4547 case _ =>
4648 ""
4749 }
4850
4951
5052 func tryGetInteger (key) = match getInteger(this, key) {
5153 case b: Int =>
5254 b
5355 case _ =>
5456 0
5557 }
5658
5759
5860 func getAssetIdKey (txId,assetType) = ((assetType + "_") + toBase58String(txId))
5961
6062
6163 func getAssetOwnerKey (txId,assetType) = (getAssetIdKey(txId, assetType) + "_Owner")
6264
6365
66+func getAssetOwnerKeyString (assetId) = (assetId + "_Owner")
67+
68+
6469 func getBuildingFinishHeightKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_fh")
6570
6671
6772 func getBuildingStatusKey (address,txId,assetType) = (((address + "_") + getAssetIdKey(txId, assetType)) + "_status")
6873
6974
7075 func getTreasuryKey (nationid) = (nationid + "_Treasury")
7176
7277
73-func checkAdmin (caller) = if (if (if ((caller == adminAddress))
78+func checkAdmin (caller) = if (if (if (if ((caller == adminAddress))
7479 then true
7580 else (caller == this))
7681 then true
7782 else (caller.bytes == nationsAddress))
7883 then true
79- else (caller.bytes == treasuryAddress)
84+ else (caller.bytes == treasuryAddress))
85+ then true
86+ else (caller.bytes == marketplaceAddress)
8087
8188
8289 func internalFinishBuild (caller,assetStr,assetKey,BuildingStatusKey,finishHeightKey) = {
8390 let buildingFinishHeight = getIntegerValue(this, finishHeightKey)
8491 if ((buildingFinishHeight > height))
8592 then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes"))
8693 else {
8794 let idx = value(indexOf(Assets, assetStr))
8895 let assetPower = assetsPower[idx]
8996 let assetCoins = assetsCost[idx]
9097 let refCall = invoke(Address(treasuryAddress), "Pay", [caller, assetCoins], nil)
9198 if ((refCall == refCall))
9299 then if ((assetPower > 0))
93100 then {
94101 let currentPower = nationsTryGetInteger((caller + "_Power"))
95102 let pw = invoke(Address(nationsAddress), "setUserPower", [caller, (currentPower + assetPower)], nil)
96103 if ((pw == pw))
97104 then [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
98105 else throw("Strict value is not equal to itself.")
99106 }
100107 else [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
101108 else throw("Strict value is not equal to itself.")
102109 }
103110 }
104111
105112
106113 func checkAssetOwner (caller,assetKey) = {
107114 let assetOwner = tryGetString((assetKey + "_Owner"))
108115 (assetOwner == caller)
109116 }
110117
111118
112119 func isNationReservedAsset (strAssetType) = if ((strAssetType == "Settler"))
113120 then true
114121 else (strAssetType == "Explorer")
122+
123+
124+func internalTrasnferOwnership (assetId,newOwner) = {
125+ let strAssetType = split(assetId, "_")[0]
126+ let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
127+ let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
128+ if ((assetPower > 0))
129+ then {
130+ let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
131+ let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
132+ if ((pw == pw))
133+ then if ((pw != (currentPower - assetPower)))
134+ then throw("Incorrect invoke result")
135+ else {
136+ let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
137+ let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil)
138+ if ((pw2 == pw2))
139+ then match pw2 {
140+ case r: Int =>
141+[StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
142+ case _ =>
143+ throw("Incorrect invoke result")
144+ }
145+ else throw("Strict value is not equal to itself.")
146+ }
147+ else throw("Strict value is not equal to itself.")
148+ }
149+ else [StringEntry(getAssetOwnerKeyString(assetId), newOwner)]
150+ }
115151
116152
117153 @Callable(i)
118154 func StartBuild (strAssetType,NationKey) = if (!(containsElement(Assets, strAssetType)))
119155 then throw("This asset is not amanged by the system")
120156 else {
121157 let ind = value(indexOf(Assets, strAssetType))
122158 let delayForBuilding = assetsDelay[ind]
123159 let assetBuildCost = assetsCost[ind]
124160 if (isNationReservedAsset(strAssetType))
125161 then if (if (!(checkAssetOwner(toString(i.caller), NationKey)))
126162 then !(checkAdmin(i.caller))
127163 else false)
128164 then throw("You are not authorized to perform this operation")
129165 else {
130166 let nationsheg = treasuryTryGetInteger(getTreasuryKey(NationKey))
131167 if ((assetBuildCost > nationsheg))
132168 then throw("The nation hasn't enough funds")
133169 else {
134170 let d = invoke(Address(treasuryAddress), "decreaseNationWallet", [NationKey, assetBuildCost], nil)
135171 match d {
136172 case r: Int =>
137173 let pw = invoke(Address(treasuryAddress), "arbitraryAddCoins", [NationKey, assetBuildCost], nil)
138174 match pw {
139175 case b: Int =>
140176 [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))]
141177 case _ =>
142178 throw("Error Depositing nation funds")
143179 }
144180 case _ =>
145181 throw("Error Depositing nation funds")
146182 }
147183 }
148184 }
149185 else {
150186 let amountIn = value(i.payments[0].amount)
151187 if ((assetBuildCost > amountIn))
152188 then throw(("You provided less $heg than the needed cost for building this " + strAssetType))
153189 else if ((i.payments[0].assetId != shinywggid))
154190 then throw("Only $HEG payments allowed")
155191 else {
156192 let pw = invoke(Address(treasuryAddress), "Deposit", nil, i.payments)
157193 match pw {
158194 case r: Int =>
159195 [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))]
160196 case _ =>
161197 throw("Incorrect invoke result")
162198 }
163199 }
164200 }
165201 }
166202
167203
168204
169205 @Callable(i)
170206 func FinishBuild (txIdStr,assetStr,NationKey) = {
171207 let txId = fromBase58String(txIdStr)
172208 let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, assetStr)
173209 let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, assetStr)
174210 let assetKey = getAssetIdKey(txId, assetStr)
175211 let assetOwner = tryGetString(getAssetOwnerKey(txId, assetStr))
176212 if (isNationReservedAsset(assetStr))
177213 then if (if (!(checkAssetOwner(toString(i.caller), NationKey)))
178214 then !(checkAdmin(i.caller))
179215 else false)
180216 then throw("You are not authorized to perform this operation")
181217 else internalFinishBuild(NationKey, assetStr, assetKey, BuildingStatusKey, finishHeightKey)
182218 else if ((assetOwner != toString(i.caller)))
183219 then throw(("You cannot claim other's players " + assetStr))
184220 else {
185221 let buildingTxStatus = tryGetString(BuildingStatusKey)
186222 if ((buildingTxStatus == ""))
187223 then throw("No pending operations for this asset")
188224 else internalFinishBuild(toString(i.caller), assetStr, assetKey, BuildingStatusKey, finishHeightKey)
189225 }
190226 }
191227
192228
193229
194230 @Callable(i)
195231 func transferOwnership (assetId,newOwner) = {
196232 let strAssetType = split(assetId, "_")[0]
197233 if (!(checkAdmin(i.caller)))
198234 then throw("Only the admin can perform this operation")
199- else {
200- let oldOwner = tryGetString((assetId + "_Owner"))
201- let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
202- if ((assetPower > 0))
203- then {
204- let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
205- let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
206- if ((pw == pw))
207- then if ((pw != (currentPower - assetPower)))
208- then throw("Incorrect invoke result")
209- else {
210- let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
211- let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (newcurrentPower + assetPower)], nil)
212- if ((pw2 == pw2))
213- then match pw2 {
214- case r: Int =>
215- $Tuple2([StringEntry((assetId + "_Owner"), newOwner)], newOwner)
216- case _ =>
217- throw("Incorrect invoke result")
218- }
219- else throw("Strict value is not equal to itself.")
220- }
221- else throw("Strict value is not equal to itself.")
222- }
223- else $Tuple2([StringEntry((assetId + "_Owner"), newOwner)], newOwner)
224- }
235+ else $Tuple2(internalTrasnferOwnership(assetId, newOwner), newOwner)
225236 }
226237
227238
228239
229240 @Callable(i)
230241 func destroyAssetAndTransfer (assetId,toAddress) = {
231242 let strAssetType = split(assetId, "_")[0]
232243 if (!(checkAdmin(i.caller)))
233244 then throw("Only the admin can perform this operation")
234245 else {
235- let oldOwner = tryGetString((assetId + "_Owner"))
246+ let oldOwner = tryGetString(getAssetOwnerKeyString(assetId))
236247 let assetCoins = tryGetInteger(assetId)
237248 let refCall = invoke(Address(treasuryAddress), "arbitraryAddCoins", [toAddress, assetCoins], nil)
238249 if ((refCall == refCall))
239250 then {
240251 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
241252 let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
242253 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
243254 if ((pw == pw))
244255 then match pw {
245256 case r: Int =>
246257 [DeleteEntry(assetId)]
247258 case _ =>
248259 throw("Incorrect invoke result")
249260 }
250261 else throw("Strict value is not equal to itself.")
251262 }
252263 else throw("Strict value is not equal to itself.")
253264 }
254265 }
255266
256267
257268
258269 @Callable(i)
259270 func destroyAssetFromUser (assetId) = {
260271 let strAssetType = split(assetId, "_")[0]
261272 if (!(checkAssetOwner(toString(i.caller), assetId)))
262273 then throw("You don't own this asset")
263274 else {
264275 let assetCoins = tryGetInteger(assetId)
265276 let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power"))
266277 let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
267278 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
268279 if ((pw == pw))
269280 then match pw {
270281 case r: Int =>
271282 [DeleteEntry(assetId), ScriptTransfer(i.caller, assetCoins, shinywggid)]
272283 case _ =>
273284 throw("Incorrect invoke result")
274285 }
275286 else throw("Strict value is not equal to itself.")
276287 }
277288 }
278289
279290
280291
281292 @Callable(i)
282293 func setNationOwner (nationKey,newOwner) = if (checkAdmin(i.caller))
283294 then $Tuple2([StringEntry((nationKey + "_Owner"), newOwner)], true)
284295 else {
285296 let currentOwner = tryGetString((nationKey + "_Owner"))
286297 if ((currentOwner != toString(i.caller)))
287298 then throw("You are not the nation owner")
288299 else [StringEntry((nationKey + "_Owner"), newOwner)]
289300 }
290301
291302
292303
293304 @Callable(i)
294305 func buyNationItem (assetId,NationKey) = {
295306 let strAssetType = split(assetId, "_")[0]
296307 let n = nationsTryGetInteger(toString(i.caller))
297308 let nid = nationsTryGetInteger(NationKey)
298309 if ((n != nid))
299310 then throw("you can buy assets only from your nation")
300311 else if (!(checkAssetOwner(NationKey, assetId)))
301312 then throw("The asset does not belong to the nation")
302313 else if (!(isNationReservedAsset(strAssetType)))
303314 then throw("this asset cannot be sold by the nation")
304315 else {
305316 let ind = value(indexOf(Assets, strAssetType))
306317 let assetPrice = assetsSellPrice[ind]
307318 let amountIn = value(i.payments[0].amount)
308319 if ((assetPrice > amountIn))
309320 then throw(("You provided less $heg than the needed cost for buying this " + strAssetType))
310321 else if ((i.payments[0].assetId != shinywggid))
311322 then throw("Only $HEG payments allowed")
312323 else {
313324 let a = invoke(Address(treasuryAddress), "increaseNationWallet", [NationKey, amountIn], nil)
314325 match a {
315326 case b: Int =>
316- let p = invoke(this, "transferOwnership", [assetId, toString(i.caller)], nil)
317- match p {
318- case t: String =>
319-[ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid)]
320- case _ =>
321- throw("Error transferring Ownership")
322- }
327+ (internalTrasnferOwnership(assetId, toString(i.caller)) :+ ScriptTransfer(Address(treasuryAddress), amountIn, shinywggid))
323328 case _ =>
324329 throw("Error transferring SHEG to nations wallet")
325330 }
326331 }
327332 }
328333 }
329334
330335
336+
337+@Callable(i)
338+func AddAssetFromMarkeplace (assetId,oldOwner,assetSheg) = if (!(checkAdmin(i.caller)))
339+ then throw("You are not allowed to perform this operation")
340+ else $Tuple2([StringEntry(getAssetOwnerKeyString(assetId), oldOwner), IntegerEntry(assetId, assetSheg)], oldOwner)
341+
342+
343+
344+@Callable(i)
345+func TransferAssetToMarketplace (assetId,sellprice) = if (!(checkAssetOwner(toString(i.caller), assetId)))
346+ then throw("You are not the owner of this asset")
347+ else {
348+ let assetSheg = tryGetInteger(assetId)
349+ let tr = invoke(Address(marketplaceAddress), "putOnSale", [assetId, assetSheg, sellprice], nil)
350+ match tr {
351+ case t: Int =>
352+[DeleteEntry(getAssetOwnerKeyString(assetId)), DeleteEntry(assetId)]
353+ case _ =>
354+ throw("Error putting the item on the marketplace")
355+ }
356+ }
357+
358+

github/deemru/w8io/169f3d6 
47.39 ms