tx · GX59dphnSvfR1FTR8GnqV7WdQZd7Woorv3s1ECAMdiLi

3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb:  -0.01000000 Waves

2022.05.09 14:20 [2044073] smart account 3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb > SELF 0.00000000 Waves

{ "type": 13, "id": "GX59dphnSvfR1FTR8GnqV7WdQZd7Woorv3s1ECAMdiLi", "fee": 1000000, "feeAssetId": null, "timestamp": 1652095268548, "version": 2, "chainId": 84, "sender": "3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb", "senderPublicKey": "FWSsBbeCwLVkekWhvNKtX6JkrZiruRybKKVuiS3F4bqN", "proofs": [ "oRkc62BMf6jV6VqySpon1tHgvsRDhzeDnmQn85nXnXZTzRi2EaRSzzgXY6bHMcG2XcDgycrJNMbhpNAtXMncc6z" ], "script": "base64:AAIFAAAAAAAAABsIAhIDCgEIEgQKAggIEgUKAwgICBIFCgMICAgAAAASAAAAAApzaGlueXdnZ2lkAQAAACCJac8C/7a6udRxltd5uJl2JrB00Hd59HNuhvD0c58GJgAAAAAPdHJlYXN1cnlBZGRyZXNzAQAAABoBVGX48BYLBMBZQnAankiMl/9+3Bxi8t27/QAAAAAObmF0aW9uc0FkZHJlc3MBAAAAGgFUTYXo3vT4RGtZEDtwX8O3uWUOUfVERm2gAAAAAAxhZG1pbkFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAAAxCdWlsZFN0YXJ0ZWQCAAAADUJVSUxEX1NUQVJURUQAAAAADUJ1aWxkRmluaXNoZWQCAAAADkJVSUxEX0ZJTklTSEVEAAAAAAZBc3NldHMJAARMAAAAAgIAAAAEQ2l0eQkABEwAAAACAgAAAAdCYXJyYWNrCQAETAAAAAICAAAABEJhcm4JAARMAAAAAgIAAAAHV2FycmlvcgUAAAADbmlsAAAAAAphc3NldHNDb3N0CQAETA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kNhbGwEAAAADGN1cnJlbnRQb3dlcgkBAAAAFG5hdGlvbnNUcnlHZXRJbnRlZ2VyAAAAAQkAASwAAAACBQAAAAhvbGRPd25lcgIAAAAGX1Bvd2VyBAAAAAphc3NldFBvd2VyCQABkQAAAAIFAAAAC2Fzc2V0c1Bvd2VyCQEAAAAFdmFsdWUAAAABCQAETwAAAAIFAAAABkFzc2V0cwUAAAAMc3RyQXNzZXRUeXBlBAAAAAJwdwkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEFAAAADm5hdGlvbnNBZGRyZXNzAgAAAAxzZXRVc2VyUG93ZXIJAARMAAAAAgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIJAARMAAAAAgkAAGUAAAACBQAAAAxjdXJyZW50UG93ZXIFAAAACmFzc2V0UG93ZXIFAAAAA25pbAUAAAADbmlsAwkAAAAAAAACBQAAAAJwdwUAAAACcHcEAAAAByRtYXRjaDAFAAAAAnB3AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXIFAAAAByRtYXRjaDAJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAHYXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAAF0luY29ycmVjdCBpbnZva2UgcmVzdWx0CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAA+5eq7Q==", "height": 2044073, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3FbWH3uXFfJfZ4Cq8dhGMVwnpb2NjP24k7GpMwp4eq2H Next: 4MXP6QRsxmvnr9QPmCf5VXLFhGCGUWy4jhQSCBryCkXk 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 = ["City", "Barrack", "Barn", "Warrior"]
1717
1818 let assetsCost = [1000000000, 1000000000, 1000000000, 500000000]
1919
2020 let assetsDelay = [4, 4, 4, 2]
2121
2222 let assetsPower = [1000, 500, 500, 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(treasuryAddress), 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 @Callable(i)
6969 func StartBuild (strAssetType) = if (!(containsElement(Assets, strAssetType)))
7070 then throw("This asset is not amanged by the system")
7171 else {
7272 let ind = value(indexOf(Assets, strAssetType))
7373 let delayForBuilding = assetsDelay[ind]
7474 let assetBuildCost = assetsCost[ind]
7575 let amountIn = value(i.payments[0].amount)
7676 if ((assetBuildCost > amountIn))
7777 then throw(("You provided less $heg than the needed cost for building this " + strAssetType))
7878 else if ((i.payments[0].assetId != shinywggid))
7979 then throw("Only $HEG payments allowed")
8080 else {
8181 let pw = invoke(Address(treasuryAddress), "Deposit", nil, i.payments)
8282 match pw {
8383 case r: Int =>
8484 [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))]
8585 case _ =>
8686 throw("Incorrect invoke result")
8787 }
8888 }
8989 }
9090
9191
9292
9393 @Callable(i)
9494 func FinishBuild (txIdStr,assetStr) = {
9595 let txId = fromBase58String(txIdStr)
9696 let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, assetStr)
9797 let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, assetStr)
9898 let assetKey = getAssetIdKey(txId, assetStr)
9999 let assetOwner = tryGetString(getAssetOwnerKey(txId, assetStr))
100100 if ((assetOwner != toString(i.caller)))
101101 then throw(("You cannot claim other's players " + assetStr))
102102 else {
103103 let buildingTxStatus = tryGetString(BuildingStatusKey)
104104 if ((buildingTxStatus == ""))
105105 then throw("No pending operations for this asset")
106106 else {
107107 let buildingFinishHeight = getIntegerValue(this, finishHeightKey)
108108 if ((buildingFinishHeight > height))
109109 then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes"))
110110 else {
111111 let idx = value(indexOf(Assets, assetStr))
112112 let assetPower = assetsPower[idx]
113113 let assetCoins = assetsCost[idx]
114114 let refCall = invoke(Address(treasuryAddress), "Pay", [toString(i.caller), assetCoins], nil)
115115 if ((refCall == refCall))
116116 then {
117117 let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power"))
118118 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower + assetPower)], nil)
119119 if ((pw == pw))
120120 then match pw {
121121 case r: Int =>
122122 [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)]
123123 case _ =>
124124 throw("Incorrect invoke result")
125125 }
126126 else throw("Strict value is not equal to itself.")
127127 }
128128 else throw("Strict value is not equal to itself.")
129129 }
130130 }
131131 }
132132 }
133133
134134
135135
136136 @Callable(i)
137137 func transferOwnership (assetId,newOwner,strAssetType) = if (if ((i.caller != adminAddress))
138138 then (i.caller != this)
139139 else false)
140140 then throw("Only the admin can perform this operation")
141141 else {
142142 let oldOwner = tryGetString((assetId + "_Owner"))
143143 let currentPower = nationsTryGetInteger(oldOwner)
144144 let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
145145 let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil)
146146 if ((pw == pw))
147147 then if ((pw != (currentPower - assetPower)))
148148 then throw("Incorrect invoke result")
149149 else {
150150 let newcurrentPower = nationsTryGetInteger((newOwner + "_Power"))
151151 let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (currentPower + assetPower)], nil)
152152 if ((pw2 == pw2))
153153 then match pw2 {
154154 case r: Int =>
155155 [StringEntry((assetId + "_Owner"), newOwner)]
156156 case _ =>
157157 throw("Incorrect invoke result")
158158 }
159159 else throw("Strict value is not equal to itself.")
160160 }
161161 else throw("Strict value is not equal to itself.")
162162 }
163163
164164
165165
166166 @Callable(i)
167167 func destroyAssetAndTransfer (assetId,toAddress,strAssetType) = if (if ((i.caller != adminAddress))
168168 then (i.caller != this)
169169 else false)
170170 then throw("Only the admin can perform this operation")
171171 else {
172172 let oldOwner = tryGetString((assetId + "_Owner"))
173173 let assetCoins = tryGetInteger(assetId)
174174 let refCall = invoke(Address(treasuryAddress), "transferCoins", [oldOwner, toAddress, assetCoins], nil)
175175 if ((refCall == refCall))
176176 then {
177177 let currentPower = nationsTryGetInteger((oldOwner + "_Power"))
178178 let assetPower = assetsPower[value(indexOf(Assets, strAssetType))]
179179 let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil)
180180 if ((pw == pw))
181181 then match pw {
182182 case r: Int =>
183183 [DeleteEntry(assetId)]
184184 case _ =>
185185 throw("Incorrect invoke result")
186186 }
187187 else throw("Strict value is not equal to itself.")
188188 }
189189 else throw("Strict value is not equal to itself.")
190190 }
191191
192192

github/deemru/w8io/169f3d6 
41.95 ms