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