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