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