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