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