tx · Hf4YaRjYCMrET2TH9NNQd74rREezKQy14AvBogayrsr3 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh: -0.01600000 Waves 2023.01.19 15:22 [2411807] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves
{ "type": 13, "id": "Hf4YaRjYCMrET2TH9NNQd74rREezKQy14AvBogayrsr3", "fee": 1600000, "feeAssetId": null, "timestamp": 1674130966785, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "Du6qQvcyvgbLh34yXnrXprMAdfLR2EUeENTQUAeAhUCCmh67kkv5epiKCo5Pc6dCQ2P7JwAW3Xrr9ocnFS68pVF" ], "script": "base64:AAIFAAAAAAAABwEIAhIJCgcICAgYAQgBEgASCAoGCAgICAgIEgMKARgSAwoBCBIAEgASBAoCCAgiA1NFUCIMd2F2ZXNBc3NldElkIhFpbnZhbGlkUHJpY2VBc3NldCIIdGhyb3dFcnIiA21zZyIHdGhyb3dQRCIUdGhyb3dDcmVhdGVOb3RDYWxsZWQiEXRocm93WW91Tm90SXNzdWVyIg90aHJvd1Bvb2xFeGlzdHMiFXRocm93QXNzZXROb3RWZXJpZmllZCIWdGhyb3dJbnZhbGlkUHJpY2VBc3NldCIUdGhyb3dJbnZhbGlkRmVlQXNzZXQiF3Rocm93SW52YWxpZEFtb3VudEFzc2V0IhJ0aHJvd0ludmFsaWRTdGF0dXMiH3Rocm93Q2FuQWN0aXZhdGVPbmx5UGVuZGluZ1Bvb2wiHXRocm93RmFjdG9yeVJldHVybmVkTm90U3RyaW5nIhx0aHJvd0ludmFsaWRQcmljZUFzc2V0QW1vdW50Ig90aHJvd0ludmFsaWRGZWUiE2tleU1hbmFnZXJQdWJsaWNLZXkiGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5Ig9rZXlBZG1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AANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAJhZQEAAAATcHJpY2VBc3NldHNSRUFET05MWQAAAAAJAAUUAAAAAgUAAAADbmlsCQEAAAABVQAAAAEJAAQiAAAAAQkBAAAAAVIAAAAAAAAAAmFlAQAAAA5zdGF0dXNSRUFET05MWQAAAAIAAAABdwAAAAF4BAAAAAJhcQQAAAABVwkABCIAAAABCQEAAAABdgAAAAIFAAAAAXcFAAAAAXgDCQAAAQAAAAIFAAAAAVcCAAAABlN0cmluZwQAAAABWAUAAAABVwUAAAABWAUAAAAEdW5pdAkABRQAAAACBQAAAANuaWwFAAAAAmFxAAAAAQAAAAJiaAEAAAACYmkAAAAABAAAAAJiagQAAAABVwkBAAAAAmFiAAAAAAMJAAABAAAAAgUAAAABVwIAAAAKQnl0ZVZlY3RvcgQAAAACYWYFAAAAAVcFAAAAAmFmAwkAAAEAAAACBQAAAAFXAgAAAARVbml0CAUAAAACYmgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJiaAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmJoAAAABnByb29mcwAAAAAAAAAAAAUAAAACYmrck9+D", "chainId": 84, "height": 2411807, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4UVbEFEj1Eji37zVRuxKutfbCVxWQs5m8f2jZ4Xc87hc Next: 6aYUsoKHSrQiKi3SKSsceYQMrTsYBBKxeo6BcntkytWN Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP) | |
68 | + | ||
69 | + | ||
70 | + | func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP) | |
68 | 71 | ||
69 | 72 | ||
70 | 73 | func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP) | |
199 | 202 | ||
200 | 203 | ||
201 | 204 | @Callable(i) | |
202 | - | func constructor (factoryV2Address,assetsStoreAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
205 | + | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
203 | 206 | let checkCaller = mustManager(i) | |
204 | 207 | if ((checkCaller == checkCaller)) | |
205 | - | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
208 | + | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
206 | 209 | else throw("Strict value is not equal to itself.") | |
207 | 210 | } | |
208 | 211 | ||
213 | 216 | let amountAssetPayment = value(i.payments[0]) | |
214 | 217 | let priceAssetPayment = value(i.payments[1]) | |
215 | 218 | let feeAssetPayment = value(i.payments[2]) | |
216 | - | let $ | |
217 | - | let amountAssetId = $ | |
218 | - | let amountAssetInfo = $ | |
219 | - | let $ | |
220 | - | let priceAssetId = $ | |
221 | - | let priceAssetInfo = $ | |
222 | - | let $ | |
223 | - | let feeAssetId = $ | |
224 | - | let feeAssetInfo = $ | |
219 | + | let $t066466718 = getIdAndInfo(amountAssetPayment) | |
220 | + | let amountAssetId = $t066466718._1 | |
221 | + | let amountAssetInfo = $t066466718._2 | |
222 | + | let $t067216790 = getIdAndInfo(priceAssetPayment) | |
223 | + | let priceAssetId = $t067216790._1 | |
224 | + | let priceAssetInfo = $t067216790._2 | |
225 | + | let $t067936856 = getIdAndInfo(feeAssetPayment) | |
226 | + | let feeAssetId = $t067936856._1 | |
227 | + | let feeAssetInfo = $t067936856._2 | |
225 | 228 | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
226 | 229 | let managerPriceAssetMinAmount = 1 | |
227 | 230 | let priceAssetMinAmount = if (isManager(i)) | |
232 | 235 | } | |
233 | 236 | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
234 | 237 | let curIndex = (lastIndex + 1) | |
238 | + | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
235 | 239 | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
236 | 240 | then true | |
237 | 241 | else throwPoolExists(), if (if (isManager(i)) | |
252 | 256 | then true | |
253 | 257 | else throwInvalidFee()] | |
254 | 258 | if ((checks == checks)) | |
255 | - | 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)] | |
259 | + | then { | |
260 | + | let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)]) | |
261 | + | if ((burnEmissionInv == burnEmissionInv)) | |
262 | + | 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)] | |
263 | + | else throw("Strict value is not equal to itself.") | |
264 | + | } | |
256 | 265 | else throw("Strict value is not equal to itself.") | |
257 | 266 | } | |
258 | 267 |
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 | 50 | ||
51 | 51 | ||
52 | 52 | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP) | |
68 | + | ||
69 | + | ||
70 | + | func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP) | |
68 | 71 | ||
69 | 72 | ||
70 | 73 | func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP) | |
71 | 74 | ||
72 | 75 | ||
73 | 76 | func keyLastIndex () = makeString(["%s", "lastIndex"], SEP) | |
74 | 77 | ||
75 | 78 | ||
76 | 79 | let indexSuffix = "u" | |
77 | 80 | ||
78 | 81 | let statusPending = "pending" | |
79 | 82 | ||
80 | 83 | let statusDeclined = "declined" | |
81 | 84 | ||
82 | 85 | let statusActive = "active" | |
83 | 86 | ||
84 | 87 | let statuses = [statusPending, statusDeclined, statusActive] | |
85 | 88 | ||
86 | 89 | func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP) | |
87 | 90 | ||
88 | 91 | ||
89 | 92 | func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP) | |
90 | 93 | ||
91 | 94 | ||
92 | 95 | func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP) | |
93 | 96 | ||
94 | 97 | ||
95 | 98 | func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP) | |
96 | 99 | ||
97 | 100 | ||
98 | 101 | func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP) | |
99 | 102 | ||
100 | 103 | ||
101 | 104 | func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP) | |
102 | 105 | ||
103 | 106 | ||
104 | 107 | func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP) | |
105 | 108 | ||
106 | 109 | ||
107 | 110 | func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP) | |
108 | 111 | ||
109 | 112 | ||
110 | 113 | func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP) | |
111 | 114 | ||
112 | 115 | ||
113 | 116 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
114 | 117 | ||
115 | 118 | ||
116 | 119 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
117 | 120 | ||
118 | 121 | ||
119 | 122 | func stringOptionToList (stringOrUnit) = match stringOrUnit { | |
120 | 123 | case s: String => | |
121 | 124 | if ((size(s) == 0)) | |
122 | 125 | then nil | |
123 | 126 | else split(s, SEP) | |
124 | 127 | case _: Unit => | |
125 | 128 | nil | |
126 | 129 | case _ => | |
127 | 130 | throw("Match error") | |
128 | 131 | } | |
129 | 132 | ||
130 | 133 | ||
131 | 134 | let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract())) | |
132 | 135 | ||
133 | 136 | func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false) | |
134 | 137 | ||
135 | 138 | ||
136 | 139 | func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId)) | |
137 | 140 | then true | |
138 | 141 | else throwCreateNotCalled() | |
139 | 142 | ||
140 | 143 | ||
141 | 144 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
142 | 145 | case s: String => | |
143 | 146 | fromBase58String(s) | |
144 | 147 | case _: Unit => | |
145 | 148 | unit | |
146 | 149 | case _ => | |
147 | 150 | throw("Match error") | |
148 | 151 | } | |
149 | 152 | ||
150 | 153 | ||
151 | 154 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
152 | 155 | case s: String => | |
153 | 156 | fromBase58String(s) | |
154 | 157 | case _: Unit => | |
155 | 158 | unit | |
156 | 159 | case _ => | |
157 | 160 | throw("Match error") | |
158 | 161 | } | |
159 | 162 | ||
160 | 163 | ||
161 | 164 | func isManager (i) = match managerPublicKeyOrUnit() { | |
162 | 165 | case pk: ByteVector => | |
163 | 166 | (i.callerPublicKey == pk) | |
164 | 167 | case _: Unit => | |
165 | 168 | (i.caller == this) | |
166 | 169 | case _ => | |
167 | 170 | throw("Match error") | |
168 | 171 | } | |
169 | 172 | ||
170 | 173 | ||
171 | 174 | func mustManager (i) = if (isManager(i)) | |
172 | 175 | then true | |
173 | 176 | else throwPD() | |
174 | 177 | ||
175 | 178 | ||
176 | 179 | func mustAdmin (i) = { | |
177 | 180 | let adminPKs = stringOptionToList(getString(keyAdminPubKeys())) | |
178 | 181 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
179 | 182 | then true | |
180 | 183 | else mustManager(i) | |
181 | 184 | } | |
182 | 185 | ||
183 | 186 | ||
184 | 187 | func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2) | |
185 | 188 | ||
186 | 189 | ||
187 | 190 | func getIdAndInfo (payment) = match payment.assetId { | |
188 | 191 | case id: ByteVector => | |
189 | 192 | let info = value(assetInfo(id)) | |
190 | 193 | $Tuple2(toBase58String(id), info) | |
191 | 194 | case _: Unit => | |
192 | 195 | $Tuple2(wavesAssetId, unit) | |
193 | 196 | case _ => | |
194 | 197 | throw("Match error") | |
195 | 198 | } | |
196 | 199 | ||
197 | 200 | ||
198 | 201 | func validStatus (status) = containsElement(statuses, status) | |
199 | 202 | ||
200 | 203 | ||
201 | 204 | @Callable(i) | |
202 | - | func constructor (factoryV2Address,assetsStoreAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
205 | + | func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
203 | 206 | let checkCaller = mustManager(i) | |
204 | 207 | if ((checkCaller == checkCaller)) | |
205 | - | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
208 | + | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
206 | 209 | else throw("Strict value is not equal to itself.") | |
207 | 210 | } | |
208 | 211 | ||
209 | 212 | ||
210 | 213 | ||
211 | 214 | @Callable(i) | |
212 | 215 | func create () = { | |
213 | 216 | let amountAssetPayment = value(i.payments[0]) | |
214 | 217 | let priceAssetPayment = value(i.payments[1]) | |
215 | 218 | let feeAssetPayment = value(i.payments[2]) | |
216 | - | let $ | |
217 | - | let amountAssetId = $ | |
218 | - | let amountAssetInfo = $ | |
219 | - | let $ | |
220 | - | let priceAssetId = $ | |
221 | - | let priceAssetInfo = $ | |
222 | - | let $ | |
223 | - | let feeAssetId = $ | |
224 | - | let feeAssetInfo = $ | |
219 | + | let $t066466718 = getIdAndInfo(amountAssetPayment) | |
220 | + | let amountAssetId = $t066466718._1 | |
221 | + | let amountAssetInfo = $t066466718._2 | |
222 | + | let $t067216790 = getIdAndInfo(priceAssetPayment) | |
223 | + | let priceAssetId = $t067216790._1 | |
224 | + | let priceAssetInfo = $t067216790._2 | |
225 | + | let $t067936856 = getIdAndInfo(feeAssetPayment) | |
226 | + | let feeAssetId = $t067936856._1 | |
227 | + | let feeAssetInfo = $t067936856._2 | |
225 | 228 | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
226 | 229 | let managerPriceAssetMinAmount = 1 | |
227 | 230 | let priceAssetMinAmount = if (isManager(i)) | |
228 | 231 | then managerPriceAssetMinAmount | |
229 | 232 | else { | |
230 | 233 | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
231 | 234 | value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex])) | |
232 | 235 | } | |
233 | 236 | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
234 | 237 | let curIndex = (lastIndex + 1) | |
238 | + | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract())) | |
235 | 239 | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
236 | 240 | then true | |
237 | 241 | else throwPoolExists(), if (if (isManager(i)) | |
238 | 242 | then true | |
239 | 243 | else isVerified(amountAssetId)) | |
240 | 244 | then true | |
241 | 245 | else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId)) | |
242 | 246 | then true | |
243 | 247 | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
244 | 248 | then true | |
245 | 249 | else (amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
246 | 250 | then true | |
247 | 251 | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
248 | 252 | then true | |
249 | 253 | else (priceAssetPayment.amount >= priceAssetMinAmount)) | |
250 | 254 | then true | |
251 | 255 | else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
252 | 256 | then true | |
253 | 257 | else throwInvalidFee()] | |
254 | 258 | if ((checks == checks)) | |
255 | - | 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)] | |
259 | + | then { | |
260 | + | let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)]) | |
261 | + | if ((burnEmissionInv == burnEmissionInv)) | |
262 | + | 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)] | |
263 | + | else throw("Strict value is not equal to itself.") | |
264 | + | } | |
256 | 265 | else throw("Strict value is not equal to itself.") | |
257 | 266 | } | |
258 | 267 | ||
259 | 268 | ||
260 | 269 | ||
261 | 270 | @Callable(i) | |
262 | 271 | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
263 | 272 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
264 | 273 | then true | |
265 | 274 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
266 | 275 | then true | |
267 | 276 | else throwCanActivateOnlyPendingPool()] | |
268 | 277 | if ((checks == checks)) | |
269 | 278 | then { | |
270 | 279 | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
271 | 280 | if ((activateNewPoolInv == activateNewPoolInv)) | |
272 | 281 | then { | |
273 | 282 | let lpAssetId = match activateNewPoolInv { | |
274 | 283 | case id: String => | |
275 | 284 | id | |
276 | 285 | case _ => | |
277 | 286 | throwFactoryReturnedNotString() | |
278 | 287 | } | |
279 | 288 | if ((lpAssetId == lpAssetId)) | |
280 | 289 | then { | |
281 | 290 | let beforePut = assetBalance(this, fromBase58String(lpAssetId)) | |
282 | 291 | if ((beforePut == beforePut)) | |
283 | 292 | then { | |
284 | 293 | let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES")) | |
285 | 294 | then unit | |
286 | 295 | else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES")) | |
287 | 296 | then unit | |
288 | 297 | else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))]) | |
289 | 298 | if ((put == put)) | |
290 | 299 | then { | |
291 | 300 | let afterPut = assetBalance(this, fromBase58String(lpAssetId)) | |
292 | 301 | if ((afterPut == afterPut)) | |
293 | 302 | then { | |
294 | 303 | let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId))))) | |
295 | 304 | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
296 | 305 | } | |
297 | 306 | else throw("Strict value is not equal to itself.") | |
298 | 307 | } | |
299 | 308 | else throw("Strict value is not equal to itself.") | |
300 | 309 | } | |
301 | 310 | else throw("Strict value is not equal to itself.") | |
302 | 311 | } | |
303 | 312 | else throw("Strict value is not equal to itself.") | |
304 | 313 | } | |
305 | 314 | else throw("Strict value is not equal to itself.") | |
306 | 315 | } | |
307 | 316 | else throw("Strict value is not equal to itself.") | |
308 | 317 | } | |
309 | 318 | ||
310 | 319 | ||
311 | 320 | ||
312 | 321 | @Callable(i) | |
313 | 322 | func setAdmins (adminPubKeys) = { | |
314 | 323 | let checkCaller = mustManager(i) | |
315 | 324 | if ((checkCaller == checkCaller)) | |
316 | 325 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
317 | 326 | else throw("Strict value is not equal to itself.") | |
318 | 327 | } | |
319 | 328 | ||
320 | 329 | ||
321 | 330 | ||
322 | 331 | @Callable(i) | |
323 | 332 | func setManager (pendingManagerPublicKey) = { | |
324 | 333 | let checkCaller = mustManager(i) | |
325 | 334 | if ((checkCaller == checkCaller)) | |
326 | 335 | then { | |
327 | 336 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
328 | 337 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
329 | 338 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
330 | 339 | else throw("Strict value is not equal to itself.") | |
331 | 340 | } | |
332 | 341 | else throw("Strict value is not equal to itself.") | |
333 | 342 | } | |
334 | 343 | ||
335 | 344 | ||
336 | 345 | ||
337 | 346 | @Callable(i) | |
338 | 347 | func confirmManager () = { | |
339 | 348 | let pm = pendingManagerPublicKeyOrUnit() | |
340 | 349 | let hasPM = if (isDefined(pm)) | |
341 | 350 | then true | |
342 | 351 | else throw("No pending manager") | |
343 | 352 | if ((hasPM == hasPM)) | |
344 | 353 | then { | |
345 | 354 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
346 | 355 | then true | |
347 | 356 | else throw("You are not pending manager") | |
348 | 357 | if ((checkPM == checkPM)) | |
349 | 358 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
350 | 359 | else throw("Strict value is not equal to itself.") | |
351 | 360 | } | |
352 | 361 | else throw("Strict value is not equal to itself.") | |
353 | 362 | } | |
354 | 363 | ||
355 | 364 | ||
356 | 365 | ||
357 | 366 | @Callable(i) | |
358 | 367 | func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets()))) | |
359 | 368 | ||
360 | 369 | ||
361 | 370 | ||
362 | 371 | @Callable(i) | |
363 | 372 | func statusREADONLY (amountAssetId,priceAssetId) = { | |
364 | 373 | let status = match getString(keyStatus(amountAssetId, priceAssetId)) { | |
365 | 374 | case s: String => | |
366 | 375 | s | |
367 | 376 | case _ => | |
368 | 377 | unit | |
369 | 378 | } | |
370 | 379 | $Tuple2(nil, status) | |
371 | 380 | } | |
372 | 381 | ||
373 | 382 | ||
374 | 383 | @Verifier(tx) | |
375 | 384 | func verify () = { | |
376 | 385 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
377 | 386 | case pk: ByteVector => | |
378 | 387 | pk | |
379 | 388 | case _: Unit => | |
380 | 389 | tx.senderPublicKey | |
381 | 390 | case _ => | |
382 | 391 | throw("Match error") | |
383 | 392 | } | |
384 | 393 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
385 | 394 | } | |
386 | 395 |
github/deemru/w8io/026f985 74.11 ms ◑