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/QAAAAAObmF0aW9uc0FkZHJlc3MBAAAAGgFUTYXo3vT4RGtZEDtwX8O3uWUOUfVERm2gAAAAAAxhZG1pbkFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNNcE50aVBTUlNxNk5uYVFZazM4QmZXU3paY2dBWVR5clE5AAAAAAxCdWlsZFN0YXJ0ZWQCAAAADUJVSUxEX1NUQVJURUQAAAAADUJ1aWxkRmluaXNoZWQCAAAADkJVSUxEX0ZJTklTSEVEAAAAAAZBc3NldHMJAARMAAAAAgIAAAAEQ2l0eQkABEwAAAACAgAAAAdCYXJyYWNrCQAETAAAAAICAAAABEJhcm4JAARMAAAAAgIAAAAHV2FycmlvcgUAAAADbmlsAAAAAAphc3NldHNDb3N0CQAETAA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NhbGwEAAAADGN1cnJlbnRQb3dlcgkBAAAAFG5hdGlvbnNUcnlHZXRJbnRlZ2VyAAAAAQkAASwAAAACBQAAAAhvbGRPd25lcgIAAAAGX1Bvd2VyBAAAAAphc3NldFBvd2VyCQABkQAAAAIFAAAAC2Fzc2V0c1Bvd2VyCQEAAAAFdmFsdWUAAAABCQAETwAAAAIFAAAABkFzc2V0cwUAAAAMc3RyQXNzZXRUeXBlBAAAAAJwdwkAA/wAAAAECQEAAAAHQWRkcmVzcwAAAAEFAAAADm5hdGlvbnNBZGRyZXNzAgAAAAxzZXRVc2VyUG93ZXIJAARMAAAAAgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIJAARMAAAAAgkAAGUAAAACBQAAAAxjdXJyZW50UG93ZXIFAAAACmFzc2V0UG93ZXIFAAAAA25pbAUAAAADbmlsAwkAAAAAAAACBQAAAAJwdwUAAAACcHcEAAAAByRtYXRjaDAFAAAAAnB3AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXIFAAAAByRtYXRjaDAJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAHYXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAAF0luY29ycmVjdCBpbnZva2UgcmVzdWx0CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAA+5eq7Q==", "height": 2044073, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3FbWH3uXFfJfZ4Cq8dhGMVwnpb2NjP24k7GpMwp4eq2H Next: 4MXP6QRsxmvnr9QPmCf5VXLFhGCGUWy4jhQSCBryCkXk Full:
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 = ["City", "Barrack", "Barn", "Warrior"] | |
17 | 17 | ||
18 | 18 | let assetsCost = [1000000000, 1000000000, 1000000000, 500000000] | |
19 | 19 | ||
20 | 20 | let assetsDelay = [4, 4, 4, 2] | |
21 | 21 | ||
22 | 22 | let assetsPower = [1000, 500, 500, 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(treasuryAddress), 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 | @Callable(i) | |
69 | 69 | func StartBuild (strAssetType) = if (!(containsElement(Assets, strAssetType))) | |
70 | 70 | then throw("This asset is not amanged by the system") | |
71 | 71 | else { | |
72 | 72 | let ind = value(indexOf(Assets, strAssetType)) | |
73 | 73 | let delayForBuilding = assetsDelay[ind] | |
74 | 74 | let assetBuildCost = assetsCost[ind] | |
75 | 75 | let amountIn = value(i.payments[0].amount) | |
76 | 76 | if ((assetBuildCost > amountIn)) | |
77 | 77 | then throw(("You provided less $heg than the needed cost for building this " + strAssetType)) | |
78 | 78 | else if ((i.payments[0].assetId != shinywggid)) | |
79 | 79 | then throw("Only $HEG payments allowed") | |
80 | 80 | else { | |
81 | 81 | let pw = invoke(Address(treasuryAddress), "Deposit", nil, i.payments) | |
82 | 82 | match pw { | |
83 | 83 | case r: Int => | |
84 | 84 | [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))] | |
85 | 85 | case _ => | |
86 | 86 | throw("Incorrect invoke result") | |
87 | 87 | } | |
88 | 88 | } | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Callable(i) | |
94 | 94 | func FinishBuild (txIdStr,assetStr) = { | |
95 | 95 | let txId = fromBase58String(txIdStr) | |
96 | 96 | let BuildingStatusKey = getBuildingStatusKey(toString(i.caller), txId, assetStr) | |
97 | 97 | let finishHeightKey = getBuildingFinishHeightKey(toString(i.caller), txId, assetStr) | |
98 | 98 | let assetKey = getAssetIdKey(txId, assetStr) | |
99 | 99 | let assetOwner = tryGetString(getAssetOwnerKey(txId, assetStr)) | |
100 | 100 | if ((assetOwner != toString(i.caller))) | |
101 | 101 | then throw(("You cannot claim other's players " + assetStr)) | |
102 | 102 | else { | |
103 | 103 | let buildingTxStatus = tryGetString(BuildingStatusKey) | |
104 | 104 | if ((buildingTxStatus == "")) | |
105 | 105 | then throw("No pending operations for this asset") | |
106 | 106 | else { | |
107 | 107 | let buildingFinishHeight = getIntegerValue(this, finishHeightKey) | |
108 | 108 | if ((buildingFinishHeight > height)) | |
109 | 109 | then throw((((("Building is not finished yet " + toString((buildingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((buildingFinishHeight - height))) + " minutes")) | |
110 | 110 | else { | |
111 | 111 | let idx = value(indexOf(Assets, assetStr)) | |
112 | 112 | let assetPower = assetsPower[idx] | |
113 | 113 | let assetCoins = assetsCost[idx] | |
114 | 114 | let refCall = invoke(Address(treasuryAddress), "Pay", [toString(i.caller), assetCoins], nil) | |
115 | 115 | if ((refCall == refCall)) | |
116 | 116 | then { | |
117 | 117 | let currentPower = nationsTryGetInteger((toString(i.caller) + "_Power")) | |
118 | 118 | let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower + assetPower)], nil) | |
119 | 119 | if ((pw == pw)) | |
120 | 120 | then match pw { | |
121 | 121 | case r: Int => | |
122 | 122 | [IntegerEntry(assetKey, assetCoins), DeleteEntry(BuildingStatusKey), DeleteEntry(finishHeightKey)] | |
123 | 123 | case _ => | |
124 | 124 | throw("Incorrect invoke result") | |
125 | 125 | } | |
126 | 126 | else throw("Strict value is not equal to itself.") | |
127 | 127 | } | |
128 | 128 | else throw("Strict value is not equal to itself.") | |
129 | 129 | } | |
130 | 130 | } | |
131 | 131 | } | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | 136 | @Callable(i) | |
137 | 137 | func transferOwnership (assetId,newOwner,strAssetType) = if (if ((i.caller != adminAddress)) | |
138 | 138 | then (i.caller != this) | |
139 | 139 | else false) | |
140 | 140 | then throw("Only the admin can perform this operation") | |
141 | 141 | else { | |
142 | 142 | let oldOwner = tryGetString((assetId + "_Owner")) | |
143 | 143 | let currentPower = nationsTryGetInteger(oldOwner) | |
144 | 144 | let assetPower = assetsPower[value(indexOf(Assets, strAssetType))] | |
145 | 145 | let pw = invoke(Address(nationsAddress), "setUserPower", [oldOwner, (currentPower - assetPower)], nil) | |
146 | 146 | if ((pw == pw)) | |
147 | 147 | then if ((pw != (currentPower - assetPower))) | |
148 | 148 | then throw("Incorrect invoke result") | |
149 | 149 | else { | |
150 | 150 | let newcurrentPower = nationsTryGetInteger((newOwner + "_Power")) | |
151 | 151 | let pw2 = invoke(Address(nationsAddress), "setUserPower", [newOwner, (currentPower + assetPower)], nil) | |
152 | 152 | if ((pw2 == pw2)) | |
153 | 153 | then match pw2 { | |
154 | 154 | case r: Int => | |
155 | 155 | [StringEntry((assetId + "_Owner"), newOwner)] | |
156 | 156 | case _ => | |
157 | 157 | throw("Incorrect invoke result") | |
158 | 158 | } | |
159 | 159 | else throw("Strict value is not equal to itself.") | |
160 | 160 | } | |
161 | 161 | else throw("Strict value is not equal to itself.") | |
162 | 162 | } | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | ||
166 | 166 | @Callable(i) | |
167 | 167 | func destroyAssetAndTransfer (assetId,toAddress,strAssetType) = if (if ((i.caller != adminAddress)) | |
168 | 168 | then (i.caller != this) | |
169 | 169 | else false) | |
170 | 170 | then throw("Only the admin can perform this operation") | |
171 | 171 | else { | |
172 | 172 | let oldOwner = tryGetString((assetId + "_Owner")) | |
173 | 173 | let assetCoins = tryGetInteger(assetId) | |
174 | 174 | let refCall = invoke(Address(treasuryAddress), "transferCoins", [oldOwner, toAddress, assetCoins], nil) | |
175 | 175 | if ((refCall == refCall)) | |
176 | 176 | then { | |
177 | 177 | let currentPower = nationsTryGetInteger((oldOwner + "_Power")) | |
178 | 178 | let assetPower = assetsPower[value(indexOf(Assets, strAssetType))] | |
179 | 179 | let pw = invoke(Address(nationsAddress), "setUserPower", [toString(i.caller), (currentPower - assetPower)], nil) | |
180 | 180 | if ((pw == pw)) | |
181 | 181 | then match pw { | |
182 | 182 | case r: Int => | |
183 | 183 | [DeleteEntry(assetId)] | |
184 | 184 | case _ => | |
185 | 185 | throw("Incorrect invoke result") | |
186 | 186 | } | |
187 | 187 | else throw("Strict value is not equal to itself.") | |
188 | 188 | } | |
189 | 189 | else throw("Strict value is not equal to itself.") | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 |
github/deemru/w8io/169f3d6 41.95 ms ◑