tx · tXhDBS2mq3Yrg39TJBvb3aJ12cS8HL8zrvyGe6f5j9v 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh: -0.01300000 Waves 2023.06.01 12:22 [2603411] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves
{ "type": 13, "id": "tXhDBS2mq3Yrg39TJBvb3aJ12cS8HL8zrvyGe6f5j9v", "fee": 1300000, "feeAssetId": null, "timestamp": 1685611380735, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "2rCc9FGksjQkPa6rDzTDHhpLSNno4eTUi1gQpXv4DN8Ky52ZAkrZFmhC8WyWzvXuEf2CJKv7vRxWqupFtHbSsEqp" ], "script": "base64:BgLiDwgCEgkKBwgICBgBCAESABIICgYICAgICAgSAwoBGBIAEgQKAggIIhBjb250cmFjdEZpbGVuYW1lIgNTRVAiDHdhdmVzQXNzZXRJZCIRaW52YWxpZFByaWNlQXNzZXQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiB3Rocm93UEQiFHRocm93Q3JlYXRlTm90Q2FsbGVkIhF0aHJvd1lvdU5vdElzc3VlciIPdGhyb3dQb29sRXhpc3RzIhV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQiFnRocm93SW52YWxpZFByaWNlQXNzZXQiFHRocm93SW52YWxpZEZlZUFzc2V0Ihd0aHJvd0ludmFsaWRBbW91bnRBc3NldCISdGhyb3dJbnZhbGlkU3RhdHVzIh90aHJvd0NhbkFjdGl2YXRlT25seVBlbmRpbmdQb29sIh10aHJvd0ZhY3RvcnlSZXR1cm5lZE5vdFN0cmluZyIcdGhyb3dJbnZhbGlkUHJpY2VBc3NldEFtb3VudCIPdGhyb3dJbnZhbGlkRmVlIhV0aHJvd0ludmFsaWRBc3NldFBhaXIiE2tleU1hbmFnZ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CBlN0cmluZwQBWAUBVwUBWAUEdW5pdAkAlAoCBQNuaWwFAmF5AQJicwECYnQABAJidQQBVwkBAmFqAAMJAAECBQFXAgpCeXRlVmVjdG9yBAJhbgUBVwUCYW4DCQABAgUBVwIEVW5pdAgFAmJzD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJicwlib2R5Qnl0ZXMJAJEDAggFAmJzBnByb29mcwAABQJidXjfgew=", "height": 2603411, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7pjDAjxCiUJpaW7vJrDnBfidGpLzYh8A3HC724Vdbr16 Next: 3zZBoKB3ZPLeymHNKRHJ6i6TdMVk3Smeze4s29zRZ2fh 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) | |
225 | 218 | func validStatus (status) = containsElement(statuses, status) | |
226 | 219 | ||
227 | 220 | ||
228 | - | func _create (i,poolType) = { | |
221 | + | @Callable(i) | |
222 | + | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
223 | + | let checkCaller = mustManager(i) | |
224 | + | if ((checkCaller == checkCaller)) | |
225 | + | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
226 | + | else throw("Strict value is not equal to itself.") | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(i) | |
232 | + | func create () = { | |
229 | 233 | let amountAssetPayment = value(i.payments[0]) | |
230 | 234 | let priceAssetPayment = value(i.payments[1]) | |
231 | 235 | let feeAssetPayment = value(i.payments[2]) | |
232 | - | let $ | |
233 | - | let amountAssetId = $ | |
234 | - | let amountAssetInfo = $ | |
235 | - | let $ | |
236 | - | let priceAssetId = $ | |
237 | - | let priceAssetInfo = $ | |
238 | - | let $ | |
239 | - | let feeAssetId = $ | |
240 | - | let feeAssetInfo = $ | |
236 | + | let $t075407612 = getIdAndInfo(amountAssetPayment) | |
237 | + | let amountAssetId = $t075407612._1 | |
238 | + | let amountAssetInfo = $t075407612._2 | |
239 | + | let $t076157684 = getIdAndInfo(priceAssetPayment) | |
240 | + | let priceAssetId = $t076157684._1 | |
241 | + | let priceAssetInfo = $t076157684._2 | |
242 | + | let $t076877750 = getIdAndInfo(feeAssetPayment) | |
243 | + | let feeAssetId = $t076877750._1 | |
244 | + | let feeAssetInfo = $t076877750._2 | |
241 | 245 | let amountAssetAmount = amountAssetPayment.amount | |
242 | 246 | let priceAssetAmount = priceAssetPayment.amount | |
243 | 247 | let feeAssetAmount = feeAssetPayment.amount | |
271 | 275 | then true | |
272 | 276 | else throwPoolExists(), if ((amountAssetId != priceAssetId)) | |
273 | 277 | then true | |
274 | - | else throwInvalidAssetPair(), if (if (isManager(i)) | |
275 | - | then true | |
276 | - | else if (isVerified(amountAssetId)) | |
277 | - | then isVerified(priceAssetId) | |
278 | - | else false) | |
278 | + | else throwInvalidAssetPair(), if (if (isVerified(amountAssetId)) | |
279 | + | then isVerified(priceAssetId) | |
280 | + | else false) | |
279 | 281 | then true | |
280 | 282 | else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId)) | |
281 | 283 | then true | |
305 | 307 | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)]) | |
306 | 308 | else unit | |
307 | 309 | if ((burnEmissionInv == burnEmissionInv)) | |
308 | - | 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) | |
310 | + | 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)] | |
309 | 311 | else throw("Strict value is not equal to itself.") | |
310 | 312 | } | |
311 | - | else throw("Strict value is not equal to itself.") | |
312 | - | } | |
313 | - | ||
314 | - | ||
315 | - | @Callable(i) | |
316 | - | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
317 | - | let checkCaller = mustManager(i) | |
318 | - | if ((checkCaller == checkCaller)) | |
319 | - | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
320 | - | else throw("Strict value is not equal to itself.") | |
321 | - | } | |
322 | - | ||
323 | - | ||
324 | - | ||
325 | - | @Callable(i) | |
326 | - | func create () = _create(i, VLTPOOL) | |
327 | - | ||
328 | - | ||
329 | - | ||
330 | - | @Callable(i) | |
331 | - | func createStable () = { | |
332 | - | let checkCaller = mustManager(i) | |
333 | - | if ((checkCaller == checkCaller)) | |
334 | - | then _create(i, STBLPOOL) | |
335 | 313 | else throw("Strict value is not equal to itself.") | |
336 | 314 | } | |
337 | 315 | ||
346 | 324 | else throwCanActivateOnlyPendingPool()] | |
347 | 325 | if ((checks == checks)) | |
348 | 326 | then { | |
349 | - | let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId)) | |
350 | - | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit)) | |
351 | - | then "VLTPOOL" | |
352 | - | else value(poolTypeOption), logo], nil) | |
327 | + | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
353 | 328 | if ((activateNewPoolInv == activateNewPoolInv)) | |
354 | 329 | then { | |
355 | 330 | 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 keyManagerVaultAddress () = "%s__managerVaultAddress" | |
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 getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
135 | 128 | case s: String => | |
136 | 129 | addressFromStringValue(s) | |
137 | 130 | case _ => | |
138 | 131 | this | |
139 | 132 | } | |
140 | 133 | ||
141 | 134 | ||
142 | 135 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
143 | 136 | ||
144 | 137 | ||
145 | 138 | func stringOptionToList (stringOrUnit) = match stringOrUnit { | |
146 | 139 | case s: String => | |
147 | 140 | if ((size(s) == 0)) | |
148 | 141 | then nil | |
149 | 142 | else split(s, SEP) | |
150 | 143 | case _: Unit => | |
151 | 144 | nil | |
152 | 145 | case _ => | |
153 | 146 | throw("Match error") | |
154 | 147 | } | |
155 | 148 | ||
156 | 149 | ||
157 | 150 | let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract())) | |
158 | 151 | ||
159 | 152 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
160 | 153 | ||
161 | 154 | let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required"))) | |
162 | 155 | ||
163 | 156 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP) | |
164 | 157 | ||
165 | 158 | let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required"))) | |
166 | 159 | ||
167 | 160 | func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false) | |
168 | 161 | ||
169 | 162 | ||
170 | 163 | func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId)) | |
171 | 164 | then true | |
172 | 165 | else throwCreateNotCalled() | |
173 | 166 | ||
174 | 167 | ||
175 | 168 | func managerPublicKeyOrUnit () = { | |
176 | 169 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
177 | 170 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
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 | ||
188 | 181 | func isManager (i) = match managerPublicKeyOrUnit() { | |
189 | 182 | case pk: ByteVector => | |
190 | 183 | (i.callerPublicKey == pk) | |
191 | 184 | case _: Unit => | |
192 | 185 | (i.caller == this) | |
193 | 186 | case _ => | |
194 | 187 | throw("Match error") | |
195 | 188 | } | |
196 | 189 | ||
197 | 190 | ||
198 | 191 | func mustManager (i) = if (isManager(i)) | |
199 | 192 | then true | |
200 | 193 | else throwPD() | |
201 | 194 | ||
202 | 195 | ||
203 | 196 | func mustAdmin (i) = { | |
204 | 197 | let adminPKs = stringOptionToList(getString(keyAdminPubKeys())) | |
205 | 198 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
206 | 199 | then true | |
207 | 200 | else mustManager(i) | |
208 | 201 | } | |
209 | 202 | ||
210 | 203 | ||
211 | 204 | func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2) | |
212 | 205 | ||
213 | 206 | ||
214 | 207 | func getIdAndInfo (payment) = match payment.assetId { | |
215 | 208 | case id: ByteVector => | |
216 | 209 | let info = value(assetInfo(id)) | |
217 | 210 | $Tuple2(toBase58String(id), info) | |
218 | 211 | case _: Unit => | |
219 | 212 | $Tuple2(wavesAssetId, unit) | |
220 | 213 | case _ => | |
221 | 214 | throw("Match error") | |
222 | 215 | } | |
223 | 216 | ||
224 | 217 | ||
225 | 218 | func validStatus (status) = containsElement(statuses, status) | |
226 | 219 | ||
227 | 220 | ||
228 | - | func _create (i,poolType) = { | |
221 | + | @Callable(i) | |
222 | + | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
223 | + | let checkCaller = mustManager(i) | |
224 | + | if ((checkCaller == checkCaller)) | |
225 | + | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
226 | + | else throw("Strict value is not equal to itself.") | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(i) | |
232 | + | func create () = { | |
229 | 233 | let amountAssetPayment = value(i.payments[0]) | |
230 | 234 | let priceAssetPayment = value(i.payments[1]) | |
231 | 235 | let feeAssetPayment = value(i.payments[2]) | |
232 | - | let $ | |
233 | - | let amountAssetId = $ | |
234 | - | let amountAssetInfo = $ | |
235 | - | let $ | |
236 | - | let priceAssetId = $ | |
237 | - | let priceAssetInfo = $ | |
238 | - | let $ | |
239 | - | let feeAssetId = $ | |
240 | - | let feeAssetInfo = $ | |
236 | + | let $t075407612 = getIdAndInfo(amountAssetPayment) | |
237 | + | let amountAssetId = $t075407612._1 | |
238 | + | let amountAssetInfo = $t075407612._2 | |
239 | + | let $t076157684 = getIdAndInfo(priceAssetPayment) | |
240 | + | let priceAssetId = $t076157684._1 | |
241 | + | let priceAssetInfo = $t076157684._2 | |
242 | + | let $t076877750 = getIdAndInfo(feeAssetPayment) | |
243 | + | let feeAssetId = $t076877750._1 | |
244 | + | let feeAssetInfo = $t076877750._2 | |
241 | 245 | let amountAssetAmount = amountAssetPayment.amount | |
242 | 246 | let priceAssetAmount = priceAssetPayment.amount | |
243 | 247 | let feeAssetAmount = feeAssetPayment.amount | |
244 | 248 | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
245 | 249 | let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount()) | |
246 | 250 | let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount())) | |
247 | 251 | let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId)) | |
248 | 252 | then { | |
249 | 253 | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset) | |
250 | 254 | value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex])) | |
251 | 255 | } | |
252 | 256 | else assetMinAmountDefault | |
253 | 257 | let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId)) | |
254 | 258 | then { | |
255 | 259 | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
256 | 260 | value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex])) | |
257 | 261 | } | |
258 | 262 | else assetMinAmountDefault | |
259 | 263 | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
260 | 264 | let curIndex = (lastIndex + 1) | |
261 | 265 | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
262 | 266 | let poolExists = { | |
263 | 267 | let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil) | |
264 | 268 | if ($isInstanceOf(@, "Boolean")) | |
265 | 269 | then @ | |
266 | 270 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
267 | 271 | } | |
268 | 272 | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
269 | 273 | then true | |
270 | 274 | else throwPoolExists(), if (!(poolExists)) | |
271 | 275 | then true | |
272 | 276 | else throwPoolExists(), if ((amountAssetId != priceAssetId)) | |
273 | 277 | then true | |
274 | - | else throwInvalidAssetPair(), if (if (isManager(i)) | |
275 | - | then true | |
276 | - | else if (isVerified(amountAssetId)) | |
277 | - | then isVerified(priceAssetId) | |
278 | - | else false) | |
278 | + | else throwInvalidAssetPair(), if (if (isVerified(amountAssetId)) | |
279 | + | then isVerified(priceAssetId) | |
280 | + | else false) | |
279 | 281 | then true | |
280 | 282 | else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId)) | |
281 | 283 | then true | |
282 | 284 | else containsElement(priceAssetsList, priceAssetId)) | |
283 | 285 | then true | |
284 | 286 | else throwInvalidAssetPair(), if (if (isManager(i)) | |
285 | 287 | then true | |
286 | 288 | else (getString(keyFeeAssetId()) == feeAssetId)) | |
287 | 289 | then true | |
288 | 290 | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
289 | 291 | then true | |
290 | 292 | else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
291 | 293 | then true | |
292 | 294 | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
293 | 295 | then true | |
294 | 296 | else (priceAssetAmount >= priceAssetMinAmount)) | |
295 | 297 | then true | |
296 | 298 | else throwInvalidPriceAssetAmount(), if (if (isManager(i)) | |
297 | 299 | then true | |
298 | 300 | else (feeAssetAmount == getInteger(keyFeeAmount()))) | |
299 | 301 | then true | |
300 | 302 | else throwInvalidFee()] | |
301 | 303 | if ((checks == checks)) | |
302 | 304 | then { | |
303 | 305 | let paymentsWithFeeSize = 3 | |
304 | 306 | let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize)) | |
305 | 307 | then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)]) | |
306 | 308 | else unit | |
307 | 309 | if ((burnEmissionInv == burnEmissionInv)) | |
308 | - | 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) | |
310 | + | 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)] | |
309 | 311 | else throw("Strict value is not equal to itself.") | |
310 | 312 | } | |
311 | - | else throw("Strict value is not equal to itself.") | |
312 | - | } | |
313 | - | ||
314 | - | ||
315 | - | @Callable(i) | |
316 | - | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
317 | - | let checkCaller = mustManager(i) | |
318 | - | if ((checkCaller == checkCaller)) | |
319 | - | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
320 | - | else throw("Strict value is not equal to itself.") | |
321 | - | } | |
322 | - | ||
323 | - | ||
324 | - | ||
325 | - | @Callable(i) | |
326 | - | func create () = _create(i, VLTPOOL) | |
327 | - | ||
328 | - | ||
329 | - | ||
330 | - | @Callable(i) | |
331 | - | func createStable () = { | |
332 | - | let checkCaller = mustManager(i) | |
333 | - | if ((checkCaller == checkCaller)) | |
334 | - | then _create(i, STBLPOOL) | |
335 | 313 | else throw("Strict value is not equal to itself.") | |
336 | 314 | } | |
337 | 315 | ||
338 | 316 | ||
339 | 317 | ||
340 | 318 | @Callable(i) | |
341 | 319 | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
342 | 320 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
343 | 321 | then true | |
344 | 322 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
345 | 323 | then true | |
346 | 324 | else throwCanActivateOnlyPendingPool()] | |
347 | 325 | if ((checks == checks)) | |
348 | 326 | then { | |
349 | - | let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId)) | |
350 | - | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit)) | |
351 | - | then "VLTPOOL" | |
352 | - | else value(poolTypeOption), logo], nil) | |
327 | + | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
353 | 328 | if ((activateNewPoolInv == activateNewPoolInv)) | |
354 | 329 | then { | |
355 | 330 | let lpAssetId = match activateNewPoolInv { | |
356 | 331 | case id: String => | |
357 | 332 | id | |
358 | 333 | case _ => | |
359 | 334 | throwFactoryReturnedNotString() | |
360 | 335 | } | |
361 | 336 | if ((lpAssetId == lpAssetId)) | |
362 | 337 | then { | |
363 | 338 | let beforePut = assetBalance(this, fromBase58String(lpAssetId)) | |
364 | 339 | if ((beforePut == beforePut)) | |
365 | 340 | then { | |
366 | 341 | let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES")) | |
367 | 342 | then unit | |
368 | 343 | else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES")) | |
369 | 344 | then unit | |
370 | 345 | else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))]) | |
371 | 346 | if ((put == put)) | |
372 | 347 | then { | |
373 | 348 | let afterPut = assetBalance(this, fromBase58String(lpAssetId)) | |
374 | 349 | if ((afterPut == afterPut)) | |
375 | 350 | then { | |
376 | 351 | let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId))))) | |
377 | 352 | let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil) | |
378 | 353 | if ((res == res)) | |
379 | 354 | then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
380 | 355 | else throw("Strict value is not equal to itself.") | |
381 | 356 | } | |
382 | 357 | else throw("Strict value is not equal to itself.") | |
383 | 358 | } | |
384 | 359 | else throw("Strict value is not equal to itself.") | |
385 | 360 | } | |
386 | 361 | else throw("Strict value is not equal to itself.") | |
387 | 362 | } | |
388 | 363 | else throw("Strict value is not equal to itself.") | |
389 | 364 | } | |
390 | 365 | else throw("Strict value is not equal to itself.") | |
391 | 366 | } | |
392 | 367 | else throw("Strict value is not equal to itself.") | |
393 | 368 | } | |
394 | 369 | ||
395 | 370 | ||
396 | 371 | ||
397 | 372 | @Callable(i) | |
398 | 373 | func setAdmins (adminPubKeys) = { | |
399 | 374 | let checkCaller = mustManager(i) | |
400 | 375 | if ((checkCaller == checkCaller)) | |
401 | 376 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
402 | 377 | else throw("Strict value is not equal to itself.") | |
403 | 378 | } | |
404 | 379 | ||
405 | 380 | ||
406 | 381 | ||
407 | 382 | @Callable(i) | |
408 | 383 | func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets()))) | |
409 | 384 | ||
410 | 385 | ||
411 | 386 | ||
412 | 387 | @Callable(i) | |
413 | 388 | func statusREADONLY (amountAssetId,priceAssetId) = { | |
414 | 389 | let status = match getString(keyStatus(amountAssetId, priceAssetId)) { | |
415 | 390 | case s: String => | |
416 | 391 | s | |
417 | 392 | case _ => | |
418 | 393 | unit | |
419 | 394 | } | |
420 | 395 | $Tuple2(nil, status) | |
421 | 396 | } | |
422 | 397 | ||
423 | 398 | ||
424 | 399 | @Verifier(tx) | |
425 | 400 | func verify () = { | |
426 | 401 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
427 | 402 | case pk: ByteVector => | |
428 | 403 | pk | |
429 | 404 | case _: Unit => | |
430 | 405 | tx.senderPublicKey | |
431 | 406 | case _ => | |
432 | 407 | throw("Match error") | |
433 | 408 | } | |
434 | 409 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
435 | 410 | } | |
436 | 411 |
github/deemru/w8io/169f3d6 59.83 ms ◑