tx · 26oPx6bESHzC3t4nahpmcnDp1kZVmeCiT4geAvE8CmKU

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01400000 Waves

2022.04.12 13:14 [2005227] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "26oPx6bESHzC3t4nahpmcnDp1kZVmeCiT4geAvE8CmKU", "fee": 1400000, "feeAssetId": null, "timestamp": 1649758450804, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "Jf9yfKvTUQY3KXKZDGJZG8psukKHFr7KWeaZUU9n45ZZwWCxLKEw1TGtS9U7URvLdTRQDoihJcAErAKk1j1mTMs" ], "script": "base64:AAIFAAAAAAAAACsIAhIJCgcICBgYAQgBEgASBQoDCAgIEgcKBQgICAgIEgMKARgSAwoBCBIAAAAALgAAAAADU0VQAgAAAAJfXwAAAAAFRU1QVFkCAAAAAAAAAAARaW52YWxpZFByaWNlQXNzZXQCAAAAE0ludmFsaWQgcHJpY2UgYXNzZXQBAAAAB3Rocm93UEQAAAAACQAAAgAAAAECAAAAEVBlcm1pc3Npb24gZGVuaWVkAQAAABR0aHJvd0NyZWF0ZU5vdENhbGxlZAAAAAAJAAACAAAAAQIAAAAkQ3JlYXRlIGlzIG5vdCBjYWxsZWQgZm9yIGFzc2V0cyBwYWlyAQAAABF0aHJvd1lvdU5vdElzc3VlcgAAAAAJAAACAAAAAQIAAAAeWW91IGFyZSBub3QgYW1vdW50QXNzZXQgaXNzdWVyAQAAAA90aHJvd1Bvb2xFeGlzdHMAAAAACQAAAgAAAAECAAAAJFBvb2wgd2l0aCBzdWNoIGFzc2V0cyBhbHJlYWR5IGV4aXN0cwEAAAAVdGhyb3dBc3NldE5vdFZlcmlmaWVkAAAAAAkAAAIAAAABAgAAABVBc3N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 } View: original | compacted Prev: B6SERzhHhrUgsXhJxMR7EAFRJVwvrLrEyC7JTY43HRqo Next: TrRaCCk58qfzWhc2axGrmkbYVCGByZHbPxjtjoEQaFZ Diff:
OldNewDifferences
2828 func throwInvalidFeeAsset () = throw("Invalid fee asset")
2929
3030
31-func throwAmountAssetZero () = throw("Amount asset attached zero amount")
31+func throwInvalidAmountAsset () = throw("Invalid amount asset attached")
3232
3333
3434 func throwInvalidStatus () = throw("Invalid status")
8888 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
8989
9090
91-func keyPriceAssetsMinPerAmountAsset () = makeString(["%s", "priceAssetsMinPerAmountAsset"], SEP)
91+func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
9292
9393
9494 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
157157 }
158158
159159
160-func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(keyAssetsStoreContract()), (("status_<" + assetId) + ">")), 0) == 2)
160+func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
161161
162162
163163 func getIdAndInfo (payment) = {
171171
172172
173173 @Callable(i)
174-func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,priceAssetsMinPerAmountAsset,feeAssetId,feeAmount) = {
174+func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
175175 let checkCaller = mustManager(i)
176176 if ((checkCaller == checkCaller))
177- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetIds(), makeString(priceAssetIds, SEP)), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), StringEntry(keyPriceAssetsMinPerAmountAsset(), makeString(priceAssetsMinPerAmountAsset, SEP)), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
177+ 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)]
178178 else throw("Strict value is not equal to itself.")
179179 }
180180
185185 let amountAssetPayment = value(i.payments[0])
186186 let priceAssetPayment = value(i.payments[1])
187187 let feeAssetPayment = value(i.payments[2])
188- let $t059616032 = getIdAndInfo(amountAssetPayment)
189- let amountAssetId = $t059616032._1
190- let amountAssetInfo = $t059616032._2
191- let $t060356103 = getIdAndInfo(priceAssetPayment)
192- let priceAssetId = $t060356103._1
193- let priceAssetInfo = $t060356103._2
194- let $t061066168 = getIdAndInfo(feeAssetPayment)
195- let feeAssetId = $t061066168._1
196- let feeAssetInfo = $t061066168._2
188+ let $t059105981 = getIdAndInfo(amountAssetPayment)
189+ let amountAssetId = $t059105981._1
190+ let amountAssetInfo = $t059105981._2
191+ let $t059846052 = getIdAndInfo(priceAssetPayment)
192+ let priceAssetId = $t059846052._1
193+ let priceAssetInfo = $t059846052._2
194+ let $t060556117 = getIdAndInfo(feeAssetPayment)
195+ let feeAssetId = $t060556117._1
196+ let feeAssetInfo = $t060556117._2
197197 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
198198 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
199199 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
204204 then true
205205 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
206206 then true
207- else throwInvalidFeeAsset(), if ((amountAssetPayment.amount > 0))
207+ else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
208208 then true
209- else throwAmountAssetZero(), (priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))), (feeAssetPayment.amount == getInteger(keyFeeAmount()))]
209+ else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))))
210+ then true
211+ else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
212+ then true
213+ else throw()]
210214 if ((checks == checks))
211215 then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), STATUS_PENDING), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
212216 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let invalidPriceAsset = "Invalid price asset"
99
1010 func throwPD () = throw("Permission denied")
1111
1212
1313 func throwCreateNotCalled () = throw("Create is not called for assets pair")
1414
1515
1616 func throwYouNotIssuer () = throw("You are not amountAsset issuer")
1717
1818
1919 func throwPoolExists () = throw("Pool with such assets already exists")
2020
2121
2222 func throwAssetNotVerified () = throw("Asset is not verified")
2323
2424
2525 func throwInvalidPriceAsset () = throw(invalidPriceAsset)
2626
2727
2828 func throwInvalidFeeAsset () = throw("Invalid fee asset")
2929
3030
31-func throwAmountAssetZero () = throw("Amount asset attached zero amount")
31+func throwInvalidAmountAsset () = throw("Invalid amount asset attached")
3232
3333
3434 func throwInvalidStatus () = throw("Invalid status")
3535
3636
3737 func throwCanActivateOnlyPendingPool () = throw("Can activate pool only in 'pending' status")
3838
3939
4040 func throwFactoryReturnedNotString () = throw("FactoryV2 returned not string")
4141
4242
4343 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
4444
4545
4646 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
4747
4848
4949 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
5050
5151
5252 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
5353
5454
5555 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
5656
5757
5858 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
5959
6060
6161 let STATUS_PENDING = "pending"
6262
6363 let STATUS_DECLINED = "declined"
6464
6565 let STATUS_CREATING = "creating"
6666
6767 let STATUS_ACTIVE = "active"
6868
6969 let STATUS_BOT_DISABLED = "bot_disabled"
7070
7171 let STATUSES = [STATUS_PENDING, STATUS_DECLINED, STATUS_CREATING, STATUS_ACTIVE, STATUS_BOT_DISABLED]
7272
7373 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
7474
7575
7676 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
7777
7878
7979 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
8080
8181
8282 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
8383
8484
8585 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
8686
8787
8888 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
8989
9090
91-func keyPriceAssetsMinPerAmountAsset () = makeString(["%s", "priceAssetsMinPerAmountAsset"], SEP)
91+func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
9292
9393
9494 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
9595
9696
9797 func keyPriceAssetIds () = makeString(["%s", "priceAssetIds"], SEP)
9898
9999
100100 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
101101
102102
103103 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
104104
105105 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
106106
107107
108108 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
109109 then true
110110 else throwCreateNotCalled()
111111
112112
113113 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
114114 case s: String =>
115115 fromBase58String(s)
116116 case _: Unit =>
117117 unit
118118 case _ =>
119119 throw("Match error")
120120 }
121121
122122
123123 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
124124 case s: String =>
125125 fromBase58String(s)
126126 case _: Unit =>
127127 unit
128128 case _ =>
129129 throw("Match error")
130130 }
131131
132132
133133 func mustManager (i) = match managerPublicKeyOrUnit() {
134134 case pk: ByteVector =>
135135 if ((i.callerPublicKey == pk))
136136 then true
137137 else throwPD()
138138 case _: Unit =>
139139 if ((i.caller == this))
140140 then true
141141 else throwPD()
142142 case _ =>
143143 throw("Match error")
144144 }
145145
146146
147147 func mustAdmin (i) = {
148148 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
149149 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
150150 then true
151151 else {
152152 let isManager = mustManager(i)
153153 if ((isManager == isManager))
154154 then true
155155 else throw("Strict value is not equal to itself.")
156156 }
157157 }
158158
159159
160-func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(keyAssetsStoreContract()), (("status_<" + assetId) + ">")), 0) == 2)
160+func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
161161
162162
163163 func getIdAndInfo (payment) = {
164164 let id = value(payment.assetId)
165165 let info = value(assetInfo(id))
166166 $Tuple2(toBase58String(id), info)
167167 }
168168
169169
170170 func validStatus (status) = containsElement(STATUSES, status)
171171
172172
173173 @Callable(i)
174-func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,priceAssetsMinPerAmountAsset,feeAssetId,feeAmount) = {
174+func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
175175 let checkCaller = mustManager(i)
176176 if ((checkCaller == checkCaller))
177- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetIds(), makeString(priceAssetIds, SEP)), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), StringEntry(keyPriceAssetsMinPerAmountAsset(), makeString(priceAssetsMinPerAmountAsset, SEP)), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
177+ 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)]
178178 else throw("Strict value is not equal to itself.")
179179 }
180180
181181
182182
183183 @Callable(i)
184184 func create () = {
185185 let amountAssetPayment = value(i.payments[0])
186186 let priceAssetPayment = value(i.payments[1])
187187 let feeAssetPayment = value(i.payments[2])
188- let $t059616032 = getIdAndInfo(amountAssetPayment)
189- let amountAssetId = $t059616032._1
190- let amountAssetInfo = $t059616032._2
191- let $t060356103 = getIdAndInfo(priceAssetPayment)
192- let priceAssetId = $t060356103._1
193- let priceAssetInfo = $t060356103._2
194- let $t061066168 = getIdAndInfo(feeAssetPayment)
195- let feeAssetId = $t061066168._1
196- let feeAssetInfo = $t061066168._2
188+ let $t059105981 = getIdAndInfo(amountAssetPayment)
189+ let amountAssetId = $t059105981._1
190+ let amountAssetInfo = $t059105981._2
191+ let $t059846052 = getIdAndInfo(priceAssetPayment)
192+ let priceAssetId = $t059846052._1
193+ let priceAssetInfo = $t059846052._2
194+ let $t060556117 = getIdAndInfo(feeAssetPayment)
195+ let feeAssetId = $t060556117._1
196+ let feeAssetInfo = $t060556117._2
197197 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
198198 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
199199 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
200200 then true
201201 else throwPoolExists(), if ((amountAssetInfo.issuer == i.caller))
202202 then true
203203 else throwYouNotIssuer(), if (isVerified(amountAssetId))
204204 then true
205205 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
206206 then true
207- else throwInvalidFeeAsset(), if ((amountAssetPayment.amount > 0))
207+ else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
208208 then true
209- else throwAmountAssetZero(), (priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))), (feeAssetPayment.amount == getInteger(keyFeeAmount()))]
209+ else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))))
210+ then true
211+ else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
212+ then true
213+ else throw()]
210214 if ((checks == checks))
211215 then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), STATUS_PENDING), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
212216 else throw("Strict value is not equal to itself.")
213217 }
214218
215219
216220
217221 @Callable(i)
218222 func setStatus (amountAssetId,priceAssetId,newStatus) = {
219223 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
220224 then true
221225 else throwCreateNotCalled(), if (validStatus(newStatus))
222226 then true
223227 else throwInvalidStatus()]
224228 if ((checks == checks))
225229 then [StringEntry(keyStatus(amountAssetId, priceAssetId), newStatus)]
226230 else throw("Strict value is not equal to itself.")
227231 }
228232
229233
230234
231235 @Callable(i)
232236 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker) = {
233237 let checks = [mustManager(i), if (isCreateCalled(amountAssetId, priceAssetId))
234238 then true
235239 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == STATUS_PENDING))
236240 then true
237241 else throwCanActivateOnlyPendingPool()]
238242 if ((checks == checks))
239243 then {
240244 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((("WX " + amountAssetTicker) + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL"], nil)
241245 if ((activateNewPoolInv == activateNewPoolInv))
242246 then {
243247 let lpAssetId = match activateNewPoolInv {
244248 case id: String =>
245249 id
246250 case _ =>
247251 throwFactoryReturnedNotString()
248252 }
249253 if ((lpAssetId == lpAssetId))
250254 then {
251255 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
252256 if ((beforePut == beforePut))
253257 then {
254258 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
255259 if ((put == put))
256260 then {
257261 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
258262 if ((afterPut == afterPut))
259263 then {
260264 let user = value(assetInfo(fromBase58String(amountAssetId))).issuer
261265 [StringEntry(keyStatus(amountAssetId, priceAssetId), STATUS_CREATING), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
262266 }
263267 else throw("Strict value is not equal to itself.")
264268 }
265269 else throw("Strict value is not equal to itself.")
266270 }
267271 else throw("Strict value is not equal to itself.")
268272 }
269273 else throw("Strict value is not equal to itself.")
270274 }
271275 else throw("Strict value is not equal to itself.")
272276 }
273277 else throw("Strict value is not equal to itself.")
274278 }
275279
276280
277281
278282 @Callable(i)
279283 func setAdmins (adminPubKeys) = {
280284 let checkCaller = mustManager(i)
281285 if ((checkCaller == checkCaller))
282286 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
283287 else throw("Strict value is not equal to itself.")
284288 }
285289
286290
287291
288292 @Callable(i)
289293 func setManager (pendingManagerPublicKey) = {
290294 let checkCaller = mustManager(i)
291295 if ((checkCaller == checkCaller))
292296 then {
293297 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
294298 if ((checkManagerPublicKey == checkManagerPublicKey))
295299 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
296300 else throw("Strict value is not equal to itself.")
297301 }
298302 else throw("Strict value is not equal to itself.")
299303 }
300304
301305
302306
303307 @Callable(i)
304308 func confirmManager () = {
305309 let pm = pendingManagerPublicKeyOrUnit()
306310 let hasPM = if (isDefined(pm))
307311 then true
308312 else throw("No pending manager")
309313 if ((hasPM == hasPM))
310314 then {
311315 let checkPM = if ((i.callerPublicKey == value(pm)))
312316 then true
313317 else throw("You are not pending manager")
314318 if ((checkPM == checkPM))
315319 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
316320 else throw("Strict value is not equal to itself.")
317321 }
318322 else throw("Strict value is not equal to itself.")
319323 }
320324
321325
322326 @Verifier(tx)
323327 func verify () = {
324328 let targetPublicKey = match managerPublicKeyOrUnit() {
325329 case pk: ByteVector =>
326330 pk
327331 case _: Unit =>
328332 tx.senderPublicKey
329333 case _ =>
330334 throw("Match error")
331335 }
332336 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
333337 }
334338

github/deemru/w8io/026f985 
60.17 ms