tx · 7szi2dBe73huhhDiHeJtx8rnY5cCLgxAiJvRAYneQ3uE 3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai: -0.02300000 Waves 2023.03.06 11:03 [2477963] smart account 3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai > SELF 0.00000000 Waves
{ "type": 13, "id": "7szi2dBe73huhhDiHeJtx8rnY5cCLgxAiJvRAYneQ3uE", "fee": 2300000, "feeAssetId": null, "timestamp": 1678089821646, "version": 2, "chainId": 84, "sender": "3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai", "senderPublicKey": "2JEaBjtjvMoNGKZmL9QxYefa1VkMJM3vMW8rNvTs9R2H", "proofs": [ "4wLCvcS8hH6WfXJkftqpptUrQEvydaFajXoohNAgAj6kc9F7PWPUWDkdY8eFTySSeTmhNGNzJm3MSQDfzryEqWuR" ], "script": "base64:BgKwJggCEgASBAoCCAgSAwoBCBIKCggICAgICAgIARIDCgEIEgYKBAgICAgSBAoCCBgSAwoBCBIECgIIGBIDCgEIEgASAwoBGBIKCggICAgICAEICBIECgIIARIDCgEBEgMKAQESBAoCCAESBgoECAgICBIECgIICBIECgIICBIECgIICBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICCIGU0NBTEU4IgVNVUxUOCIHU0NBTEUxOCIGTVVMVDE4Ig5QT09MV0VJR0hUTVVMVCIOR1dYdmlydHVhbFBPT0wiDGxhYmVsUG9vbHNMcCINZGVmYXVsdFNwcmVhZCIRZGVjaW1hbHNNdWx0UHJpY2UiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIhJpZHhJbnRlcm5hbEFzc2V0SWQiD2lkeFJlc3V0QWN0aW9ucyIgaWR4SWZBc3NldElkQ2FsY3VsYXRpb25QZXJmb3JtZWQiDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29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BCQECYXQBBQFaBQFqBAJhaAkAkQMCBQJiTQABBAJhaQkAkQMCBQJiTQACBAJjZAkAtQkCCQECYUYBCQECYWcCBQJhaAUCYWkFAWoJAJQKAgUDbmlsCQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUCY2QFAXQCYmgBGGdldFBvb2xDb25maWdCeUxwQXNzZXRJZAECY1YEAmJNCQC1CQIJAQJhRgEJAQJhbgEFAmNWBQFqBAJhaAkAkQMCBQJiTQABBAJhaQkAkQMCBQJiTQACBAJjZAkAtQkCCQECYUYBCQECYWcCBQJhaAUCYWkFAWoJAJQKAgUDbmlsBQJjZAJiaAEScG9vbEV4aXN0c1JFQURPTkxZAgJhegJhQQkAlAoCBQNuaWwJAQJjYQIFAmF6BQJhQQECZXIBAmVzAAQCZXQEAmJhCQECYmMAAwkAAQIFAmJhAgpCeXRlVmVjdG9yBAJiagUCYmEFAmJqAwkAAQIFAmJhAgRVbml0CAUCZXIPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVyCWJvZHlCeXRlcwkAkQMCCAUCZXIGcHJvb2ZzAAAFAmV0DEWbsQ==", "height": 2477963, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7t3DWSiHNELu2EKBLVFGNYkXzezMEjifxMotYpz3LURi Next: CkSoCsiYYnhtupM1t4r6dcb317SFzbibSS8EG4J1LURW Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | let labelPoolsLp = "POOLS_LP" | |
17 | 17 | ||
18 | 18 | let defaultSpread = 2000000 | |
19 | - | ||
20 | - | let wavesString = "WAVES" | |
21 | 19 | ||
22 | 20 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
23 | 21 | ||
138 | 136 | ||
139 | 137 | ||
140 | 138 | func keyPoolOneTokenOperationsDisabled (assetsInternal) = { | |
141 | - | let $ | |
142 | - | let amountAssetInternal = $ | |
143 | - | let priceAssetInternal = $ | |
139 | + | let $t037003762 = assetsInternal | |
140 | + | let amountAssetInternal = $t037003762._1 | |
141 | + | let priceAssetInternal = $t037003762._2 | |
144 | 142 | makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP) | |
145 | 143 | } | |
146 | 144 | ||
191 | 189 | ||
192 | 190 | ||
193 | 191 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
194 | - | ||
195 | - | ||
196 | - | func parseAssetId (input) = if ((input == wavesString)) | |
197 | - | then unit | |
198 | - | else fromBase58String(input) | |
199 | 192 | ||
200 | 193 | ||
201 | 194 | let IdxFactoryCfgStakingDapp = 1 | |
776 | 769 | ||
777 | 770 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
778 | 771 | then $a | |
779 | - | else throw("List size exceeds | |
772 | + | else throw("List size exceeds 1") | |
780 | 773 | ||
781 | - | $f0_2($f0_1($ | |
774 | + | $f0_2($f0_1($acc0, 0), 1) | |
782 | 775 | } | |
783 | 776 | if ((actions == actions)) | |
784 | 777 | then $Tuple2(nil, unit) | |
821 | 814 | ||
822 | 815 | ||
823 | 816 | @Callable(i) | |
824 | - | func poolInfoREADONLY (amountAssetIdStr,priceAssetIdStr) = { | |
825 | - | let amountAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(amountAssetIdStr)) | |
826 | - | let priceAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(priceAssetIdStr)) | |
827 | - | let poolContractAddressOption = getString(this, keyMappingPoolAssetsToPoolContractAddress(value(amountAssetInternalIdOption), value(priceAssetInternalIdOption))) | |
828 | - | let lpAssetIdOption = getString(this, keyMappingPoolContractToLPAsset(value(poolContractAddressOption))) | |
829 | - | let poolExists = if (if (isDefined(amountAssetInternalIdOption)) | |
830 | - | then isDefined(priceAssetInternalIdOption) | |
831 | - | else false) | |
832 | - | then isDefined(poolContractAddressOption) | |
833 | - | else false | |
834 | - | let poolInfo = if (poolExists) | |
835 | - | then $Tuple2(addressFromStringValue(value(poolContractAddressOption)), parseAssetId(value(lpAssetIdOption))) | |
836 | - | else unit | |
837 | - | $Tuple2(nil, poolInfo) | |
838 | - | } | |
839 | - | ||
840 | - | ||
841 | - | ||
842 | - | @Callable(i) | |
843 | 817 | func getPoolStatusREADONLY (poolAddress) = { | |
844 | 818 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
845 | 819 | let amountAssetInternal = poolAssets[1] | |
851 | 825 | ||
852 | 826 | ||
853 | 827 | @Callable(i) | |
854 | - | func | |
855 | - | let poolAssets = split(getStringOrFail( | |
828 | + | func getPoolConfigByLpAssetId (lpAssetIdStr) = { | |
829 | + | let poolAssets = split(getStringOrFail(keyMappingLpAssetToPoolAssets(lpAssetIdStr)), SEP) | |
856 | 830 | let amountAssetInternal = poolAssets[1] | |
857 | 831 | let priceAssetInternal = poolAssets[2] | |
858 | 832 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let SCALE18 = 18 | |
9 | 9 | ||
10 | 10 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let POOLWEIGHTMULT = MULT8 | |
13 | 13 | ||
14 | 14 | let GWXvirtualPOOL = "GWXvirtualPOOL" | |
15 | 15 | ||
16 | 16 | let labelPoolsLp = "POOLS_LP" | |
17 | 17 | ||
18 | 18 | let defaultSpread = 2000000 | |
19 | - | ||
20 | - | let wavesString = "WAVES" | |
21 | 19 | ||
22 | 20 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
23 | 21 | ||
24 | 22 | let SEP = "__" | |
25 | 23 | ||
26 | 24 | let EMPTY = "" | |
27 | 25 | ||
28 | 26 | let PoolActive = 1 | |
29 | 27 | ||
30 | 28 | let PoolPutDisabled = 2 | |
31 | 29 | ||
32 | 30 | let PoolMatcherDisabled = 3 | |
33 | 31 | ||
34 | 32 | let PoolShutdown = 4 | |
35 | 33 | ||
36 | 34 | let idxInternalAssetId = 1 | |
37 | 35 | ||
38 | 36 | let idxResutActions = 2 | |
39 | 37 | ||
40 | 38 | let idxIfAssetIdCalculationPerformed = 3 | |
41 | 39 | ||
42 | 40 | let idxPoolAddress = 1 | |
43 | 41 | ||
44 | 42 | let idxPoolStatus = 2 | |
45 | 43 | ||
46 | 44 | let idxPoolLPAssetId = 3 | |
47 | 45 | ||
48 | 46 | let idxAmtAssetId = 4 | |
49 | 47 | ||
50 | 48 | let idxPriceAssetId = 5 | |
51 | 49 | ||
52 | 50 | let idxAmtAssetDcm = 6 | |
53 | 51 | ||
54 | 52 | let idxPriceAssetDcm = 7 | |
55 | 53 | ||
56 | 54 | let idxIAmtAssetId = 8 | |
57 | 55 | ||
58 | 56 | let idxIPriceAssetId = 9 | |
59 | 57 | ||
60 | 58 | let idxLPAssetDcm = 10 | |
61 | 59 | ||
62 | 60 | let idxPoolType = 11 | |
63 | 61 | ||
64 | 62 | let poolLabelWxEmission = "WX_EMISSION" | |
65 | 63 | ||
66 | 64 | let validPoolLabels = [poolLabelWxEmission] | |
67 | 65 | ||
68 | 66 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
69 | 67 | ||
70 | 68 | ||
71 | 69 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
72 | 70 | ||
73 | 71 | ||
74 | 72 | func keyAllowedLpStableAddonScriptHash () = "%s__allowedLpStableAddonScriptHash" | |
75 | 73 | ||
76 | 74 | ||
77 | 75 | func swapContract () = "%s__swapContract" | |
78 | 76 | ||
79 | 77 | ||
80 | 78 | func keyFactoryConfig () = "%s__factoryConfig" | |
81 | 79 | ||
82 | 80 | ||
83 | 81 | func keyLpTokensList () = "%s__lpTokensList" | |
84 | 82 | ||
85 | 83 | ||
86 | 84 | func keyPoolScriptHash () = "%s%s__pool__scriptHash" | |
87 | 85 | ||
88 | 86 | ||
89 | 87 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
90 | 88 | ||
91 | 89 | ||
92 | 90 | func keyLegacyFactoryContract () = "%s__legacyFactoryContract" | |
93 | 91 | ||
94 | 92 | ||
95 | 93 | func keyLegacyPools () = "%s__legacyPools" | |
96 | 94 | ||
97 | 95 | ||
98 | 96 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
99 | 97 | ||
100 | 98 | ||
101 | 99 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
102 | 100 | ||
103 | 101 | ||
104 | 102 | func keyAdminPubKeys () = "%s__adminPubKeys" | |
105 | 103 | ||
106 | 104 | ||
107 | 105 | func keyAssetsStoreContract () = "%s__assetsStoreContract" | |
108 | 106 | ||
109 | 107 | ||
110 | 108 | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
111 | 109 | ||
112 | 110 | ||
113 | 111 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
114 | 112 | ||
115 | 113 | ||
116 | 114 | func keyPriceDecimals () = "%s__priceDecimals" | |
117 | 115 | ||
118 | 116 | ||
119 | 117 | func keyAllPoolsShutdown () = "%s__shutdown" | |
120 | 118 | ||
121 | 119 | ||
122 | 120 | func keyNextInternalAssetId () = "%s__nextInternalAssetId" | |
123 | 121 | ||
124 | 122 | ||
125 | 123 | func keyPoolToWeight (poolAddress) = ("%s%s__poolWeight__" + poolAddress) | |
126 | 124 | ||
127 | 125 | ||
128 | 126 | func keyPoolToWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num)) | |
129 | 127 | ||
130 | 128 | ||
131 | 129 | func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset)) | |
132 | 130 | ||
133 | 131 | ||
134 | 132 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
135 | 133 | ||
136 | 134 | ||
137 | 135 | func keyPoolConfig (amountAssetInternal,priceAssetInternal) = (((("%d%d%s__" + amountAssetInternal) + "__") + priceAssetInternal) + "__config") | |
138 | 136 | ||
139 | 137 | ||
140 | 138 | func keyPoolOneTokenOperationsDisabled (assetsInternal) = { | |
141 | - | let $ | |
142 | - | let amountAssetInternal = $ | |
143 | - | let priceAssetInternal = $ | |
139 | + | let $t037003762 = assetsInternal | |
140 | + | let amountAssetInternal = $t037003762._1 | |
141 | + | let priceAssetInternal = $t037003762._2 | |
144 | 142 | makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP) | |
145 | 143 | } | |
146 | 144 | ||
147 | 145 | ||
148 | 146 | func keyAllPoolsOneTokenOperationsDisabled () = makeString(["%s", "oneTokenOperationsDisabled"], SEP) | |
149 | 147 | ||
150 | 148 | ||
151 | 149 | func keyMappingLpAssetToPoolAssets (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2Pool") | |
152 | 150 | ||
153 | 151 | ||
154 | 152 | func keyMappingPoolAssetsToLpasset (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + internalAmountAssetIdStr) + "__") + internalPriceAssetIdStr) + "__mappings__PoolAssets2LpAsset") | |
155 | 153 | ||
156 | 154 | ||
157 | 155 | func keyPoolSpread (poolAddress) = ("%s%s__spread__" + poolAddress) | |
158 | 156 | ||
159 | 157 | ||
160 | 158 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2PoolAssets") | |
161 | 159 | ||
162 | 160 | ||
163 | 161 | func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract") | |
164 | 162 | ||
165 | 163 | ||
166 | 164 | func keyMappingPoolContractToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
167 | 165 | ||
168 | 166 | ||
169 | 167 | func keyMappingPoolLPAssetToPoolContractAddress (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2PoolContract") | |
170 | 168 | ||
171 | 169 | ||
172 | 170 | func keyWxEmission (amountAssetId,priceAssetId) = ((("%s%s%s__wxEmission__" + amountAssetId) + "__") + priceAssetId) | |
173 | 171 | ||
174 | 172 | ||
175 | 173 | func keyInFee (poolAddress) = ("%s%s__inFee__" + poolAddress) | |
176 | 174 | ||
177 | 175 | ||
178 | 176 | func keyInFeeDefault () = "%s__inFeeDefault" | |
179 | 177 | ||
180 | 178 | ||
181 | 179 | func keyOutFee (poolAddress) = ("%s%s__outFee__" + poolAddress) | |
182 | 180 | ||
183 | 181 | ||
184 | 182 | func keyOutFeeDefault () = "%s__outFeeDefault" | |
185 | 183 | ||
186 | 184 | ||
187 | 185 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key)) | |
188 | 186 | ||
189 | 187 | ||
190 | 188 | func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key)) | |
191 | 189 | ||
192 | 190 | ||
193 | 191 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
194 | - | ||
195 | - | ||
196 | - | func parseAssetId (input) = if ((input == wavesString)) | |
197 | - | then unit | |
198 | - | else fromBase58String(input) | |
199 | 192 | ||
200 | 193 | ||
201 | 194 | let IdxFactoryCfgStakingDapp = 1 | |
202 | 195 | ||
203 | 196 | let IdxFactoryCfgBoostingDapp = 2 | |
204 | 197 | ||
205 | 198 | let IdxFactoryCfgIdoDapp = 3 | |
206 | 199 | ||
207 | 200 | let IdxFactoryCfgTeamDapp = 4 | |
208 | 201 | ||
209 | 202 | let IdxFactoryCfgEmissionDapp = 5 | |
210 | 203 | ||
211 | 204 | let IdxFactoryCfgRestDapp = 6 | |
212 | 205 | ||
213 | 206 | let IdxFactoryCfgSlippageDapp = 7 | |
214 | 207 | ||
215 | 208 | let IdxFactoryCfgDaoDapp = 8 | |
216 | 209 | ||
217 | 210 | let IdxFactoryCfgMarketingDapp = 9 | |
218 | 211 | ||
219 | 212 | let IdxFactoryCfgGwxRewardDapp = 10 | |
220 | 213 | ||
221 | 214 | let IdxFactoryCfgBirdsDapp = 11 | |
222 | 215 | ||
223 | 216 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
224 | 217 | ||
225 | 218 | ||
226 | 219 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
227 | 220 | ||
228 | 221 | ||
229 | 222 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
230 | 223 | ||
231 | 224 | ||
232 | 225 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
233 | 226 | ||
234 | 227 | ||
235 | 228 | func getPriceAssets () = match getString(keyPriceAssets()) { | |
236 | 229 | case s: String => | |
237 | 230 | if ((size(s) == 0)) | |
238 | 231 | then nil | |
239 | 232 | else split(s, SEP) | |
240 | 233 | case _ => | |
241 | 234 | nil | |
242 | 235 | } | |
243 | 236 | ||
244 | 237 | ||
245 | 238 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
246 | 239 | case s: String => | |
247 | 240 | fromBase58String(s) | |
248 | 241 | case _: Unit => | |
249 | 242 | unit | |
250 | 243 | case _ => | |
251 | 244 | throw("Match error") | |
252 | 245 | } | |
253 | 246 | ||
254 | 247 | ||
255 | 248 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
256 | 249 | case s: String => | |
257 | 250 | fromBase58String(s) | |
258 | 251 | case _: Unit => | |
259 | 252 | unit | |
260 | 253 | case _ => | |
261 | 254 | throw("Match error") | |
262 | 255 | } | |
263 | 256 | ||
264 | 257 | ||
265 | 258 | let permissionDeniedError = throw("Permission denied") | |
266 | 259 | ||
267 | 260 | let testError = throw("Test error here") | |
268 | 261 | ||
269 | 262 | func mustThis (i) = if ((i.caller == this)) | |
270 | 263 | then true | |
271 | 264 | else permissionDeniedError | |
272 | 265 | ||
273 | 266 | ||
274 | 267 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
275 | 268 | case pk: ByteVector => | |
276 | 269 | if ((i.callerPublicKey == pk)) | |
277 | 270 | then true | |
278 | 271 | else permissionDeniedError | |
279 | 272 | case _: Unit => | |
280 | 273 | mustThis(i) | |
281 | 274 | case _ => | |
282 | 275 | throw("Match error") | |
283 | 276 | } | |
284 | 277 | ||
285 | 278 | ||
286 | 279 | func dataFactoryCfgV3 (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract,daoContract,marketingContract,gwxRewardsContract,birdsContract) = makeString(["%s%s%s%s%s%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract, daoContract, marketingContract, gwxRewardsContract, birdsContract], SEP) | |
287 | 280 | ||
288 | 281 | ||
289 | 282 | func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract], SEP) | |
290 | 283 | ||
291 | 284 | ||
292 | 285 | func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,lpAssetDecimals,poolType) = makeString(["%s%d%s%s%s%d%d%d%d%d%s", poolAddress, poolStatus, lpAssetId, amountAssetStr, priceAssetStr, toString(amountAssetDecimals), toString(priceAssetDecimals), toString(amountAssetInternalId), toString(priceAssetInternalId), toString(lpAssetDecimals), poolType], SEP) | |
293 | 286 | ||
294 | 287 | ||
295 | 288 | func dataMappingPoolAssets (internalAmountAssetStr,internalPriceAssetStr) = makeString(["%d%d", toString(internalAmountAssetStr), toString(internalPriceAssetStr)], SEP) | |
296 | 289 | ||
297 | 290 | ||
298 | 291 | func getPoolConfig (poolAddress) = { | |
299 | 292 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
300 | 293 | let amountAssetInternal = poolAssets[1] | |
301 | 294 | let priceAssetInternal = poolAssets[2] | |
302 | 295 | split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
303 | 296 | } | |
304 | 297 | ||
305 | 298 | ||
306 | 299 | func getInternalAssetIdOrCreate (assetIdStr,incrementor) = { | |
307 | 300 | let internalAssetId = valueOrElse(getInteger(this, keyMappingsBaseAsset2internalId(assetIdStr)), 0) | |
308 | 301 | let currentIndexOfInternalId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0) | |
309 | 302 | let result = if ((internalAssetId == 0)) | |
310 | 303 | then { | |
311 | 304 | let newInternalAssetId = (currentIndexOfInternalId + incrementor) | |
312 | 305 | $Tuple3(newInternalAssetId, [IntegerEntry(keyNextInternalAssetId(), newInternalAssetId), IntegerEntry(keyMappingsBaseAsset2internalId(assetIdStr), newInternalAssetId), StringEntry(keyMappingsInternal2baseAssetId(newInternalAssetId), assetIdStr)], true) | |
313 | 306 | } | |
314 | 307 | else $Tuple3(internalAssetId, nil, false) | |
315 | 308 | result | |
316 | 309 | } | |
317 | 310 | ||
318 | 311 | ||
319 | 312 | func mustAdmin (i) = { | |
320 | 313 | let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP) | |
321 | 314 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
322 | 315 | then true | |
323 | 316 | else { | |
324 | 317 | let isManager = mustManager(i) | |
325 | 318 | if ((isManager == isManager)) | |
326 | 319 | then true | |
327 | 320 | else throw("Strict value is not equal to itself.") | |
328 | 321 | } | |
329 | 322 | } | |
330 | 323 | ||
331 | 324 | ||
332 | 325 | func intOrDefaultOrFallback (key,keyDefault,valueFallback) = valueOrElse(getInteger(this, key), valueOrElse(getInteger(this, keyDefault), valueFallback)) | |
333 | 326 | ||
334 | 327 | ||
335 | 328 | func poolExistsInternal (amountAssetId,priceAssetId) = { | |
336 | 329 | let amountAssetInternal = getInteger(keyMappingsBaseAsset2internalId(amountAssetId)) | |
337 | 330 | let priceAssetInternal = getInteger(keyMappingsBaseAsset2internalId(priceAssetId)) | |
338 | 331 | if (if ((amountAssetInternal == unit)) | |
339 | 332 | then true | |
340 | 333 | else (priceAssetInternal == unit)) | |
341 | 334 | then false | |
342 | 335 | else { | |
343 | 336 | let amAs = toString(value(amountAssetInternal)) | |
344 | 337 | let prAs = toString(value(priceAssetInternal)) | |
345 | 338 | let cfg = getString(keyPoolConfig(amAs, prAs)) | |
346 | 339 | let cfgReverse = getString(keyPoolConfig(prAs, amAs)) | |
347 | 340 | let exists = if ((cfg != unit)) | |
348 | 341 | then true | |
349 | 342 | else (cfgReverse != unit) | |
350 | 343 | exists | |
351 | 344 | } | |
352 | 345 | } | |
353 | 346 | ||
354 | 347 | ||
355 | 348 | @Callable(i) | |
356 | 349 | func getSwapContractREADONLY () = $Tuple2(nil, getStringOrFail(swapContract())) | |
357 | 350 | ||
358 | 351 | ||
359 | 352 | ||
360 | 353 | @Callable(i) | |
361 | 354 | func getLpAssetFromPoolAssetsREADONLY (asset1,asset2) = if (if ((asset1 == "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS")) | |
362 | 355 | then (asset2 == "WAVES") | |
363 | 356 | else false) | |
364 | 357 | then $Tuple2(nil, unit) | |
365 | 358 | else { | |
366 | 359 | let assetNum1 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset1))) | |
367 | 360 | let assetNum2 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset2))) | |
368 | 361 | let ee = getString(this, keyMappingPoolAssetsToLpasset(toString(assetNum1), toString(assetNum2))) | |
369 | 362 | let res = if ((ee == unit)) | |
370 | 363 | then unit | |
371 | 364 | else drop(value(ee), 4) | |
372 | 365 | $Tuple2(nil, res) | |
373 | 366 | } | |
374 | 367 | ||
375 | 368 | ||
376 | 369 | ||
377 | 370 | @Callable(i) | |
378 | 371 | func getPoolAddressFromLpAssetREADONLY (lp) = $Tuple2(nil, valueOrElse(getString(this, keyMappingPoolLPAssetToPoolContractAddress(lp)), "")) | |
379 | 372 | ||
380 | 373 | ||
381 | 374 | ||
382 | 375 | @Callable(i) | |
383 | 376 | func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,slpipageContract,priceDecimals) = { | |
384 | 377 | let checkCaller = mustManager(i) | |
385 | 378 | if ((checkCaller == checkCaller)) | |
386 | 379 | then [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract, slpipageContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)] | |
387 | 380 | else throw("Strict value is not equal to itself.") | |
388 | 381 | } | |
389 | 382 | ||
390 | 383 | ||
391 | 384 | ||
392 | 385 | @Callable(i) | |
393 | 386 | func constructorV2 (mathcherPub58Str) = { | |
394 | 387 | let checkCaller = mustManager(i) | |
395 | 388 | if ((checkCaller == checkCaller)) | |
396 | 389 | then { | |
397 | 390 | let mathcerPub = addressFromPublicKey(fromBase58String(mathcherPub58Str)) | |
398 | 391 | if ((mathcerPub == mathcerPub)) | |
399 | 392 | then [StringEntry(keyMatcherPub(), mathcherPub58Str)] | |
400 | 393 | else throw("Strict value is not equal to itself.") | |
401 | 394 | } | |
402 | 395 | else throw("Strict value is not equal to itself.") | |
403 | 396 | } | |
404 | 397 | ||
405 | 398 | ||
406 | 399 | ||
407 | 400 | @Callable(i) | |
408 | 401 | func constructorV3 (daoContract,marketingContract,gwxRewardsContract,birdsContract) = { | |
409 | 402 | let checkCaller = mustManager(i) | |
410 | 403 | if ((checkCaller == checkCaller)) | |
411 | 404 | then { | |
412 | 405 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
413 | 406 | [StringEntry(keyFactoryConfig(), dataFactoryCfgV3(factoryCfg[1], factoryCfg[2], factoryCfg[3], factoryCfg[4], factoryCfg[5], factoryCfg[6], factoryCfg[7], daoContract, marketingContract, gwxRewardsContract, birdsContract))] | |
414 | 407 | } | |
415 | 408 | else throw("Strict value is not equal to itself.") | |
416 | 409 | } | |
417 | 410 | ||
418 | 411 | ||
419 | 412 | ||
420 | 413 | @Callable(i) | |
421 | 414 | func constructorV4 (legacyFactoryContract,legacyPools) = { | |
422 | 415 | let checkCaller = mustManager(i) | |
423 | 416 | if ((checkCaller == checkCaller)) | |
424 | 417 | then [StringEntry(keyLegacyFactoryContract(), legacyFactoryContract), StringEntry(keyLegacyPools(), makeString(legacyPools, SEP))] | |
425 | 418 | else throw("Strict value is not equal to itself.") | |
426 | 419 | } | |
427 | 420 | ||
428 | 421 | ||
429 | 422 | ||
430 | 423 | @Callable(i) | |
431 | 424 | func constructorV5 (assetsStoreContract) = { | |
432 | 425 | let checkCaller = mustManager(i) | |
433 | 426 | if ((checkCaller == checkCaller)) | |
434 | 427 | then [StringEntry(keyAssetsStoreContract(), assetsStoreContract)] | |
435 | 428 | else throw("Strict value is not equal to itself.") | |
436 | 429 | } | |
437 | 430 | ||
438 | 431 | ||
439 | 432 | ||
440 | 433 | @Callable(i) | |
441 | 434 | func constructorV6 (votingEmissionContract,priceAssets) = { | |
442 | 435 | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
443 | 436 | then true | |
444 | 437 | else "invalid voting emission contract address"] | |
445 | 438 | if ((cheks == cheks)) | |
446 | 439 | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract), StringEntry(keyPriceAssets(), makeString(priceAssets, SEP))] | |
447 | 440 | else throw("Strict value is not equal to itself.") | |
448 | 441 | } | |
449 | 442 | ||
450 | 443 | ||
451 | 444 | ||
452 | 445 | @Callable(i) | |
453 | 446 | func setManager (pendingManagerPublicKey) = { | |
454 | 447 | let checkCaller = mustManager(i) | |
455 | 448 | if ((checkCaller == checkCaller)) | |
456 | 449 | then { | |
457 | 450 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
458 | 451 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
459 | 452 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
460 | 453 | else throw("Strict value is not equal to itself.") | |
461 | 454 | } | |
462 | 455 | else throw("Strict value is not equal to itself.") | |
463 | 456 | } | |
464 | 457 | ||
465 | 458 | ||
466 | 459 | ||
467 | 460 | @Callable(i) | |
468 | 461 | func confirmManager () = { | |
469 | 462 | let pm = pendingManagerPublicKeyOrUnit() | |
470 | 463 | let hasPM = if (isDefined(pm)) | |
471 | 464 | then true | |
472 | 465 | else throw("No pending manager") | |
473 | 466 | if ((hasPM == hasPM)) | |
474 | 467 | then { | |
475 | 468 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
476 | 469 | then true | |
477 | 470 | else throw("You are not pending manager") | |
478 | 471 | if ((checkPM == checkPM)) | |
479 | 472 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
480 | 473 | else throw("Strict value is not equal to itself.") | |
481 | 474 | } | |
482 | 475 | else throw("Strict value is not equal to itself.") | |
483 | 476 | } | |
484 | 477 | ||
485 | 478 | ||
486 | 479 | ||
487 | 480 | @Callable(i) | |
488 | 481 | func setAdmins (adminPubKeys) = { | |
489 | 482 | let checkCaller = mustManager(i) | |
490 | 483 | if ((checkCaller == checkCaller)) | |
491 | 484 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
492 | 485 | else throw("Strict value is not equal to itself.") | |
493 | 486 | } | |
494 | 487 | ||
495 | 488 | ||
496 | 489 | ||
497 | 490 | @Callable(i) | |
498 | 491 | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight,poolType,logo) = { | |
499 | 492 | let checkCaller = mustAdmin(i) | |
500 | 493 | if ((checkCaller == checkCaller)) | |
501 | 494 | then if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress)))) | |
502 | 495 | then throw((("Pool address " + poolAddress) + " already registered.")) | |
503 | 496 | else { | |
504 | 497 | let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1) | |
505 | 498 | let internalAmountAssetId = internalAmountAssetData._1 | |
506 | 499 | let internalPriceAssetData = getInternalAssetIdOrCreate(priceAssetStr, if (internalAmountAssetData._3) | |
507 | 500 | then 2 | |
508 | 501 | else 1) | |
509 | 502 | let internalPriceAssetId = internalPriceAssetData._1 | |
510 | 503 | let poolAccountScriptHash = valueOrErrorMessage(scriptHash(addressFromStringValue(poolAddress)), ("No script has been found on pool account " + poolAddress)) | |
511 | 504 | let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash()) | |
512 | 505 | let poolExists = poolExistsInternal(amountAssetStr, priceAssetStr) | |
513 | 506 | if (poolExists) | |
514 | 507 | then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated.")) | |
515 | 508 | else { | |
516 | 509 | let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)))) | |
517 | 510 | let amountAssetsDecimals = if ((amountAssetStr == "WAVES")) | |
518 | 511 | then decimalsMultPrice | |
519 | 512 | else pow(10, 0, value(assetInfo(fromBase58String(amountAssetStr))).decimals, 0, 0, DOWN) | |
520 | 513 | let priceAssetsDecimals = if ((priceAssetStr == "WAVES")) | |
521 | 514 | then decimalsMultPrice | |
522 | 515 | else pow(10, 0, value(assetInfo(fromBase58String(priceAssetStr))).decimals, 0, 0, DOWN) | |
523 | 516 | let lpAssetIssueAction = Issue(lpAssetName, lpAssetDescr, 1, 8, true) | |
524 | 517 | let lpAssetId = calculateAssetId(lpAssetIssueAction) | |
525 | 518 | let lpAssetIdStr = toBase58String(lpAssetId) | |
526 | 519 | let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr], nil) | |
527 | 520 | if ((poolActivateInvokeResult == poolActivateInvokeResult)) | |
528 | 521 | then if ((poolActivateInvokeResult != "success")) | |
529 | 522 | then throw("Pool initialisation error happened.") | |
530 | 523 | else { | |
531 | 524 | let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract())) | |
532 | 525 | let createOrUpdateLpAssetInv = invoke(assetsStoreContract, "createOrUpdate", [lpAssetIdStr, lpAssetName, false], nil) | |
533 | 526 | if ((createOrUpdateLpAssetInv == createOrUpdateLpAssetInv)) | |
534 | 527 | then { | |
535 | 528 | let addPoolsLpLabelInv = invoke(assetsStoreContract, "addLabel", [lpAssetIdStr, labelPoolsLp], nil) | |
536 | 529 | if ((addPoolsLpLabelInv == addPoolsLpLabelInv)) | |
537 | 530 | then { | |
538 | 531 | let setLogoInv = invoke(assetsStoreContract, "setLogo", [lpAssetIdStr, logo], nil) | |
539 | 532 | if ((setLogoInv == setLogoInv)) | |
540 | 533 | then { | |
541 | 534 | let addAssetsLinkInv = invoke(assetsStoreContract, "addAssetsLink", [amountAssetStr, priceAssetStr, lpAssetIdStr], nil) | |
542 | 535 | if ((addAssetsLinkInv == addAssetsLinkInv)) | |
543 | 536 | then { | |
544 | 537 | let increaseAssetPoolsNumberInv = invoke(assetsStoreContract, "increaseAssetPoolsNumber", [amountAssetStr], nil) | |
545 | 538 | if ((increaseAssetPoolsNumberInv == increaseAssetPoolsNumberInv)) | |
546 | 539 | then $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [lpAssetIssueAction, Burn(lpAssetId, 1), StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, decimalsMultPrice, poolType)), StringEntry(keyMappingLpAssetToPoolAssets(lpAssetIdStr), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToLpasset(toString(internalAmountAssetId), toString(internalPriceAssetId)), ("%s__" + lpAssetIdStr)), StringEntry(keyMappingPoolContractAddressToPoolAssets(poolAddress), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToPoolContractAddress(internalAmountAssetId, internalPriceAssetId), poolAddress), StringEntry(keyMappingPoolLPAssetToPoolContractAddress(lpAssetIdStr), poolAddress), StringEntry(keyMappingPoolContractToLPAsset(poolAddress), lpAssetIdStr), IntegerEntry(keyPoolToWeight(poolAddress), poolWeight), IntegerEntry(keyPoolSpread(poolAddress), defaultSpread)]), lpAssetIdStr) | |
547 | 540 | else throw("Strict value is not equal to itself.") | |
548 | 541 | } | |
549 | 542 | else throw("Strict value is not equal to itself.") | |
550 | 543 | } | |
551 | 544 | else throw("Strict value is not equal to itself.") | |
552 | 545 | } | |
553 | 546 | else throw("Strict value is not equal to itself.") | |
554 | 547 | } | |
555 | 548 | else throw("Strict value is not equal to itself.") | |
556 | 549 | } | |
557 | 550 | else throw("Strict value is not equal to itself.") | |
558 | 551 | } | |
559 | 552 | } | |
560 | 553 | else throw("Strict value is not equal to itself.") | |
561 | 554 | } | |
562 | 555 | ||
563 | 556 | ||
564 | 557 | ||
565 | 558 | @Callable(i) | |
566 | 559 | func managePool (poolAddress,newStatus) = { | |
567 | 560 | let checkCaller = mustManager(i) | |
568 | 561 | if ((checkCaller == checkCaller)) | |
569 | 562 | then { | |
570 | 563 | let poolConfig = getPoolConfig(poolAddress) | |
571 | 564 | let poolStatus = poolConfig[idxPoolStatus] | |
572 | 565 | let lpAssetIdStr = poolConfig[idxPoolLPAssetId] | |
573 | 566 | let amountAssetStr = poolConfig[idxAmtAssetId] | |
574 | 567 | let priceAssetStr = poolConfig[idxPriceAssetId] | |
575 | 568 | let amountAssetsDecimals = parseIntValue(poolConfig[idxAmtAssetDcm]) | |
576 | 569 | let priceAssetsDecimals = parseIntValue(poolConfig[idxPriceAssetDcm]) | |
577 | 570 | let internalAmountAssetId = parseIntValue(poolConfig[idxIAmtAssetId]) | |
578 | 571 | let internalPriceAssetId = parseIntValue(poolConfig[idxIPriceAssetId]) | |
579 | 572 | let lpAssetDcm = parseIntValue(poolConfig[idxLPAssetDcm]) | |
580 | 573 | let poolType = poolConfig[idxPoolType] | |
581 | 574 | [StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(newStatus), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, lpAssetDcm, poolType))] | |
582 | 575 | } | |
583 | 576 | else throw("Strict value is not equal to itself.") | |
584 | 577 | } | |
585 | 578 | ||
586 | 579 | ||
587 | 580 | ||
588 | 581 | @Callable(i) | |
589 | 582 | func emit (amountToEmit) = { | |
590 | 583 | let caller = i.caller | |
591 | 584 | let originCaller = i.originCaller | |
592 | 585 | let lpAssetRequested = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.") | |
593 | 586 | let lpAsset = fromBase58String(lpAssetRequested) | |
594 | 587 | let legacyPools = split(valueOrElse(getString(keyLegacyPools()), EMPTY), SEP) | |
595 | 588 | let legacyFactoryContract = addressFromStringValue(valueOrErrorMessage(getString(keyLegacyFactoryContract()), "Legacy factory contract does not exists.")) | |
596 | 589 | if ((0 >= amountToEmit)) | |
597 | 590 | then nil | |
598 | 591 | else if (containsElement(legacyPools, toString(caller))) | |
599 | 592 | then $Tuple2(nil, legacyFactoryContract) | |
600 | 593 | else $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success") | |
601 | 594 | } | |
602 | 595 | ||
603 | 596 | ||
604 | 597 | ||
605 | 598 | @Callable(i) | |
606 | 599 | func burn (amountToBurn) = { | |
607 | 600 | let caller = i.caller | |
608 | 601 | let originCaller = i.originCaller | |
609 | 602 | let payment = value(i.payments[0]) | |
610 | 603 | let paymentAmount = value(payment.amount) | |
611 | 604 | let inAmountAssetId = toBase58String(value(payment.assetId)) | |
612 | 605 | let lpAssetRequestedForBurning = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.") | |
613 | 606 | if ((inAmountAssetId != lpAssetRequestedForBurning)) | |
614 | 607 | then throw("Invalid asset passed.") | |
615 | 608 | else if ((amountToBurn != paymentAmount)) | |
616 | 609 | then throw("Invalid amount passed.") | |
617 | 610 | else { | |
618 | 611 | let lpAsset = fromBase58String(lpAssetRequestedForBurning) | |
619 | 612 | $Tuple2([Burn(lpAsset, amountToBurn)], "success") | |
620 | 613 | } | |
621 | 614 | } | |
622 | 615 | ||
623 | 616 | ||
624 | 617 | ||
625 | 618 | @Callable(i) | |
626 | 619 | func modifyWeight (lpAssetId,share) = { | |
627 | 620 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
628 | 621 | then true | |
629 | 622 | else mustManager(i) | |
630 | 623 | if ((checkCaller == checkCaller)) | |
631 | 624 | then { | |
632 | 625 | let poolContractAddress = getStringOrFail(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId)) | |
633 | 626 | let poolWeightKey = keyPoolToWeight(poolContractAddress) | |
634 | 627 | let gwxWeightKey = keyPoolToWeight(GWXvirtualPOOL) | |
635 | 628 | let gwxWeight = valueOrElse(getInteger(gwxWeightKey), 0) | |
636 | 629 | let poolWeight = valueOrElse(getInteger(poolWeightKey), 0) | |
637 | 630 | let poolWeightNew = share | |
638 | 631 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
639 | 632 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
640 | 633 | let onModifyWeightInv = invoke(stakingContract, "onModifyWeight", [lpAssetId, poolContractAddress], nil) | |
641 | 634 | if ((onModifyWeightInv == onModifyWeightInv)) | |
642 | 635 | then { | |
643 | 636 | let gwxVirtualPoolActions = if ((gwxWeight == 0)) | |
644 | 637 | then nil | |
645 | 638 | else [IntegerEntry(gwxWeightKey, 0)] | |
646 | 639 | let poolWeightHistoryKey = keyPoolToWeightHistory(poolContractAddress, 0) | |
647 | 640 | let poolWeightHistoryOrUnit = getInteger(poolWeightHistoryKey) | |
648 | 641 | let poolWeightHistoryActions = if ((poolWeightHistoryOrUnit == unit)) | |
649 | 642 | then nil | |
650 | 643 | else [DeleteEntry(poolWeightHistoryKey)] | |
651 | 644 | (([IntegerEntry(poolWeightKey, poolWeightNew)] ++ gwxVirtualPoolActions) ++ poolWeightHistoryActions) | |
652 | 645 | } | |
653 | 646 | else throw("Strict value is not equal to itself.") | |
654 | 647 | } | |
655 | 648 | else throw("Strict value is not equal to itself.") | |
656 | 649 | } | |
657 | 650 | ||
658 | 651 | ||
659 | 652 | ||
660 | 653 | @Callable(i) | |
661 | 654 | func modifyWeights (btcPoolAddress,ethPoolAddress,ethBtcPoolAddress,usdcUsdtPoolAddress) = { | |
662 | 655 | let checkCaller = mustManager(i) | |
663 | 656 | if ((checkCaller == checkCaller)) | |
664 | 657 | then { | |
665 | 658 | let ethBtcWeightNew = ((5 * POOLWEIGHTMULT) / 100) | |
666 | 659 | let usdcUsdtWeightNew = ((5 * POOLWEIGHTMULT) / 100) | |
667 | 660 | let weightDecrement = ((5 * POOLWEIGHTMULT) / 100) | |
668 | 661 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
669 | 662 | let stakingDapp = getStakingAddressOrFail(factoryCfg) | |
670 | 663 | let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg) | |
671 | 664 | let btcWeightKEY = keyPoolToWeight(btcPoolAddress) | |
672 | 665 | let ethWeightKEY = keyPoolToWeight(ethPoolAddress) | |
673 | 666 | let ethBtcWeightKEY = keyPoolToWeight(ethBtcPoolAddress) | |
674 | 667 | let usdcUsdtWeightKEY = keyPoolToWeight(usdcUsdtPoolAddress) | |
675 | 668 | let btcWeight = getIntOrFail(btcWeightKEY) | |
676 | 669 | let ethWeight = getIntOrFail(ethWeightKEY) | |
677 | 670 | let btcWeightNew = (btcWeight - weightDecrement) | |
678 | 671 | let ethWeightNew = (ethWeight - weightDecrement) | |
679 | 672 | if ((0 >= btcWeightNew)) | |
680 | 673 | then throw(("invalid btcWeightNew: " + toString(btcWeightNew))) | |
681 | 674 | else if ((0 >= ethWeightNew)) | |
682 | 675 | then throw(("invalid ethWeightNew: " + toString(ethWeightNew))) | |
683 | 676 | else { | |
684 | 677 | let btcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(btcPoolAddress)) | |
685 | 678 | let ethLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethPoolAddress)) | |
686 | 679 | let ethBtcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethBtcPoolAddress)) | |
687 | 680 | let usdcUsdtLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(usdcUsdtPoolAddress)) | |
688 | 681 | let onModifyWeightBtc = invoke(stakingDapp, "onModifyWeight", [btcLpAssetIdStr, btcPoolAddress], nil) | |
689 | 682 | if ((onModifyWeightBtc == onModifyWeightBtc)) | |
690 | 683 | then { | |
691 | 684 | let onModifyWeightEth = invoke(stakingDapp, "onModifyWeight", [ethLpAssetIdStr, ethPoolAddress], nil) | |
692 | 685 | if ((onModifyWeightEth == onModifyWeightEth)) | |
693 | 686 | then { | |
694 | 687 | let onModifyWeightEthBtc = invoke(stakingDapp, "onModifyWeight", [ethBtcLpAssetIdStr, ethBtcPoolAddress], nil) | |
695 | 688 | if ((onModifyWeightEthBtc == onModifyWeightEthBtc)) | |
696 | 689 | then { | |
697 | 690 | let onModifyWeightUsdcUsdt = invoke(stakingDapp, "onModifyWeight", [usdcUsdtLpAssetIdStr, usdcUsdtPoolAddress], nil) | |
698 | 691 | if ((onModifyWeightUsdcUsdt == onModifyWeightUsdcUsdt)) | |
699 | 692 | then [IntegerEntry(btcWeightKEY, btcWeightNew), IntegerEntry(ethWeightKEY, ethWeightNew), IntegerEntry(ethBtcWeightKEY, ethBtcWeightNew), IntegerEntry(usdcUsdtWeightKEY, usdcUsdtWeightNew), IntegerEntry(keyPoolToWeightHistory(btcPoolAddress, 0), btcWeight), IntegerEntry(keyPoolToWeightHistory(ethPoolAddress, 0), ethWeight), IntegerEntry(keyPoolToWeightHistory(ethBtcPoolAddress, 0), ethBtcWeightNew), IntegerEntry(keyPoolToWeightHistory(usdcUsdtPoolAddress, 0), usdcUsdtWeightNew)] | |
700 | 693 | else throw("Strict value is not equal to itself.") | |
701 | 694 | } | |
702 | 695 | else throw("Strict value is not equal to itself.") | |
703 | 696 | } | |
704 | 697 | else throw("Strict value is not equal to itself.") | |
705 | 698 | } | |
706 | 699 | else throw("Strict value is not equal to itself.") | |
707 | 700 | } | |
708 | 701 | } | |
709 | 702 | else throw("Strict value is not equal to itself.") | |
710 | 703 | } | |
711 | 704 | ||
712 | 705 | ||
713 | 706 | ||
714 | 707 | @Callable(i) | |
715 | 708 | func checkWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
716 | 709 | let haveLabel = match getBoolean(keyWxEmission(amountAssetId, priceAssetId)) { | |
717 | 710 | case b: Boolean => | |
718 | 711 | b | |
719 | 712 | case _ => | |
720 | 713 | false | |
721 | 714 | } | |
722 | 715 | $Tuple2(nil, haveLabel) | |
723 | 716 | } | |
724 | 717 | ||
725 | 718 | ||
726 | 719 | ||
727 | 720 | @Callable(i) | |
728 | 721 | func setWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
729 | 722 | let checkCaller = mustAdmin(i) | |
730 | 723 | if ((checkCaller == checkCaller)) | |
731 | 724 | then $Tuple2([BooleanEntry(keyWxEmission(amountAssetId, priceAssetId), true)], unit) | |
732 | 725 | else throw("Strict value is not equal to itself.") | |
733 | 726 | } | |
734 | 727 | ||
735 | 728 | ||
736 | 729 | ||
737 | 730 | @Callable(i) | |
738 | 731 | func deleteWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
739 | 732 | let checkCaller = if (mustThis(i)) | |
740 | 733 | then true | |
741 | 734 | else mustAdmin(i) | |
742 | 735 | if ((checkCaller == checkCaller)) | |
743 | 736 | then $Tuple2([DeleteEntry(keyWxEmission(amountAssetId, priceAssetId))], unit) | |
744 | 737 | else throw("Strict value is not equal to itself.") | |
745 | 738 | } | |
746 | 739 | ||
747 | 740 | ||
748 | 741 | ||
749 | 742 | @Callable(i) | |
750 | 743 | func onVerificationLoss (assetId) = { | |
751 | 744 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyAssetsStoreContract()), ""))) | |
752 | 745 | then true | |
753 | 746 | else mustManager(i) | |
754 | 747 | if ((checkCaller == checkCaller)) | |
755 | 748 | then { | |
756 | 749 | let priceAssets = getPriceAssets() | |
757 | 750 | let checkPriceAssetsSize = if ((size(priceAssets) > 0)) | |
758 | 751 | then true | |
759 | 752 | else throw("invalid price assets") | |
760 | 753 | if ((checkPriceAssetsSize == checkPriceAssetsSize)) | |
761 | 754 | then { | |
762 | 755 | func cb (acc,priceAsset) = { | |
763 | 756 | let r = invoke(this, "deleteWxEmissionPoolLabel", [assetId, priceAsset], nil) | |
764 | 757 | if ((r == r)) | |
765 | 758 | then unit | |
766 | 759 | else throw("Strict value is not equal to itself.") | |
767 | 760 | } | |
768 | 761 | ||
769 | 762 | let actions = { | |
770 | 763 | let $l = priceAssets | |
771 | 764 | let $s = size($l) | |
772 | 765 | let $acc0 = unit | |
773 | 766 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
774 | 767 | then $a | |
775 | 768 | else cb($a, $l[$i]) | |
776 | 769 | ||
777 | 770 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
778 | 771 | then $a | |
779 | - | else throw("List size exceeds | |
772 | + | else throw("List size exceeds 1") | |
780 | 773 | ||
781 | - | $f0_2($f0_1($ | |
774 | + | $f0_2($f0_1($acc0, 0), 1) | |
782 | 775 | } | |
783 | 776 | if ((actions == actions)) | |
784 | 777 | then $Tuple2(nil, unit) | |
785 | 778 | else throw("Strict value is not equal to itself.") | |
786 | 779 | } | |
787 | 780 | else throw("Strict value is not equal to itself.") | |
788 | 781 | } | |
789 | 782 | else throw("Strict value is not equal to itself.") | |
790 | 783 | } | |
791 | 784 | ||
792 | 785 | ||
793 | 786 | ||
794 | 787 | @Callable(i) | |
795 | 788 | func isPoolOneTokenOperationsDisabledREADONLY (poolAddress) = { | |
796 | 789 | let poolConfig = getPoolConfig(poolAddress) | |
797 | 790 | let assetsInternal = $Tuple2(parseIntValue(poolConfig[idxIAmtAssetId]), parseIntValue(poolConfig[idxIPriceAssetId])) | |
798 | 791 | let poolOneTokenOperationsDisabled = valueOrElse(getBoolean(keyPoolOneTokenOperationsDisabled(assetsInternal)), false) | |
799 | 792 | let allPoolsOneTokenOperationsDisabled = valueOrElse(getBoolean(keyAllPoolsOneTokenOperationsDisabled()), false) | |
800 | 793 | $Tuple2(nil, if (allPoolsOneTokenOperationsDisabled) | |
801 | 794 | then true | |
802 | 795 | else poolOneTokenOperationsDisabled) | |
803 | 796 | } | |
804 | 797 | ||
805 | 798 | ||
806 | 799 | ||
807 | 800 | @Callable(i) | |
808 | 801 | func getInFeeREADONLY (poolAddress) = { | |
809 | 802 | let fee = intOrDefaultOrFallback(keyInFee(poolAddress), keyInFeeDefault(), 0) | |
810 | 803 | $Tuple2(nil, fee) | |
811 | 804 | } | |
812 | 805 | ||
813 | 806 | ||
814 | 807 | ||
815 | 808 | @Callable(i) | |
816 | 809 | func getOutFeeREADONLY (poolAddress) = { | |
817 | 810 | let fee = intOrDefaultOrFallback(keyOutFee(poolAddress), keyOutFeeDefault(), fraction(10, MULT8, 10000)) | |
818 | 811 | $Tuple2(nil, fee) | |
819 | 812 | } | |
820 | 813 | ||
821 | 814 | ||
822 | 815 | ||
823 | 816 | @Callable(i) | |
824 | - | func poolInfoREADONLY (amountAssetIdStr,priceAssetIdStr) = { | |
825 | - | let amountAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(amountAssetIdStr)) | |
826 | - | let priceAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(priceAssetIdStr)) | |
827 | - | let poolContractAddressOption = getString(this, keyMappingPoolAssetsToPoolContractAddress(value(amountAssetInternalIdOption), value(priceAssetInternalIdOption))) | |
828 | - | let lpAssetIdOption = getString(this, keyMappingPoolContractToLPAsset(value(poolContractAddressOption))) | |
829 | - | let poolExists = if (if (isDefined(amountAssetInternalIdOption)) | |
830 | - | then isDefined(priceAssetInternalIdOption) | |
831 | - | else false) | |
832 | - | then isDefined(poolContractAddressOption) | |
833 | - | else false | |
834 | - | let poolInfo = if (poolExists) | |
835 | - | then $Tuple2(addressFromStringValue(value(poolContractAddressOption)), parseAssetId(value(lpAssetIdOption))) | |
836 | - | else unit | |
837 | - | $Tuple2(nil, poolInfo) | |
838 | - | } | |
839 | - | ||
840 | - | ||
841 | - | ||
842 | - | @Callable(i) | |
843 | 817 | func getPoolStatusREADONLY (poolAddress) = { | |
844 | 818 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
845 | 819 | let amountAssetInternal = poolAssets[1] | |
846 | 820 | let priceAssetInternal = poolAssets[2] | |
847 | 821 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
848 | 822 | $Tuple2(nil, parseIntValue(cfg[idxPoolStatus])) | |
849 | 823 | } | |
850 | 824 | ||
851 | 825 | ||
852 | 826 | ||
853 | 827 | @Callable(i) | |
854 | - | func | |
855 | - | let poolAssets = split(getStringOrFail( | |
828 | + | func getPoolConfigByLpAssetId (lpAssetIdStr) = { | |
829 | + | let poolAssets = split(getStringOrFail(keyMappingLpAssetToPoolAssets(lpAssetIdStr)), SEP) | |
856 | 830 | let amountAssetInternal = poolAssets[1] | |
857 | 831 | let priceAssetInternal = poolAssets[2] | |
858 | 832 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
859 | 833 | $Tuple2(nil, cfg) | |
860 | 834 | } | |
861 | 835 | ||
862 | 836 | ||
863 | 837 | ||
864 | 838 | @Callable(i) | |
865 | 839 | func poolExistsREADONLY (amountAssetId,priceAssetId) = $Tuple2(nil, poolExistsInternal(amountAssetId, priceAssetId)) | |
866 | 840 | ||
867 | 841 | ||
868 | 842 | @Verifier(tx) | |
869 | 843 | func verify () = { | |
870 | 844 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
871 | 845 | case pk: ByteVector => | |
872 | 846 | pk | |
873 | 847 | case _: Unit => | |
874 | 848 | tx.senderPublicKey | |
875 | 849 | case _ => | |
876 | 850 | throw("Match error") | |
877 | 851 | } | |
878 | 852 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
879 | 853 | } | |
880 | 854 |
github/deemru/w8io/026f985 83.07 ms ◑