tx · 2B9UDNC2K9mVWMyHhKCPEJCqm4J7nsmf4vSfBXASrGre 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh: -0.01600000 Waves 2022.10.27 10:23 [2290524] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves
{ "type": 13, "id": "2B9UDNC2K9mVWMyHhKCPEJCqm4J7nsmf4vSfBXASrGre", "fee": 1600000, "feeAssetId": null, "timestamp": 1666855366080, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "5LtMCyez2PMNSskMypRBam52MvZYXoWHkHEwtxJohoc9V26sNjFHjQ5w6KofJF6T9x1LrVjPsQFq3ADkGxBqPvWR" ], "script": "base64:AAIFAAAAAAAABswIAhIICgYICBgBCAESABIICgYICAgICAgSAwoBGBIDCgEIEgASABIECgIICCIDU0VQIgx3YXZlc0Fzc2V0SWQiEWludmFsaWRQcmljZUFzc2V0Igh0aHJvd0VyciIDbXNnIgd0aHJvd1BEIhR0aHJvd0NyZWF0ZU5vdENhbGxlZCIRdGhyb3dZb3VOb3RJc3N1ZXIiD3Rocm93UG9vbEV4aXN0cyIVdGhyb3dBc3NldE5vdFZlcmlmaWVkIhZ0aHJvd0ludmFsaWRQcmljZUFzc2V0IhR0aHJvd0ludmFsaWRGZWVBc3NldCIXdGhyb3dJbnZhbGlkQW1vdW50QXNzZXQiEnRocm93SW52YWxpZFN0YXR1cyIfdGhyb3dDYW5BY3RpdmF0ZU9ubHlQZW5kaW5nUG9vbCIddGhyb3dGYWN0b3J5UmV0dXJuZWROb3RTdHJpbmciHHRocm93SW52YWxpZFByaWNlQXNzZXRBbW91bnQiD3Rocm93SW52YWxpZEZlZSITa2V5TWFuYWdlclB1YmxpY0tleSIaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkiD2tleUFkbWluUH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AAAAAQkBAAAAAXYAAAACBQAAAAF3BQAAAAF4AwkAAAEAAAACBQAAAAFXAgAAAAZTdHJpbmcEAAAAAVgFAAAAAVcFAAAAAVgFAAAABHVuaXQJAAUUAAAAAgUAAAADbmlsBQAAAAJhcQAAAAEAAAACYmUBAAAAAmJmAAAAAAQAAAACYmcEAAAAAVcJAQAAAAJhYgAAAAADCQAAAQAAAAIFAAAAAVcCAAAACkJ5dGVWZWN0b3IEAAAAAmFmBQAAAAFXBQAAAAJhZgMJAAABAAAAAgUAAAABVwIAAAAEVW5pdAgFAAAAAmJlAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACYmUAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJiZQAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmJnLok93A==", "chainId": 84, "height": 2290524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FSYWcXjXHxVUJ1d4mhRfPzGRVajwwpqPCCzFVdBmfX1Y Next: NE2P4uUgGGCHLjRNNrpprfmqqAxYkBwFCNaLdUrakda Diff:
Old | New | Differences | |
---|---|---|---|
96 | 96 | ||
97 | 97 | ||
98 | 98 | func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP) | |
99 | + | ||
100 | + | ||
101 | + | func keyActivationHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "activationHeight", amountAssetId, priceAssetId], SEP) | |
99 | 102 | ||
100 | 103 | ||
101 | 104 | func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP) | |
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 $t066406712 = getIdAndInfo(amountAssetPayment) | |
220 | + | let amountAssetId = $t066406712._1 | |
221 | + | let amountAssetInfo = $t066406712._2 | |
222 | + | let $t067156784 = getIdAndInfo(priceAssetPayment) | |
223 | + | let priceAssetId = $t067156784._1 | |
224 | + | let priceAssetInfo = $t067156784._2 | |
225 | + | let $t067876850 = getIdAndInfo(feeAssetPayment) | |
226 | + | let feeAssetId = $t067876850._1 | |
227 | + | let feeAssetInfo = $t067876850._2 | |
225 | 228 | let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets())) | |
226 | 229 | let managerPriceAssetMinAmount = 1 | |
227 | 230 | let priceAssetMinAmount = if (isManager(i)) | |
290 | 293 | if ((afterPut == afterPut)) | |
291 | 294 | then { | |
292 | 295 | let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId))))) | |
293 | - | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
296 | + | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), IntegerEntry(keyActivationHeight(amountAssetId, priceAssetId), height), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
294 | 297 | } | |
295 | 298 | else throw("Strict value is not equal to itself.") | |
296 | 299 | } |
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 | + | ||
100 | + | ||
101 | + | func keyActivationHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "activationHeight", 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 | 205 | func constructor (factoryV2Address,assetsStoreAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
203 | 206 | let checkCaller = mustManager(i) | |
204 | 207 | if ((checkCaller == checkCaller)) | |
205 | 208 | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), 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 $t066406712 = getIdAndInfo(amountAssetPayment) | |
220 | + | let amountAssetId = $t066406712._1 | |
221 | + | let amountAssetInfo = $t066406712._2 | |
222 | + | let $t067156784 = getIdAndInfo(priceAssetPayment) | |
223 | + | let priceAssetId = $t067156784._1 | |
224 | + | let priceAssetInfo = $t067156784._2 | |
225 | + | let $t067876850 = getIdAndInfo(feeAssetPayment) | |
226 | + | let feeAssetId = $t067876850._1 | |
227 | + | let feeAssetInfo = $t067876850._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) | |
235 | 238 | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
236 | 239 | then true | |
237 | 240 | else throwPoolExists(), if (if (isManager(i)) | |
238 | 241 | then true | |
239 | 242 | else isVerified(amountAssetId)) | |
240 | 243 | then true | |
241 | 244 | else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId)) | |
242 | 245 | then true | |
243 | 246 | else throwInvalidFeeAsset(), if (if (isManager(i)) | |
244 | 247 | then true | |
245 | 248 | else (amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
246 | 249 | then true | |
247 | 250 | else throwInvalidAmountAsset(), if (if (isManager(i)) | |
248 | 251 | then true | |
249 | 252 | else (priceAssetPayment.amount >= priceAssetMinAmount)) | |
250 | 253 | then true | |
251 | 254 | else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
252 | 255 | then true | |
253 | 256 | else throwInvalidFee()] | |
254 | 257 | if ((checks == checks)) | |
255 | 258 | 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 | 259 | else throw("Strict value is not equal to itself.") | |
257 | 260 | } | |
258 | 261 | ||
259 | 262 | ||
260 | 263 | ||
261 | 264 | @Callable(i) | |
262 | 265 | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
263 | 266 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
264 | 267 | then true | |
265 | 268 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
266 | 269 | then true | |
267 | 270 | else throwCanActivateOnlyPendingPool()] | |
268 | 271 | if ((checks == checks)) | |
269 | 272 | then { | |
270 | 273 | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
271 | 274 | if ((activateNewPoolInv == activateNewPoolInv)) | |
272 | 275 | then { | |
273 | 276 | let lpAssetId = match activateNewPoolInv { | |
274 | 277 | case id: String => | |
275 | 278 | id | |
276 | 279 | case _ => | |
277 | 280 | throwFactoryReturnedNotString() | |
278 | 281 | } | |
279 | 282 | if ((lpAssetId == lpAssetId)) | |
280 | 283 | then { | |
281 | 284 | let beforePut = assetBalance(this, fromBase58String(lpAssetId)) | |
282 | 285 | if ((beforePut == beforePut)) | |
283 | 286 | then { | |
284 | 287 | let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES")) | |
285 | 288 | then unit | |
286 | 289 | else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))]) | |
287 | 290 | if ((put == put)) | |
288 | 291 | then { | |
289 | 292 | let afterPut = assetBalance(this, fromBase58String(lpAssetId)) | |
290 | 293 | if ((afterPut == afterPut)) | |
291 | 294 | then { | |
292 | 295 | let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId))))) | |
293 | - | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
296 | + | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), IntegerEntry(keyActivationHeight(amountAssetId, priceAssetId), height), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
294 | 297 | } | |
295 | 298 | else throw("Strict value is not equal to itself.") | |
296 | 299 | } | |
297 | 300 | else throw("Strict value is not equal to itself.") | |
298 | 301 | } | |
299 | 302 | else throw("Strict value is not equal to itself.") | |
300 | 303 | } | |
301 | 304 | else throw("Strict value is not equal to itself.") | |
302 | 305 | } | |
303 | 306 | else throw("Strict value is not equal to itself.") | |
304 | 307 | } | |
305 | 308 | else throw("Strict value is not equal to itself.") | |
306 | 309 | } | |
307 | 310 | ||
308 | 311 | ||
309 | 312 | ||
310 | 313 | @Callable(i) | |
311 | 314 | func setAdmins (adminPubKeys) = { | |
312 | 315 | let checkCaller = mustManager(i) | |
313 | 316 | if ((checkCaller == checkCaller)) | |
314 | 317 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
315 | 318 | else throw("Strict value is not equal to itself.") | |
316 | 319 | } | |
317 | 320 | ||
318 | 321 | ||
319 | 322 | ||
320 | 323 | @Callable(i) | |
321 | 324 | func setManager (pendingManagerPublicKey) = { | |
322 | 325 | let checkCaller = mustManager(i) | |
323 | 326 | if ((checkCaller == checkCaller)) | |
324 | 327 | then { | |
325 | 328 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
326 | 329 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
327 | 330 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
328 | 331 | else throw("Strict value is not equal to itself.") | |
329 | 332 | } | |
330 | 333 | else throw("Strict value is not equal to itself.") | |
331 | 334 | } | |
332 | 335 | ||
333 | 336 | ||
334 | 337 | ||
335 | 338 | @Callable(i) | |
336 | 339 | func confirmManager () = { | |
337 | 340 | let pm = pendingManagerPublicKeyOrUnit() | |
338 | 341 | let hasPM = if (isDefined(pm)) | |
339 | 342 | then true | |
340 | 343 | else throw("No pending manager") | |
341 | 344 | if ((hasPM == hasPM)) | |
342 | 345 | then { | |
343 | 346 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
344 | 347 | then true | |
345 | 348 | else throw("You are not pending manager") | |
346 | 349 | if ((checkPM == checkPM)) | |
347 | 350 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
348 | 351 | else throw("Strict value is not equal to itself.") | |
349 | 352 | } | |
350 | 353 | else throw("Strict value is not equal to itself.") | |
351 | 354 | } | |
352 | 355 | ||
353 | 356 | ||
354 | 357 | ||
355 | 358 | @Callable(i) | |
356 | 359 | func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets()))) | |
357 | 360 | ||
358 | 361 | ||
359 | 362 | ||
360 | 363 | @Callable(i) | |
361 | 364 | func statusREADONLY (amountAssetId,priceAssetId) = { | |
362 | 365 | let status = match getString(keyStatus(amountAssetId, priceAssetId)) { | |
363 | 366 | case s: String => | |
364 | 367 | s | |
365 | 368 | case _ => | |
366 | 369 | unit | |
367 | 370 | } | |
368 | 371 | $Tuple2(nil, status) | |
369 | 372 | } | |
370 | 373 | ||
371 | 374 | ||
372 | 375 | @Verifier(tx) | |
373 | 376 | func verify () = { | |
374 | 377 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
375 | 378 | case pk: ByteVector => | |
376 | 379 | pk | |
377 | 380 | case _: Unit => | |
378 | 381 | tx.senderPublicKey | |
379 | 382 | case _ => | |
380 | 383 | throw("Match error") | |
381 | 384 | } | |
382 | 385 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
383 | 386 | } | |
384 | 387 |
github/deemru/w8io/026f985 48.27 ms ◑