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