tx · EJLspSb7yyEbxUC9rjtAW6t767SsgtqZUCxaEKhJrV3e 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh: -0.01400000 Waves 2023.05.05 11:41 [2564285] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves
{ "type": 13, "id": "EJLspSb7yyEbxUC9rjtAW6t767SsgtqZUCxaEKhJrV3e", "fee": 1400000, "feeAssetId": null, "timestamp": 1683276074102, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "5kA218dCjB5Y2dLhFZTCxSv7JU3cVCjX4XmxGz2fjoQoeR5z2TkCB5ocSLx12DGaijMwQ4rYurm124cNQfuzFsDB" ], "script": "base64:BgKJEAgCEgkKBwgICBgBCAESABIICgYICAgICAgSAwoBGBIDCgEIEgASABIECgIICCIQY29udHJhY3RGaWxlbmFtZSIDU0VQIgx3YXZlc0Fzc2V0SWQiEWludmFsaWRQcmljZUFzc2V0Igd3cmFwRXJyIgNtc2ciCHRocm93RXJyIgd0aHJvd1BEIhR0aHJvd0NyZWF0ZU5vdENhbGxlZCIRdGhyb3dZb3VOb3RJc3N1ZXIiD3Rocm93UG9vbEV4aXN0cyIVdGhyb3dBc3NldE5vdFZlcmlmaWVkIhZ0aHJvd0ludmFsaWRQcmljZUFzc2V0IhR0aHJvd0ludmFsaWRGZWVBc3NldCIXdGhyb3dJbnZhbGlkQW1vdW50QXNzZXQiEnRocm93SW52YWxpZFN0YXR1cyIfdGhyb3dDYW5BY3RpdmF0ZU9ubHlQZW5kaW5nUG9vbCIddGhyb3dGYWN0b3J5UmV0dXJuZWROb3RTdHJpbmciHHRocm93SW52YWxpZFByaWNlQXNzZXRBbW91bnQiD3Rocm93SW52YWxpZEZlZSIVdGhyb3dJbnZhbGlkQXNzZXRQYWlyIhNrZXlNY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AQCYnQDCQEJaXNEZWZpbmVkAQUCYnMGCQACAQISTm8gcGVuZGluZyBtYW5hZ2VyAwkAAAIFAmJ0BQJidAQCYnUDCQAAAggFAmFsD2NhbGxlclB1YmxpY0tleQkBBXZhbHVlAQUCYnMGCQACAQIbWW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAIFAmJ1BQJidQkAzAgCCQELU3RyaW5nRW50cnkCCQEBdgAJANgEAQkBBXZhbHVlAQUCYnMJAMwIAgkBC0RlbGV0ZUVudHJ5AQkBAXcABQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4CYWwBE3ByaWNlQXNzZXRzUkVBRE9OTFkACQCUCgIFA25pbAkBAVgBCQCiCAEJAQFVAAJhbAEOc3RhdHVzUkVBRE9OTFkCAXoBQQQCYXgEAVoJAKIIAQkBAXkCBQF6BQFBAwkAAQIFAVoCBlN0cmluZwQCYWEFAVoFAmFhBQR1bml0CQCUCgIFA25pbAUCYXgBAmJ2AQJidwAEAmJ4BAFaCQECYWkAAwkAAQIFAVoCCkJ5dGVWZWN0b3IEAmFtBQFaBQJhbQMJAAECBQFaAgRVbml0CAUCYnYPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmJ2CWJvZHlCeXRlcwkAkQMCCAUCYnYGcHJvb2ZzAAAFAmJ4F+bv1g==", "height": 2564285, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5ifMM8dPiZ7dWFGqw4TSnFr2dnkDQrVkRAbNxZVp7YsU Next: 4pAh3mrJUeHMi8nxU6tiKTbUTDVovY6CR5E5STvVv8sc Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let wavesAssetId = "WAVES" | |
9 | - | ||
10 | - | let VLTPOOL = "VLTPOOL" | |
11 | - | ||
12 | - | let STBLPOOL = "STBLPOOL" | |
13 | 9 | ||
14 | 10 | let invalidPriceAsset = "Invalid price asset" | |
15 | 11 | ||
111 | 107 | ||
112 | 108 | ||
113 | 109 | func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP) | |
114 | - | ||
115 | - | ||
116 | - | func keyPoolType (amountAssetId,priceAssetId) = makeString(["%s%s%s", "poolType", amountAssetId, priceAssetId], SEP) | |
117 | 110 | ||
118 | 111 | ||
119 | 112 | func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP) | |
224 | 217 | func validStatus (status) = containsElement(statuses, status) | |
225 | 218 | ||
226 | 219 | ||
227 | - | func _create (i,poolType) = { | |
228 | - | let asset1Payment = value(i.payments[0]) | |
229 | - | let asset2Payment = value(i.payments[1]) | |
230 | - | let feeAssetPayment = value(i.payments[2]) | |
231 | - | let $t064076464 = getIdAndInfo(asset1Payment) | |
232 | - | let asset1Id = $t064076464._1 | |
233 | - | let asset1Info = $t064076464._2 | |
234 | - | let $t064676524 = getIdAndInfo(asset2Payment) | |
235 | - | let asset2Id = $t064676524._1 | |
236 | - | let asset2Info = $t064676524._2 | |
237 | - | let $t065276590 = getIdAndInfo(feeAssetPayment) | |
238 | - | let feeAssetId = $t065276590._1 | |
239 | - | let feeAssetInfo = $t065276590._2 | |
240 | - | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
241 | - | let checkAssetsNotEqual = if ((asset1Id != asset2Id)) | |
242 | - | then true | |
243 | - | else throwInvalidAssetPair() | |
244 | - | if ((checkAssetsNotEqual == checkAssetsNotEqual)) | |
245 | - | then { | |
246 | - | let $t067647225 = if (if (isManager(i)) | |
247 | - | then true | |
248 | - | else if (containsElement(priceAssetsList, asset2Id)) | |
249 | - | then isVerified(asset1Id) | |
250 | - | else false) | |
251 | - | then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount) | |
252 | - | else if (if (containsElement(priceAssetsList, asset1Id)) | |
253 | - | then isVerified(asset2Id) | |
254 | - | else false) | |
255 | - | then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount) | |
256 | - | else throwInvalidAssetPair() | |
257 | - | let amountAssetId = $t067647225._1 | |
258 | - | let amountAssetAmount = $t067647225._2 | |
259 | - | let priceAssetId = $t067647225._3 | |
260 | - | let priceAssetAmount = $t067647225._4 | |
261 | - | let managerPriceAssetMinAmount = 1 | |
262 | - | let priceAssetMinAmount = if (isManager(i)) | |
263 | - | then managerPriceAssetMinAmount | |
264 | - | else { | |
265 | - | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
266 | - | value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex])) | |
267 | - | } | |
268 | - | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
269 | - | let curIndex = (lastIndex + 1) | |
270 | - | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
271 | - | let poolExists = { | |
272 | - | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
273 | - | if ($isInstanceOf(@, "Boolean")) | |
274 | - | then @ | |
275 | - | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
276 | - | } | |
277 | - | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
278 | - | then true | |
279 | - | else throwPoolExists(), if (!(poolExists)) | |
280 | - | then true | |
281 | - | else throwPoolExists(), if (if (isManager(i)) | |
282 | - | then true | |
283 | - | else (getString(keyFeeAssetId()) == feeAssetId)) | |
284 | - | then true | |
285 | - | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
286 | - | then true | |
287 | - | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
288 | - | then true | |
289 | - | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
290 | - | then true | |
291 | - | else (priceAssetAmount >= priceAssetMinAmount)) | |
292 | - | then true | |
293 | - | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
294 | - | then true | |
295 | - | else (feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
296 | - | then true | |
297 | - | else throwInvalidFee()] | |
298 | - | if ((checks == checks)) | |
299 | - | then { | |
300 | - | let paymentsWithFeeSize = 3 | |
301 | - | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
302 | - | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)]) | |
303 | - | else unit | |
304 | - | if ((burnEmissionInv == burnEmissionInv)) | |
305 | - | then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount), StringEntry(keyPoolType(amountAssetId, priceAssetId), poolType)] | |
306 | - | else throw("Strict value is not equal to itself.") | |
307 | - | } | |
308 | - | else throw("Strict value is not equal to itself.") | |
309 | - | } | |
310 | - | else throw("Strict value is not equal to itself.") | |
311 | - | } | |
312 | - | ||
313 | - | ||
314 | 220 | @Callable(i) | |
315 | 221 | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
316 | 222 | let checkCaller = mustManager(i) | |
322 | 228 | ||
323 | 229 | ||
324 | 230 | @Callable(i) | |
325 | - | func create () = _create(i, VLTPOOL) | |
326 | - | ||
327 | - | ||
328 | - | ||
329 | - | @Callable(i) | |
330 | - | func createStable () = { | |
331 | - | let checkCaller = mustManager(i) | |
332 | - | if ((checkCaller == checkCaller)) | |
333 | - | then _create(i, STBLPOOL) | |
231 | + | func create () = { | |
232 | + | let amountAssetPayment = value(i.payments[0]) | |
233 | + | let priceAssetPayment = value(i.payments[1]) | |
234 | + | let feeAssetPayment = value(i.payments[2]) | |
235 | + | let $t074737545 = getIdAndInfo(amountAssetPayment) | |
236 | + | let amountAssetId = $t074737545._1 | |
237 | + | let amountAssetInfo = $t074737545._2 | |
238 | + | let $t075487617 = getIdAndInfo(priceAssetPayment) | |
239 | + | let priceAssetId = $t075487617._1 | |
240 | + | let priceAssetInfo = $t075487617._2 | |
241 | + | let $t076207683 = getIdAndInfo(feeAssetPayment) | |
242 | + | let feeAssetId = $t076207683._1 | |
243 | + | let feeAssetInfo = $t076207683._2 | |
244 | + | let amountAssetAmount = amountAssetPayment.amount | |
245 | + | let priceAssetAmount = priceAssetPayment.amount | |
246 | + | let feeAssetAmount = feeAssetPayment.amount | |
247 | + | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
248 | + | let managerPriceAssetMinAmount = 1 | |
249 | + | let priceAssetMinAmount = if (isManager(i)) | |
250 | + | then managerPriceAssetMinAmount | |
251 | + | else { | |
252 | + | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
253 | + | value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex])) | |
254 | + | } | |
255 | + | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
256 | + | let curIndex = (lastIndex + 1) | |
257 | + | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
258 | + | let poolExists = { | |
259 | + | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
260 | + | if ($isInstanceOf(@, "Boolean")) | |
261 | + | then @ | |
262 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
263 | + | } | |
264 | + | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
265 | + | then true | |
266 | + | else throwPoolExists(), if (!(poolExists)) | |
267 | + | then true | |
268 | + | else throwPoolExists(), if ((amountAssetId != priceAssetId)) | |
269 | + | then true | |
270 | + | else throwInvalidAssetPair(), if (if (isVerified(amountAssetId)) | |
271 | + | then isVerified(priceAssetId) | |
272 | + | else false) | |
273 | + | then true | |
274 | + | else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId)) | |
275 | + | then true | |
276 | + | else containsElement(priceAssetsList, priceAssetId)) | |
277 | + | then true | |
278 | + | else throwInvalidAssetPair(), if (if (isManager(i)) | |
279 | + | then true | |
280 | + | else (getString(keyFeeAssetId()) == feeAssetId)) | |
281 | + | then true | |
282 | + | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
283 | + | then true | |
284 | + | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
285 | + | then true | |
286 | + | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
287 | + | then true | |
288 | + | else (priceAssetAmount >= priceAssetMinAmount)) | |
289 | + | then true | |
290 | + | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
291 | + | then true | |
292 | + | else (feeAssetAmount == getInteger(keyFeeAmount()))) | |
293 | + | then true | |
294 | + | else throwInvalidFee()] | |
295 | + | if ((checks == checks)) | |
296 | + | then { | |
297 | + | let paymentsWithFeeSize = 3 | |
298 | + | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
299 | + | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)]) | |
300 | + | else unit | |
301 | + | if ((burnEmissionInv == burnEmissionInv)) | |
302 | + | then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount)] | |
303 | + | else throw("Strict value is not equal to itself.") | |
304 | + | } | |
334 | 305 | else throw("Strict value is not equal to itself.") | |
335 | 306 | } | |
336 | 307 | ||
345 | 316 | else throwCanActivateOnlyPendingPool()] | |
346 | 317 | if ((checks == checks)) | |
347 | 318 | then { | |
348 | - | let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId)) | |
349 | - | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit)) | |
350 | - | then "VLTPOOL" | |
351 | - | else value(poolTypeOption), logo], nil) | |
319 | + | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
352 | 320 | if ((activateNewPoolInv == activateNewPoolInv)) | |
353 | 321 | then { | |
354 | 322 | let lpAssetId = match activateNewPoolInv { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFilename = "user_pools.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let wavesAssetId = "WAVES" | |
9 | - | ||
10 | - | let VLTPOOL = "VLTPOOL" | |
11 | - | ||
12 | - | let STBLPOOL = "STBLPOOL" | |
13 | 9 | ||
14 | 10 | let invalidPriceAsset = "Invalid price asset" | |
15 | 11 | ||
16 | 12 | func wrapErr (msg) = makeString([contractFilename, ": ", msg], "") | |
17 | 13 | ||
18 | 14 | ||
19 | 15 | func throwErr (msg) = throw(wrapErr(msg)) | |
20 | 16 | ||
21 | 17 | ||
22 | 18 | func throwPD () = throwErr("Permission denied") | |
23 | 19 | ||
24 | 20 | ||
25 | 21 | func throwCreateNotCalled () = throwErr("Create is not called for assets pair") | |
26 | 22 | ||
27 | 23 | ||
28 | 24 | func throwYouNotIssuer () = throwErr("You are not amountAsset issuer") | |
29 | 25 | ||
30 | 26 | ||
31 | 27 | func throwPoolExists () = throwErr("Pool with such assets already exists") | |
32 | 28 | ||
33 | 29 | ||
34 | 30 | func throwAssetNotVerified () = throwErr("Asset is not verified") | |
35 | 31 | ||
36 | 32 | ||
37 | 33 | func throwInvalidPriceAsset () = throwErr(invalidPriceAsset) | |
38 | 34 | ||
39 | 35 | ||
40 | 36 | func throwInvalidFeeAsset () = throwErr("Invalid fee asset") | |
41 | 37 | ||
42 | 38 | ||
43 | 39 | func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached") | |
44 | 40 | ||
45 | 41 | ||
46 | 42 | func throwInvalidStatus () = throwErr("Invalid status") | |
47 | 43 | ||
48 | 44 | ||
49 | 45 | func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status") | |
50 | 46 | ||
51 | 47 | ||
52 | 48 | func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string") | |
53 | 49 | ||
54 | 50 | ||
55 | 51 | func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount") | |
56 | 52 | ||
57 | 53 | ||
58 | 54 | func throwInvalidFee () = throwErr("invalid fee") | |
59 | 55 | ||
60 | 56 | ||
61 | 57 | func throwInvalidAssetPair () = throwErr("invalid asset pair") | |
62 | 58 | ||
63 | 59 | ||
64 | 60 | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
65 | 61 | ||
66 | 62 | ||
67 | 63 | func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP) | |
68 | 64 | ||
69 | 65 | ||
70 | 66 | func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP) | |
71 | 67 | ||
72 | 68 | ||
73 | 69 | func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP) | |
74 | 70 | ||
75 | 71 | ||
76 | 72 | func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP) | |
77 | 73 | ||
78 | 74 | ||
79 | 75 | func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP) | |
80 | 76 | ||
81 | 77 | ||
82 | 78 | func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP) | |
83 | 79 | ||
84 | 80 | ||
85 | 81 | func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP) | |
86 | 82 | ||
87 | 83 | ||
88 | 84 | func keyLastIndex () = makeString(["%s", "lastIndex"], SEP) | |
89 | 85 | ||
90 | 86 | ||
91 | 87 | let indexSuffix = "u" | |
92 | 88 | ||
93 | 89 | let statusPending = "pending" | |
94 | 90 | ||
95 | 91 | let statusDeclined = "declined" | |
96 | 92 | ||
97 | 93 | let statusActive = "active" | |
98 | 94 | ||
99 | 95 | let statuses = [statusPending, statusDeclined, statusActive] | |
100 | 96 | ||
101 | 97 | func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP) | |
102 | 98 | ||
103 | 99 | ||
104 | 100 | func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP) | |
105 | 101 | ||
106 | 102 | ||
107 | 103 | func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP) | |
108 | 104 | ||
109 | 105 | ||
110 | 106 | func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP) | |
111 | 107 | ||
112 | 108 | ||
113 | 109 | func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP) | |
114 | - | ||
115 | - | ||
116 | - | func keyPoolType (amountAssetId,priceAssetId) = makeString(["%s%s%s", "poolType", amountAssetId, priceAssetId], SEP) | |
117 | 110 | ||
118 | 111 | ||
119 | 112 | func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP) | |
120 | 113 | ||
121 | 114 | ||
122 | 115 | func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP) | |
123 | 116 | ||
124 | 117 | ||
125 | 118 | func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP) | |
126 | 119 | ||
127 | 120 | ||
128 | 121 | func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP) | |
129 | 122 | ||
130 | 123 | ||
131 | 124 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
132 | 125 | ||
133 | 126 | ||
134 | 127 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
135 | 128 | ||
136 | 129 | ||
137 | 130 | func stringOptionToList (stringOrUnit) = match stringOrUnit { | |
138 | 131 | case s: String => | |
139 | 132 | if ((size(s) == 0)) | |
140 | 133 | then nil | |
141 | 134 | else split(s, SEP) | |
142 | 135 | case _: Unit => | |
143 | 136 | nil | |
144 | 137 | case _ => | |
145 | 138 | throw("Match error") | |
146 | 139 | } | |
147 | 140 | ||
148 | 141 | ||
149 | 142 | let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract())) | |
150 | 143 | ||
151 | 144 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
152 | 145 | ||
153 | 146 | let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required"))) | |
154 | 147 | ||
155 | 148 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP) | |
156 | 149 | ||
157 | 150 | let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required"))) | |
158 | 151 | ||
159 | 152 | func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false) | |
160 | 153 | ||
161 | 154 | ||
162 | 155 | func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId)) | |
163 | 156 | then true | |
164 | 157 | else throwCreateNotCalled() | |
165 | 158 | ||
166 | 159 | ||
167 | 160 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
168 | 161 | case s: String => | |
169 | 162 | fromBase58String(s) | |
170 | 163 | case _: Unit => | |
171 | 164 | unit | |
172 | 165 | case _ => | |
173 | 166 | throw("Match error") | |
174 | 167 | } | |
175 | 168 | ||
176 | 169 | ||
177 | 170 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
178 | 171 | case s: String => | |
179 | 172 | fromBase58String(s) | |
180 | 173 | case _: Unit => | |
181 | 174 | unit | |
182 | 175 | case _ => | |
183 | 176 | throw("Match error") | |
184 | 177 | } | |
185 | 178 | ||
186 | 179 | ||
187 | 180 | func isManager (i) = match managerPublicKeyOrUnit() { | |
188 | 181 | case pk: ByteVector => | |
189 | 182 | (i.callerPublicKey == pk) | |
190 | 183 | case _: Unit => | |
191 | 184 | (i.caller == this) | |
192 | 185 | case _ => | |
193 | 186 | throw("Match error") | |
194 | 187 | } | |
195 | 188 | ||
196 | 189 | ||
197 | 190 | func mustManager (i) = if (isManager(i)) | |
198 | 191 | then true | |
199 | 192 | else throwPD() | |
200 | 193 | ||
201 | 194 | ||
202 | 195 | func mustAdmin (i) = { | |
203 | 196 | let adminPKs = stringOptionToList(getString(keyAdminPubKeys())) | |
204 | 197 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
205 | 198 | then true | |
206 | 199 | else mustManager(i) | |
207 | 200 | } | |
208 | 201 | ||
209 | 202 | ||
210 | 203 | func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2) | |
211 | 204 | ||
212 | 205 | ||
213 | 206 | func getIdAndInfo (payment) = match payment.assetId { | |
214 | 207 | case id: ByteVector => | |
215 | 208 | let info = value(assetInfo(id)) | |
216 | 209 | $Tuple2(toBase58String(id), info) | |
217 | 210 | case _: Unit => | |
218 | 211 | $Tuple2(wavesAssetId, unit) | |
219 | 212 | case _ => | |
220 | 213 | throw("Match error") | |
221 | 214 | } | |
222 | 215 | ||
223 | 216 | ||
224 | 217 | func validStatus (status) = containsElement(statuses, status) | |
225 | 218 | ||
226 | 219 | ||
227 | - | func _create (i,poolType) = { | |
228 | - | let asset1Payment = value(i.payments[0]) | |
229 | - | let asset2Payment = value(i.payments[1]) | |
230 | - | let feeAssetPayment = value(i.payments[2]) | |
231 | - | let $t064076464 = getIdAndInfo(asset1Payment) | |
232 | - | let asset1Id = $t064076464._1 | |
233 | - | let asset1Info = $t064076464._2 | |
234 | - | let $t064676524 = getIdAndInfo(asset2Payment) | |
235 | - | let asset2Id = $t064676524._1 | |
236 | - | let asset2Info = $t064676524._2 | |
237 | - | let $t065276590 = getIdAndInfo(feeAssetPayment) | |
238 | - | let feeAssetId = $t065276590._1 | |
239 | - | let feeAssetInfo = $t065276590._2 | |
240 | - | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
241 | - | let checkAssetsNotEqual = if ((asset1Id != asset2Id)) | |
242 | - | then true | |
243 | - | else throwInvalidAssetPair() | |
244 | - | if ((checkAssetsNotEqual == checkAssetsNotEqual)) | |
245 | - | then { | |
246 | - | let $t067647225 = if (if (isManager(i)) | |
247 | - | then true | |
248 | - | else if (containsElement(priceAssetsList, asset2Id)) | |
249 | - | then isVerified(asset1Id) | |
250 | - | else false) | |
251 | - | then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount) | |
252 | - | else if (if (containsElement(priceAssetsList, asset1Id)) | |
253 | - | then isVerified(asset2Id) | |
254 | - | else false) | |
255 | - | then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount) | |
256 | - | else throwInvalidAssetPair() | |
257 | - | let amountAssetId = $t067647225._1 | |
258 | - | let amountAssetAmount = $t067647225._2 | |
259 | - | let priceAssetId = $t067647225._3 | |
260 | - | let priceAssetAmount = $t067647225._4 | |
261 | - | let managerPriceAssetMinAmount = 1 | |
262 | - | let priceAssetMinAmount = if (isManager(i)) | |
263 | - | then managerPriceAssetMinAmount | |
264 | - | else { | |
265 | - | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
266 | - | value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex])) | |
267 | - | } | |
268 | - | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
269 | - | let curIndex = (lastIndex + 1) | |
270 | - | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
271 | - | let poolExists = { | |
272 | - | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
273 | - | if ($isInstanceOf(@, "Boolean")) | |
274 | - | then @ | |
275 | - | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
276 | - | } | |
277 | - | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
278 | - | then true | |
279 | - | else throwPoolExists(), if (!(poolExists)) | |
280 | - | then true | |
281 | - | else throwPoolExists(), if (if (isManager(i)) | |
282 | - | then true | |
283 | - | else (getString(keyFeeAssetId()) == feeAssetId)) | |
284 | - | then true | |
285 | - | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
286 | - | then true | |
287 | - | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
288 | - | then true | |
289 | - | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
290 | - | then true | |
291 | - | else (priceAssetAmount >= priceAssetMinAmount)) | |
292 | - | then true | |
293 | - | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
294 | - | then true | |
295 | - | else (feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
296 | - | then true | |
297 | - | else throwInvalidFee()] | |
298 | - | if ((checks == checks)) | |
299 | - | then { | |
300 | - | let paymentsWithFeeSize = 3 | |
301 | - | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
302 | - | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)]) | |
303 | - | else unit | |
304 | - | if ((burnEmissionInv == burnEmissionInv)) | |
305 | - | then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount), StringEntry(keyPoolType(amountAssetId, priceAssetId), poolType)] | |
306 | - | else throw("Strict value is not equal to itself.") | |
307 | - | } | |
308 | - | else throw("Strict value is not equal to itself.") | |
309 | - | } | |
310 | - | else throw("Strict value is not equal to itself.") | |
311 | - | } | |
312 | - | ||
313 | - | ||
314 | 220 | @Callable(i) | |
315 | 221 | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
316 | 222 | let checkCaller = mustManager(i) | |
317 | 223 | if ((checkCaller == checkCaller)) | |
318 | 224 | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
319 | 225 | else throw("Strict value is not equal to itself.") | |
320 | 226 | } | |
321 | 227 | ||
322 | 228 | ||
323 | 229 | ||
324 | 230 | @Callable(i) | |
325 | - | func create () = _create(i, VLTPOOL) | |
326 | - | ||
327 | - | ||
328 | - | ||
329 | - | @Callable(i) | |
330 | - | func createStable () = { | |
331 | - | let checkCaller = mustManager(i) | |
332 | - | if ((checkCaller == checkCaller)) | |
333 | - | then _create(i, STBLPOOL) | |
231 | + | func create () = { | |
232 | + | let amountAssetPayment = value(i.payments[0]) | |
233 | + | let priceAssetPayment = value(i.payments[1]) | |
234 | + | let feeAssetPayment = value(i.payments[2]) | |
235 | + | let $t074737545 = getIdAndInfo(amountAssetPayment) | |
236 | + | let amountAssetId = $t074737545._1 | |
237 | + | let amountAssetInfo = $t074737545._2 | |
238 | + | let $t075487617 = getIdAndInfo(priceAssetPayment) | |
239 | + | let priceAssetId = $t075487617._1 | |
240 | + | let priceAssetInfo = $t075487617._2 | |
241 | + | let $t076207683 = getIdAndInfo(feeAssetPayment) | |
242 | + | let feeAssetId = $t076207683._1 | |
243 | + | let feeAssetInfo = $t076207683._2 | |
244 | + | let amountAssetAmount = amountAssetPayment.amount | |
245 | + | let priceAssetAmount = priceAssetPayment.amount | |
246 | + | let feeAssetAmount = feeAssetPayment.amount | |
247 | + | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
248 | + | let managerPriceAssetMinAmount = 1 | |
249 | + | let priceAssetMinAmount = if (isManager(i)) | |
250 | + | then managerPriceAssetMinAmount | |
251 | + | else { | |
252 | + | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
253 | + | value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex])) | |
254 | + | } | |
255 | + | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
256 | + | let curIndex = (lastIndex + 1) | |
257 | + | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
258 | + | let poolExists = { | |
259 | + | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
260 | + | if ($isInstanceOf(@, "Boolean")) | |
261 | + | then @ | |
262 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
263 | + | } | |
264 | + | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
265 | + | then true | |
266 | + | else throwPoolExists(), if (!(poolExists)) | |
267 | + | then true | |
268 | + | else throwPoolExists(), if ((amountAssetId != priceAssetId)) | |
269 | + | then true | |
270 | + | else throwInvalidAssetPair(), if (if (isVerified(amountAssetId)) | |
271 | + | then isVerified(priceAssetId) | |
272 | + | else false) | |
273 | + | then true | |
274 | + | else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId)) | |
275 | + | then true | |
276 | + | else containsElement(priceAssetsList, priceAssetId)) | |
277 | + | then true | |
278 | + | else throwInvalidAssetPair(), if (if (isManager(i)) | |
279 | + | then true | |
280 | + | else (getString(keyFeeAssetId()) == feeAssetId)) | |
281 | + | then true | |
282 | + | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
283 | + | then true | |
284 | + | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
285 | + | then true | |
286 | + | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
287 | + | then true | |
288 | + | else (priceAssetAmount >= priceAssetMinAmount)) | |
289 | + | then true | |
290 | + | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
291 | + | then true | |
292 | + | else (feeAssetAmount == getInteger(keyFeeAmount()))) | |
293 | + | then true | |
294 | + | else throwInvalidFee()] | |
295 | + | if ((checks == checks)) | |
296 | + | then { | |
297 | + | let paymentsWithFeeSize = 3 | |
298 | + | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
299 | + | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)]) | |
300 | + | else unit | |
301 | + | if ((burnEmissionInv == burnEmissionInv)) | |
302 | + | then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount)] | |
303 | + | else throw("Strict value is not equal to itself.") | |
304 | + | } | |
334 | 305 | else throw("Strict value is not equal to itself.") | |
335 | 306 | } | |
336 | 307 | ||
337 | 308 | ||
338 | 309 | ||
339 | 310 | @Callable(i) | |
340 | 311 | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
341 | 312 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
342 | 313 | then true | |
343 | 314 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
344 | 315 | then true | |
345 | 316 | else throwCanActivateOnlyPendingPool()] | |
346 | 317 | if ((checks == checks)) | |
347 | 318 | then { | |
348 | - | let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId)) | |
349 | - | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit)) | |
350 | - | then "VLTPOOL" | |
351 | - | else value(poolTypeOption), logo], nil) | |
319 | + | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
352 | 320 | if ((activateNewPoolInv == activateNewPoolInv)) | |
353 | 321 | then { | |
354 | 322 | let lpAssetId = match activateNewPoolInv { | |
355 | 323 | case id: String => | |
356 | 324 | id | |
357 | 325 | case _ => | |
358 | 326 | throwFactoryReturnedNotString() | |
359 | 327 | } | |
360 | 328 | if ((lpAssetId == lpAssetId)) | |
361 | 329 | then { | |
362 | 330 | let beforePut = assetBalance(this, fromBase58String(lpAssetId)) | |
363 | 331 | if ((beforePut == beforePut)) | |
364 | 332 | then { | |
365 | 333 | let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES")) | |
366 | 334 | then unit | |
367 | 335 | else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES")) | |
368 | 336 | then unit | |
369 | 337 | else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))]) | |
370 | 338 | if ((put == put)) | |
371 | 339 | then { | |
372 | 340 | let afterPut = assetBalance(this, fromBase58String(lpAssetId)) | |
373 | 341 | if ((afterPut == afterPut)) | |
374 | 342 | then { | |
375 | 343 | let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId))))) | |
376 | 344 | let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil) | |
377 | 345 | if ((res == res)) | |
378 | 346 | then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
379 | 347 | else throw("Strict value is not equal to itself.") | |
380 | 348 | } | |
381 | 349 | else throw("Strict value is not equal to itself.") | |
382 | 350 | } | |
383 | 351 | else throw("Strict value is not equal to itself.") | |
384 | 352 | } | |
385 | 353 | else throw("Strict value is not equal to itself.") | |
386 | 354 | } | |
387 | 355 | else throw("Strict value is not equal to itself.") | |
388 | 356 | } | |
389 | 357 | else throw("Strict value is not equal to itself.") | |
390 | 358 | } | |
391 | 359 | else throw("Strict value is not equal to itself.") | |
392 | 360 | } | |
393 | 361 | ||
394 | 362 | ||
395 | 363 | ||
396 | 364 | @Callable(i) | |
397 | 365 | func setAdmins (adminPubKeys) = { | |
398 | 366 | let checkCaller = mustManager(i) | |
399 | 367 | if ((checkCaller == checkCaller)) | |
400 | 368 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
401 | 369 | else throw("Strict value is not equal to itself.") | |
402 | 370 | } | |
403 | 371 | ||
404 | 372 | ||
405 | 373 | ||
406 | 374 | @Callable(i) | |
407 | 375 | func setManager (pendingManagerPublicKey) = { | |
408 | 376 | let checkCaller = mustManager(i) | |
409 | 377 | if ((checkCaller == checkCaller)) | |
410 | 378 | then { | |
411 | 379 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
412 | 380 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
413 | 381 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
414 | 382 | else throw("Strict value is not equal to itself.") | |
415 | 383 | } | |
416 | 384 | else throw("Strict value is not equal to itself.") | |
417 | 385 | } | |
418 | 386 | ||
419 | 387 | ||
420 | 388 | ||
421 | 389 | @Callable(i) | |
422 | 390 | func confirmManager () = { | |
423 | 391 | let pm = pendingManagerPublicKeyOrUnit() | |
424 | 392 | let hasPM = if (isDefined(pm)) | |
425 | 393 | then true | |
426 | 394 | else throw("No pending manager") | |
427 | 395 | if ((hasPM == hasPM)) | |
428 | 396 | then { | |
429 | 397 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
430 | 398 | then true | |
431 | 399 | else throw("You are not pending manager") | |
432 | 400 | if ((checkPM == checkPM)) | |
433 | 401 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
434 | 402 | else throw("Strict value is not equal to itself.") | |
435 | 403 | } | |
436 | 404 | else throw("Strict value is not equal to itself.") | |
437 | 405 | } | |
438 | 406 | ||
439 | 407 | ||
440 | 408 | ||
441 | 409 | @Callable(i) | |
442 | 410 | func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets()))) | |
443 | 411 | ||
444 | 412 | ||
445 | 413 | ||
446 | 414 | @Callable(i) | |
447 | 415 | func statusREADONLY (amountAssetId,priceAssetId) = { | |
448 | 416 | let status = match getString(keyStatus(amountAssetId, priceAssetId)) { | |
449 | 417 | case s: String => | |
450 | 418 | s | |
451 | 419 | case _ => | |
452 | 420 | unit | |
453 | 421 | } | |
454 | 422 | $Tuple2(nil, status) | |
455 | 423 | } | |
456 | 424 | ||
457 | 425 | ||
458 | 426 | @Verifier(tx) | |
459 | 427 | func verify () = { | |
460 | 428 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
461 | 429 | case pk: ByteVector => | |
462 | 430 | pk | |
463 | 431 | case _: Unit => | |
464 | 432 | tx.senderPublicKey | |
465 | 433 | case _ => | |
466 | 434 | throw("Match error") | |
467 | 435 | } | |
468 | 436 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
469 | 437 | } | |
470 | 438 |
github/deemru/w8io/169f3d6 62.12 ms ◑