tx · 2Fy3EBWKijGFHWFoDvT994B2TS7NtL4hpcbsCzRwmQwq 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh: -0.01400000 Waves 2022.04.13 17:39 [2006932] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves
{ "type": 13, "id": "2Fy3EBWKijGFHWFoDvT994B2TS7NtL4hpcbsCzRwmQwq", "fee": 1400000, "feeAssetId": null, "timestamp": 1649860810710, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "3jxyVvcupTjLxaJwfAHcEUVxQ3eZtw5TJeR66XzENLUGfm4M7UpJzedsbg5uUdqu9qwYs161EyVfpHpk6qEUGerP" ], "script": "base64:AAIFAAAAAAAAAC0IAhIJCgcICBgYAQgBEgASBQoDCAgIEgcKBQgICAgIEgMKARgSAwoBCBIAEgAAAAAsAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAABFpbnZhbGlkUHJpY2VBc3NldAIAAAATSW52YWxpZCBwcmljZSBhc3NldAEAAAAHdGhyb3dQRAAAAAAJAAACAAAAAQIAAAARUGVybWlzc2lvbiBkZW5pZWQBAAAAFHRocm93Q3JlYXRlTm90Q2FsbGVkAAAAAAkAAAIAAAABAgAAACRDcmVhdGUgaXMgbm90IGNhbGxlZCBmb3IgYXNzZXRzIHBhaXIBAAAAEXRocm93WW91Tm90SXNzdWVyAAAAAAkAAAIAAAABAgAAAB5Zb3UgYXJlIG5vdCBhbW91bnRBc3NldCBpc3N1ZXIBAAAAD3Rocm93UG9vbEV4aXN0cwAAAAAJAAACAAAAAQIAAAAkUG9vbCB3aXRoIHN1Y2ggYXNzZXRzIGFscmVhZHkgZXhpc3RzAQAAABV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQAAAAACQAAAgAAAAECAAAAFUFzc2V0I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Jvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXnePam/", "chainId": 84, "height": 2006932, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: TrRaCCk58qfzWhc2axGrmkbYVCGByZHbPxjtjoEQaFZ Next: FD55p2Px3Mzaqc9pBFSfAdpxZYHweBcZWUyETht3CEnh Diff:
Old | New | Differences | |
---|---|---|---|
62 | 62 | ||
63 | 63 | let statusDeclined = "declined" | |
64 | 64 | ||
65 | - | let statusCreating = "creating" | |
66 | - | ||
67 | 65 | let statusActive = "active" | |
68 | 66 | ||
69 | - | let statusBotDisabled = "bot_disabled" | |
70 | - | ||
71 | - | let statuses = [statusPending, statusDeclined, statusCreating, statusActive, statusBotDisabled] | |
67 | + | let statuses = [statusPending, statusDeclined, statusActive] | |
72 | 68 | ||
73 | 69 | func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP) | |
74 | 70 | ||
185 | 181 | let amountAssetPayment = value(i.payments[0]) | |
186 | 182 | let priceAssetPayment = value(i.payments[1]) | |
187 | 183 | let feeAssetPayment = value(i.payments[2]) | |
188 | - | let $ | |
189 | - | let amountAssetId = $ | |
190 | - | let amountAssetInfo = $ | |
191 | - | let $ | |
192 | - | let priceAssetId = $ | |
193 | - | let priceAssetInfo = $ | |
194 | - | let $ | |
195 | - | let feeAssetId = $ | |
196 | - | let feeAssetInfo = $ | |
184 | + | let $t057695840 = getIdAndInfo(amountAssetPayment) | |
185 | + | let amountAssetId = $t057695840._1 | |
186 | + | let amountAssetInfo = $t057695840._2 | |
187 | + | let $t058435911 = getIdAndInfo(priceAssetPayment) | |
188 | + | let priceAssetId = $t058435911._1 | |
189 | + | let priceAssetInfo = $t058435911._2 | |
190 | + | let $t059145976 = getIdAndInfo(feeAssetPayment) | |
191 | + | let feeAssetId = $t059145976._1 | |
192 | + | let feeAssetInfo = $t059145976._2 | |
197 | 193 | let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP) | |
198 | 194 | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
199 | 195 | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
262 | 258 | if ((afterPut == afterPut)) | |
263 | 259 | then { | |
264 | 260 | let user = value(assetInfo(fromBase58String(amountAssetId))).issuer | |
265 | - | [StringEntry(keyStatus(amountAssetId, priceAssetId), | |
261 | + | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
266 | 262 | } | |
267 | 263 | else throw("Strict value is not equal to itself.") | |
268 | 264 | } | |
325 | 321 | ||
326 | 322 | ||
327 | 323 | @Callable(i) | |
328 | - | func priceAssetsREADONLY () = $Tuple2(nil, split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)) | |
324 | + | func priceAssetsREADONLY () = { | |
325 | + | let priceAssetsOrUnit = getString(keyPriceAssetIds()) | |
326 | + | $Tuple2(nil, if ((priceAssetsOrUnit == unit)) | |
327 | + | then nil | |
328 | + | else split(value(priceAssetsOrUnit), SEP)) | |
329 | + | } | |
329 | 330 | ||
330 | 331 | ||
331 | 332 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let EMPTY = "" | |
7 | 7 | ||
8 | 8 | let invalidPriceAsset = "Invalid price asset" | |
9 | 9 | ||
10 | 10 | func throwPD () = throw("Permission denied") | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func throwCreateNotCalled () = throw("Create is not called for assets pair") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func throwYouNotIssuer () = throw("You are not amountAsset issuer") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func throwPoolExists () = throw("Pool with such assets already exists") | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func throwAssetNotVerified () = throw("Asset is not verified") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func throwInvalidPriceAsset () = throw(invalidPriceAsset) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func throwInvalidFeeAsset () = throw("Invalid fee asset") | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func throwInvalidAmountAsset () = throw("Invalid amount asset attached") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func throwInvalidStatus () = throw("Invalid status") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func throwCanActivateOnlyPendingPool () = throw("Can activate pool only in 'pending' status") | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func throwFactoryReturnedNotString () = throw("FactoryV2 returned not string") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | let statusPending = "pending" | |
62 | 62 | ||
63 | 63 | let statusDeclined = "declined" | |
64 | 64 | ||
65 | - | let statusCreating = "creating" | |
66 | - | ||
67 | 65 | let statusActive = "active" | |
68 | 66 | ||
69 | - | let statusBotDisabled = "bot_disabled" | |
70 | - | ||
71 | - | let statuses = [statusPending, statusDeclined, statusCreating, statusActive, statusBotDisabled] | |
67 | + | let statuses = [statusPending, statusDeclined, statusActive] | |
72 | 68 | ||
73 | 69 | func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP) | |
74 | 70 | ||
75 | 71 | ||
76 | 72 | func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP) | |
77 | 73 | ||
78 | 74 | ||
79 | 75 | func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP) | |
80 | 76 | ||
81 | 77 | ||
82 | 78 | func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP) | |
83 | 79 | ||
84 | 80 | ||
85 | 81 | func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP) | |
86 | 82 | ||
87 | 83 | ||
88 | 84 | func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP) | |
89 | 85 | ||
90 | 86 | ||
91 | 87 | func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP) | |
92 | 88 | ||
93 | 89 | ||
94 | 90 | func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP) | |
95 | 91 | ||
96 | 92 | ||
97 | 93 | func keyPriceAssetIds () = makeString(["%s", "priceAssetIds"], SEP) | |
98 | 94 | ||
99 | 95 | ||
100 | 96 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
101 | 97 | ||
102 | 98 | ||
103 | 99 | let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract())) | |
104 | 100 | ||
105 | 101 | func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false) | |
106 | 102 | ||
107 | 103 | ||
108 | 104 | func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId)) | |
109 | 105 | then true | |
110 | 106 | else throwCreateNotCalled() | |
111 | 107 | ||
112 | 108 | ||
113 | 109 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
114 | 110 | case s: String => | |
115 | 111 | fromBase58String(s) | |
116 | 112 | case _: Unit => | |
117 | 113 | unit | |
118 | 114 | case _ => | |
119 | 115 | throw("Match error") | |
120 | 116 | } | |
121 | 117 | ||
122 | 118 | ||
123 | 119 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
124 | 120 | case s: String => | |
125 | 121 | fromBase58String(s) | |
126 | 122 | case _: Unit => | |
127 | 123 | unit | |
128 | 124 | case _ => | |
129 | 125 | throw("Match error") | |
130 | 126 | } | |
131 | 127 | ||
132 | 128 | ||
133 | 129 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
134 | 130 | case pk: ByteVector => | |
135 | 131 | if ((i.callerPublicKey == pk)) | |
136 | 132 | then true | |
137 | 133 | else throwPD() | |
138 | 134 | case _: Unit => | |
139 | 135 | if ((i.caller == this)) | |
140 | 136 | then true | |
141 | 137 | else throwPD() | |
142 | 138 | case _ => | |
143 | 139 | throw("Match error") | |
144 | 140 | } | |
145 | 141 | ||
146 | 142 | ||
147 | 143 | func mustAdmin (i) = { | |
148 | 144 | let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP) | |
149 | 145 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
150 | 146 | then true | |
151 | 147 | else { | |
152 | 148 | let isManager = mustManager(i) | |
153 | 149 | if ((isManager == isManager)) | |
154 | 150 | then true | |
155 | 151 | else throw("Strict value is not equal to itself.") | |
156 | 152 | } | |
157 | 153 | } | |
158 | 154 | ||
159 | 155 | ||
160 | 156 | func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2) | |
161 | 157 | ||
162 | 158 | ||
163 | 159 | func getIdAndInfo (payment) = { | |
164 | 160 | let id = value(payment.assetId) | |
165 | 161 | let info = value(assetInfo(id)) | |
166 | 162 | $Tuple2(toBase58String(id), info) | |
167 | 163 | } | |
168 | 164 | ||
169 | 165 | ||
170 | 166 | func validStatus (status) = containsElement(statuses, status) | |
171 | 167 | ||
172 | 168 | ||
173 | 169 | @Callable(i) | |
174 | 170 | func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
175 | 171 | let checkCaller = mustManager(i) | |
176 | 172 | if ((checkCaller == checkCaller)) | |
177 | 173 | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetIds(), makeString(priceAssetIds, SEP)), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
178 | 174 | else throw("Strict value is not equal to itself.") | |
179 | 175 | } | |
180 | 176 | ||
181 | 177 | ||
182 | 178 | ||
183 | 179 | @Callable(i) | |
184 | 180 | func create () = { | |
185 | 181 | let amountAssetPayment = value(i.payments[0]) | |
186 | 182 | let priceAssetPayment = value(i.payments[1]) | |
187 | 183 | let feeAssetPayment = value(i.payments[2]) | |
188 | - | let $ | |
189 | - | let amountAssetId = $ | |
190 | - | let amountAssetInfo = $ | |
191 | - | let $ | |
192 | - | let priceAssetId = $ | |
193 | - | let priceAssetInfo = $ | |
194 | - | let $ | |
195 | - | let feeAssetId = $ | |
196 | - | let feeAssetInfo = $ | |
184 | + | let $t057695840 = getIdAndInfo(amountAssetPayment) | |
185 | + | let amountAssetId = $t057695840._1 | |
186 | + | let amountAssetInfo = $t057695840._2 | |
187 | + | let $t058435911 = getIdAndInfo(priceAssetPayment) | |
188 | + | let priceAssetId = $t058435911._1 | |
189 | + | let priceAssetInfo = $t058435911._2 | |
190 | + | let $t059145976 = getIdAndInfo(feeAssetPayment) | |
191 | + | let feeAssetId = $t059145976._1 | |
192 | + | let feeAssetInfo = $t059145976._2 | |
197 | 193 | let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP) | |
198 | 194 | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
199 | 195 | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
200 | 196 | then true | |
201 | 197 | else throwPoolExists(), if ((amountAssetInfo.issuer == i.caller)) | |
202 | 198 | then true | |
203 | 199 | else throwYouNotIssuer(), if (isVerified(amountAssetId)) | |
204 | 200 | then true | |
205 | 201 | else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId)) | |
206 | 202 | then true | |
207 | 203 | else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
208 | 204 | then true | |
209 | 205 | else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex])))) | |
210 | 206 | then true | |
211 | 207 | else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
212 | 208 | then true | |
213 | 209 | else throw()] | |
214 | 210 | if ((checks == checks)) | |
215 | 211 | then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)] | |
216 | 212 | else throw("Strict value is not equal to itself.") | |
217 | 213 | } | |
218 | 214 | ||
219 | 215 | ||
220 | 216 | ||
221 | 217 | @Callable(i) | |
222 | 218 | func setStatus (amountAssetId,priceAssetId,newStatus) = { | |
223 | 219 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
224 | 220 | then true | |
225 | 221 | else throwCreateNotCalled(), if (validStatus(newStatus)) | |
226 | 222 | then true | |
227 | 223 | else throwInvalidStatus()] | |
228 | 224 | if ((checks == checks)) | |
229 | 225 | then [StringEntry(keyStatus(amountAssetId, priceAssetId), newStatus)] | |
230 | 226 | else throw("Strict value is not equal to itself.") | |
231 | 227 | } | |
232 | 228 | ||
233 | 229 | ||
234 | 230 | ||
235 | 231 | @Callable(i) | |
236 | 232 | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker) = { | |
237 | 233 | let checks = [mustManager(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
238 | 234 | then true | |
239 | 235 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
240 | 236 | then true | |
241 | 237 | else throwCanActivateOnlyPendingPool()] | |
242 | 238 | if ((checks == checks)) | |
243 | 239 | then { | |
244 | 240 | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((("WX " + amountAssetTicker) + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL"], nil) | |
245 | 241 | if ((activateNewPoolInv == activateNewPoolInv)) | |
246 | 242 | then { | |
247 | 243 | let lpAssetId = match activateNewPoolInv { | |
248 | 244 | case id: String => | |
249 | 245 | id | |
250 | 246 | case _ => | |
251 | 247 | throwFactoryReturnedNotString() | |
252 | 248 | } | |
253 | 249 | if ((lpAssetId == lpAssetId)) | |
254 | 250 | then { | |
255 | 251 | let beforePut = assetBalance(this, fromBase58String(lpAssetId)) | |
256 | 252 | if ((beforePut == beforePut)) | |
257 | 253 | then { | |
258 | 254 | let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))]) | |
259 | 255 | if ((put == put)) | |
260 | 256 | then { | |
261 | 257 | let afterPut = assetBalance(this, fromBase58String(lpAssetId)) | |
262 | 258 | if ((afterPut == afterPut)) | |
263 | 259 | then { | |
264 | 260 | let user = value(assetInfo(fromBase58String(amountAssetId))).issuer | |
265 | - | [StringEntry(keyStatus(amountAssetId, priceAssetId), | |
261 | + | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
266 | 262 | } | |
267 | 263 | else throw("Strict value is not equal to itself.") | |
268 | 264 | } | |
269 | 265 | else throw("Strict value is not equal to itself.") | |
270 | 266 | } | |
271 | 267 | else throw("Strict value is not equal to itself.") | |
272 | 268 | } | |
273 | 269 | else throw("Strict value is not equal to itself.") | |
274 | 270 | } | |
275 | 271 | else throw("Strict value is not equal to itself.") | |
276 | 272 | } | |
277 | 273 | else throw("Strict value is not equal to itself.") | |
278 | 274 | } | |
279 | 275 | ||
280 | 276 | ||
281 | 277 | ||
282 | 278 | @Callable(i) | |
283 | 279 | func setAdmins (adminPubKeys) = { | |
284 | 280 | let checkCaller = mustManager(i) | |
285 | 281 | if ((checkCaller == checkCaller)) | |
286 | 282 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
287 | 283 | else throw("Strict value is not equal to itself.") | |
288 | 284 | } | |
289 | 285 | ||
290 | 286 | ||
291 | 287 | ||
292 | 288 | @Callable(i) | |
293 | 289 | func setManager (pendingManagerPublicKey) = { | |
294 | 290 | let checkCaller = mustManager(i) | |
295 | 291 | if ((checkCaller == checkCaller)) | |
296 | 292 | then { | |
297 | 293 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
298 | 294 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
299 | 295 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
300 | 296 | else throw("Strict value is not equal to itself.") | |
301 | 297 | } | |
302 | 298 | else throw("Strict value is not equal to itself.") | |
303 | 299 | } | |
304 | 300 | ||
305 | 301 | ||
306 | 302 | ||
307 | 303 | @Callable(i) | |
308 | 304 | func confirmManager () = { | |
309 | 305 | let pm = pendingManagerPublicKeyOrUnit() | |
310 | 306 | let hasPM = if (isDefined(pm)) | |
311 | 307 | then true | |
312 | 308 | else throw("No pending manager") | |
313 | 309 | if ((hasPM == hasPM)) | |
314 | 310 | then { | |
315 | 311 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
316 | 312 | then true | |
317 | 313 | else throw("You are not pending manager") | |
318 | 314 | if ((checkPM == checkPM)) | |
319 | 315 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
320 | 316 | else throw("Strict value is not equal to itself.") | |
321 | 317 | } | |
322 | 318 | else throw("Strict value is not equal to itself.") | |
323 | 319 | } | |
324 | 320 | ||
325 | 321 | ||
326 | 322 | ||
327 | 323 | @Callable(i) | |
328 | - | func priceAssetsREADONLY () = $Tuple2(nil, split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)) | |
324 | + | func priceAssetsREADONLY () = { | |
325 | + | let priceAssetsOrUnit = getString(keyPriceAssetIds()) | |
326 | + | $Tuple2(nil, if ((priceAssetsOrUnit == unit)) | |
327 | + | then nil | |
328 | + | else split(value(priceAssetsOrUnit), SEP)) | |
329 | + | } | |
329 | 330 | ||
330 | 331 | ||
331 | 332 | @Verifier(tx) | |
332 | 333 | func verify () = { | |
333 | 334 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
334 | 335 | case pk: ByteVector => | |
335 | 336 | pk | |
336 | 337 | case _: Unit => | |
337 | 338 | tx.senderPublicKey | |
338 | 339 | case _ => | |
339 | 340 | throw("Match error") | |
340 | 341 | } | |
341 | 342 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
342 | 343 | } | |
343 | 344 |
github/deemru/w8io/026f985 50.96 ms ◑