tx · Hq3mHhyHMsFTuKgWdnnt7QqhyH85D6rcXb935hqM2NfL 3NAjQe2oftbbXELAQvhGzrWEPzQQdUxCiyZ: -0.01000000 Waves 2021.09.09 23:28 [1695992] smart account 3NAjQe2oftbbXELAQvhGzrWEPzQQdUxCiyZ > SELF 0.00000000 Waves
{ "type": 13, "id": "Hq3mHhyHMsFTuKgWdnnt7QqhyH85D6rcXb935hqM2NfL", "fee": 1000000, "feeAssetId": null, "timestamp": 1631219374103, "version": 2, "chainId": 84, "sender": "3NAjQe2oftbbXELAQvhGzrWEPzQQdUxCiyZ", "senderPublicKey": "9KWqKQnpzzXWBigpYicckMZ6kd3PpbvvGwTpbJejqcHz", "proofs": [ "2JvSbGEG5cuS6hMggQjpCahEMndPh9oD85AGWiJvvp7mwdbQ9k46eW6sGrTPQNHuyGY3vSwLrod628SZMjSSPJVg" ], "script": "base64:AAIFAAAAAAAADY4IAhIDCgEEEgcKBQEBCAgEEgMKAQESAwoBARIAEgMKAQESABIAEgMKAQEaDQoCYTESB3ZlcnNpb24aEAoCYTISCmtleVZlcnNpb24aDwoCYTMSCWtleUFjdGl2ZRoRCgJhNBILa2V5QXNzZXRJZEEaEQoCYTUSC2tleUFzc2V0SWRCGhEKAmE2EgtrZXlCYWxhbmNlQRoRCgJhNxILa2V5QmFsYW5jZUIaFQoCYTgSD2tleUJhbGFuY2VJbml0QRoVCgJhORIPa2V5QmFsYW5jZUluaXRCGhUKAmIxEg9rZXlTaGFyZUFzc2V0SWQaGQoCYjISE2tleVNoYXJlQXNzZXRTdXBwbHkaEwoCYjMSDWtleUNvbW1pc3Npb24aIQoCYjQSG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlchoOCgJiNRIIa2V5Q2F1c2UaFQoCYjYSD2tleUZpcnN0SGFydmVzdBobCgJiNxIVa2V5Rmlyc3RIYXJ2ZXN0SGVpZ2h0GhEKAmI4EgtrU2hhcmVMaW1pdBoRCgJiORILa0Jhc2VQZXJpb2QaEwoCYzESDWtQ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AABmAAAAAgAAAAAAAAAAAAUAAAACcjkJAAACAAAAAQkAASwAAAACAgAAADNBcmd1bWVudCAnYW1vdW50TGVhdmUnIGNhbm5vdCBiZSBuZWdhdGl2ZS4gQWN0dWFsOiAJAAGkAAAAAQUAAAACcjkDAwkAAGYAAAACAAAAAAAAAAAABQAAAAJzMQYJAABmAAAAAgAAAAAAAAAAAAUAAAACczIJAQAAAAJrMgAAAAECAAAAFkVucm9sbCBhbW91bnQgbmVnYXRpdmUDAwkAAGYAAAACAAAAAAAAAAAABQAAAAJzMwYJAABmAAAAAgAAAAAAAAAAAAUAAAACczQJAAACAAAAAQIAAAAVVG9vIGxhcmdlIGFtb3VudExlYXZlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAJhNgkAAGQAAAACBQAAAAJnNwUAAAACczMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAAmE3CQAAZAAAAAIFAAAAAmc4BQAAAAJzNAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxsYXN0X2luY29tZV8FAAAAAmY4BQAAAAJzMwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxsYXN0X2luY29tZV8FAAAAAmY5BQAAAAJzNAUAAAADbmlsAAAAAEM7IsM=", "height": 1695992, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C1i2oC5Vn9YqeVhi4f32q5pTekMH4REVv85KegRXjoxp Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "1.0.0" | |
5 | 5 | ||
6 | 6 | let keyVersion = "version" | |
7 | 7 | ||
8 | 8 | let keyActive = "active" | |
9 | 9 | ||
10 | 10 | let keyAssetIdA = "A_asset_id" | |
11 | 11 | ||
12 | 12 | let keyAssetIdB = "B_asset_id" | |
13 | 13 | ||
14 | 14 | let keyBalanceA = "A_asset_balance" | |
15 | 15 | ||
16 | 16 | let keyBalanceB = "B_asset_balance" | |
17 | 17 | ||
18 | 18 | let keyBalanceInitA = "A_asset_init" | |
19 | 19 | ||
20 | 20 | let keyBalanceInitB = "B_asset_init" | |
21 | 21 | ||
22 | 22 | let keyShareAssetId = "share_asset_id" | |
23 | 23 | ||
24 | 24 | let keyShareAssetSupply = "share_asset_supply" | |
25 | 25 | ||
26 | 26 | let keyCommission = "commission" | |
27 | 27 | ||
28 | 28 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
29 | 29 | ||
30 | 30 | let keyCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let keyFirstHarvest = "first_harvest" | |
33 | 33 | ||
34 | 34 | let keyFirstHarvestHeight = "first_harvest_height" | |
35 | 35 | ||
36 | 36 | let kShareLimit = "share_limit_on_first_harvest" | |
37 | 37 | ||
38 | 38 | let kBasePeriod = "base_period" | |
39 | 39 | ||
40 | 40 | let kPeriodLength = "period_length" | |
41 | 41 | ||
42 | 42 | let kStartHeight = "start_height" | |
43 | 43 | ||
44 | 44 | let kFirstHarvestHeight = "first_harvest_height" | |
45 | 45 | ||
46 | 46 | let keyAdminPubKey1 = "admin_pub_1" | |
47 | 47 | ||
48 | 48 | let keyAdminPubKey2 = "admin_pub_2" | |
49 | 49 | ||
50 | 50 | let keyAdminPubKey3 = "admin_pub_3" | |
51 | 51 | ||
52 | 52 | let oracle = Address(base58'3PEbqViERCoKnmcSULh6n2aiMvUdSQdCsom') | |
53 | 53 | ||
54 | 54 | func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) { | |
55 | 55 | case string: String => | |
56 | 56 | fromBase58String(string) | |
57 | 57 | case nothing => | |
58 | 58 | throw("Admin public key is empty") | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | let adminPubKey1 = getAdminPub(keyAdminPubKey1) | |
63 | 63 | ||
64 | 64 | let adminPubKey2 = getAdminPub(keyAdminPubKey2) | |
65 | 65 | ||
66 | 66 | let adminPubKey3 = getAdminPub(keyAdminPubKey3) | |
67 | 67 | ||
68 | 68 | let adminPubKeyStartStop = base58'EtVkT6ed8GtbUiVVEqdmEqsp2J4qbb3rre2HFgxeVYdg' | |
69 | 69 | ||
70 | 70 | let adminPubKeyStaking = base58'Czn4yoAuUZCVCLJDRfskn8URfkwpknwBTZDbs1wFrY7h' | |
71 | 71 | ||
72 | 72 | let walletAddress = Address(base58'3N7cz2aJBxu3DpGVZnaHj8J479JBiEhdqsw') | |
73 | 73 | ||
74 | 74 | let votingAddress = Address(base58'3N7cz2aJBxu3DpGVZnaHj8J479JBiEhdqsw') | |
75 | 75 | ||
76 | 76 | let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
77 | 77 | ||
78 | 78 | let NSBT = base58'6nSpVyNH7yM69eg446wrQR94ipbbcmZMU1ENPwanC97g' | |
79 | 79 | ||
80 | 80 | let SWOP = base58'Ehie5xYpeN8op1Cctc6aGUrqx8jq3jtf1DSjXDbfm7aT' | |
81 | 81 | ||
82 | 82 | let EURN = base58'DUk2YTxhRoAqMJLus4G2b3fR8hMHVh6eiyFx5r29VR6t' | |
83 | 83 | ||
84 | 84 | let stakingUSDNNSBTAddress = Address(base58'3PNikM6yp4NqcSU8guxQtmR5onr2D4e8yTJ') | |
85 | 85 | ||
86 | 86 | let stakingEURNAddress = Address(base58'3PFhcMmEZoQTQ6ohA844c7C9M8ZJ18P8dDj') | |
87 | 87 | ||
88 | 88 | let USDNToWavesExchanger = Address(base58'3PHaNgomBkrvEL2QnuJarQVJa71wjw9qiqG') | |
89 | 89 | ||
90 | 90 | let USDNToNSBTExchanger = Address(base58'3P2V63Xd6BviDkeMzxhUw2SJyojByRz8a8m') | |
91 | 91 | ||
92 | 92 | let stakingFeeInUSDN = 270000 | |
93 | 93 | ||
94 | 94 | let stakingFeeInEURN = 234000 | |
95 | 95 | ||
96 | 96 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
97 | 97 | ||
98 | 98 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
99 | 99 | ||
100 | 100 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
101 | 101 | ||
102 | 102 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
103 | 103 | ||
104 | 104 | let isActive = getBooleanValue(this, keyActive) | |
105 | 105 | ||
106 | 106 | let strAssetIdA = getStringValue(this, keyAssetIdA) | |
107 | 107 | ||
108 | 108 | let strAssetIdB = getStringValue(this, keyAssetIdB) | |
109 | 109 | ||
110 | 110 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
111 | 111 | then unit | |
112 | 112 | else fromBase58String(strAssetIdA) | |
113 | 113 | ||
114 | 114 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
115 | 115 | then unit | |
116 | 116 | else fromBase58String(strAssetIdB) | |
117 | 117 | ||
118 | 118 | let assetNameA = match assetIdA { | |
119 | 119 | case id: ByteVector => | |
120 | 120 | value(assetInfo(id)).name | |
121 | 121 | case waves: Unit => | |
122 | 122 | "WAVES" | |
123 | 123 | case _ => | |
124 | 124 | throw("Match error") | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | let assetNameB = match assetIdB { | |
128 | 128 | case id: ByteVector => | |
129 | 129 | value(assetInfo(id)).name | |
130 | 130 | case waves: Unit => | |
131 | 131 | "WAVES" | |
132 | 132 | case _ => | |
133 | 133 | throw("Match error") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | let balanceA = getIntegerValue(this, keyBalanceA) | |
137 | 137 | ||
138 | 138 | let balanceB = getIntegerValue(this, keyBalanceB) | |
139 | 139 | ||
140 | 140 | let shareAssetId = fromBase58String(getStringValue(this, keyShareAssetId)) | |
141 | 141 | ||
142 | 142 | let shareAssetSupply = getIntegerValue(this, keyShareAssetSupply) | |
143 | 143 | ||
144 | 144 | let commission = 3000 | |
145 | 145 | ||
146 | 146 | let commissionGovernance = 1200 | |
147 | 147 | ||
148 | 148 | let commissionScaleDelimiter = 1000000 | |
149 | 149 | ||
150 | 150 | let scaleValue3 = 1000 | |
151 | 151 | ||
152 | 152 | let scaleValue8 = 100000000 | |
153 | 153 | ||
154 | 154 | let slippageToleranceDelimiter = 1000 | |
155 | 155 | ||
156 | 156 | let scaleValue8Digits = 8 | |
157 | 157 | ||
158 | 158 | func accountBalance (assetId) = match assetId { | |
159 | 159 | case id: ByteVector => | |
160 | 160 | assetBalance(this, id) | |
161 | 161 | case waves: Unit => | |
162 | 162 | wavesBalance(this).available | |
163 | 163 | case _ => | |
164 | 164 | throw("Match error") | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func stakedAmount (assetId) = { | |
169 | 169 | let stakedAmountCalculated = match assetId { | |
170 | 170 | case aId: ByteVector => | |
171 | 171 | if (if ((aId == USDN)) | |
172 | 172 | then true | |
173 | 173 | else (aId == NSBT)) | |
174 | 174 | then getInteger(stakingUSDNNSBTAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
175 | 175 | else if ((aId == EURN)) | |
176 | 176 | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(this))) | |
177 | 177 | else 0 | |
178 | 178 | case _: Unit => | |
179 | 179 | 0 | |
180 | 180 | case _ => | |
181 | 181 | throw("Match error") | |
182 | 182 | } | |
183 | 183 | match stakedAmountCalculated { | |
184 | 184 | case i: Int => | |
185 | 185 | i | |
186 | 186 | case _ => | |
187 | 187 | 0 | |
188 | 188 | } | |
189 | 189 | } | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | let stakedAmountA = stakedAmount(assetIdA) | |
193 | 193 | ||
194 | 194 | let stakedAmountB = stakedAmount(assetIdB) | |
195 | 195 | ||
196 | 196 | let assetInitA = getIntegerValue(this, keyBalanceInitA) | |
197 | 197 | ||
198 | 198 | let assetInitB = getIntegerValue(this, keyBalanceInitB) | |
199 | 199 | ||
200 | 200 | let availableBalanceA = (balanceA - stakedAmountA) | |
201 | 201 | ||
202 | 202 | let availableBalanceB = (balanceB - stakedAmountB) | |
203 | 203 | ||
204 | 204 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
205 | 205 | ||
206 | 206 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
207 | 207 | ||
208 | 208 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
209 | 209 | then (accountBalanceWithStakedB >= balanceB) | |
210 | 210 | else false | |
211 | 211 | ||
212 | 212 | func getAssetInfo (assetId) = match assetId { | |
213 | 213 | case id: ByteVector => | |
214 | 214 | let stringId = toBase58String(id) | |
215 | 215 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
216 | 216 | $Tuple3(stringId, info.name, info.decimals) | |
217 | 217 | case waves: Unit => | |
218 | 218 | $Tuple3("WAVES", "WAVES", 8) | |
219 | 219 | case _ => | |
220 | 220 | throw("Match error") | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES")) | |
225 | 225 | then $Tuple3("WAVES", "WAVES", 8) | |
226 | 226 | else { | |
227 | 227 | let stringId = assetStr | |
228 | 228 | let id = fromBase58String(assetStr) | |
229 | 229 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
230 | 230 | $Tuple3(stringId, info.name, info.decimals) | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func deductStakingFee (amount,assetId,secondAssetId) = if (if ((assetId == USDN)) | |
238 | 238 | then true | |
239 | 239 | else (assetId == EURN)) | |
240 | 240 | then { | |
241 | 241 | let stakinFee = if ((assetId == USDN)) | |
242 | 242 | then (stakingFeeInUSDN * (if ((secondAssetId == NSBT)) | |
243 | 243 | then 2 | |
244 | 244 | else 1)) | |
245 | 245 | else if ((assetId == EURN)) | |
246 | 246 | then stakingFeeInEURN | |
247 | 247 | else 0 | |
248 | 248 | let result = (amount - stakinFee) | |
249 | 249 | if ((0 >= result)) | |
250 | 250 | then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakinFee)) + "USDN/EURN")) | |
251 | 251 | else result | |
252 | 252 | } | |
253 | 253 | else amount | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func getStakingFee (assetId,secondAssetId) = if ((assetId == USDN)) | |
257 | 257 | then (stakingFeeInUSDN * (if ((secondAssetId == NSBT)) | |
258 | 258 | then 2 | |
259 | 259 | else 1)) | |
260 | 260 | else if ((assetId == EURN)) | |
261 | 261 | then stakingFeeInEURN | |
262 | 262 | else 0 | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func throwInsufficientAvailableBalances (amountA,amountB) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(amountA)) + " ") + assetNameA) + " and ") + toString(amountB)) + " ") + assetNameB) + " due to staking. Available: ") + toString(availableBalanceA)) + " ") + assetNameA) + " and ") + toString(availableBalanceB)) + " ") + assetNameB) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceWithStakedA)) + " ") + assetNameA) + ", ") + toString(accountBalanceWithStakedB)) + " ") + assetNameB) + ". State: ") + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB)) | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | @Callable(i) | |
275 | 275 | func init (firstHarvest) = { | |
276 | 276 | let $t080008077 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
277 | 277 | let pmtAmountA = $t080008077._1 | |
278 | 278 | let pmtAssetIdA = $t080008077._2 | |
279 | 279 | let $t080828159 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
280 | 280 | let pmtAmountB = $t080828159._1 | |
281 | 281 | let pmtAssetIdB = $t080828159._2 | |
282 | 282 | let $t081648241 = getAssetInfo(pmtAssetIdA) | |
283 | 283 | let pmtStrAssetIdA = $t081648241._1 | |
284 | 284 | let pmtAssetNameA = $t081648241._2 | |
285 | 285 | let pmtDecimalsA = $t081648241._3 | |
286 | 286 | let $t082468502 = getAssetInfo(pmtAssetIdB) | |
287 | 287 | let pmtStrAssetIdB = $t082468502._1 | |
288 | 288 | let pmtAssetNameB = $t082468502._2 | |
289 | 289 | let pmtDecimalsB = $t082468502._3 | |
290 | 290 | if (isDefined(getBoolean(this, keyActive))) | |
291 | 291 | then throw("DApp is already active") | |
292 | 292 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
293 | 293 | then throw("Assets must be different") | |
294 | 294 | else { | |
295 | 295 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
296 | 296 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
297 | 297 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
298 | 298 | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
299 | 299 | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
300 | 300 | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
301 | 301 | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
302 | 302 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
303 | 303 | let shareIssueId = calculateAssetId(shareIssue) | |
304 | 304 | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
305 | 305 | if (firstHarvest) | |
306 | 306 | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
307 | 307 | else baseEntry | |
308 | 308 | } | |
309 | 309 | } | |
310 | 310 | ||
311 | 311 | ||
312 | 312 | ||
313 | 313 | @Callable(i) | |
314 | 314 | func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = { | |
315 | 315 | let $t01057910666 = getAssetInfoFromString(strAssetIdA) | |
316 | 316 | let pmtStrAssetIdA = $t01057910666._1 | |
317 | 317 | let pmtAssetNameA = $t01057910666._2 | |
318 | 318 | let pmtDecimalsA = $t01057910666._3 | |
319 | 319 | let $t01067110758 = getAssetInfoFromString(strAssetIdB) | |
320 | 320 | let pmtStrAssetIdB = $t01067110758._1 | |
321 | 321 | let pmtAssetNameB = $t01067110758._2 | |
322 | 322 | let pmtDecimalsB = $t01067110758._3 | |
323 | 323 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
324 | 324 | then throw("Only admin can call this function") | |
325 | 325 | else if (isDefined(getBoolean(this, keyActive))) | |
326 | 326 | then throw("DApp is already active") | |
327 | 327 | else if ((strAssetIdA == strAssetIdB)) | |
328 | 328 | then throw("Assets must be different") | |
329 | 329 | else { | |
330 | 330 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
331 | 331 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
332 | 332 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
333 | 333 | let shareInitialSupply = 0 | |
334 | 334 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
335 | 335 | let shareIssueId = calculateAssetId(shareIssue) | |
336 | 336 | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
337 | 337 | if (firstHarvest) | |
338 | 338 | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
339 | 339 | else baseEntry | |
340 | 340 | } | |
341 | 341 | } | |
342 | 342 | ||
343 | 343 | ||
344 | 344 | ||
345 | 345 | @Callable(i) | |
346 | 346 | func keepLimitForFirstHarvest (shareLimit) = if (!(isActive)) | |
347 | 347 | then throw("DApp is inactive at this moment") | |
348 | 348 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
349 | 349 | then throw("Only admin can call this function") | |
350 | 350 | else [IntegerEntry(kShareLimit, shareLimit)] | |
351 | 351 | ||
352 | 352 | ||
353 | 353 | ||
354 | 354 | @Callable(i) | |
355 | 355 | func replenishWithTwoTokens (slippageTolerance) = { | |
356 | 356 | let pmtAssetIdA = i.payments[0].assetId | |
357 | 357 | let pmtAssetIdB = i.payments[1].assetId | |
358 | 358 | let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA, pmtAssetIdB) | |
359 | 359 | let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB, pmtAssetIdA) | |
360 | 360 | if (if ((balanceA == 0)) | |
361 | 361 | then (balanceB == 0) | |
362 | 362 | else false) | |
363 | 363 | then { | |
364 | 364 | let $t01346913546 = getAssetInfo(pmtAssetIdA) | |
365 | 365 | let pmtStrAssetIdA = $t01346913546._1 | |
366 | 366 | let pmtAssetNameA = $t01346913546._2 | |
367 | 367 | let pmtDecimalsA = $t01346913546._3 | |
368 | 368 | let $t01355513632 = getAssetInfo(pmtAssetIdB) | |
369 | 369 | let pmtStrAssetIdB = $t01355513632._1 | |
370 | 370 | let pmtAssetNameB = $t01355513632._2 | |
371 | 371 | let pmtDecimalsB = $t01355513632._3 | |
372 | 372 | let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB)) | |
373 | 373 | if ((pmtAssetIdA == pmtAssetIdB)) | |
374 | 374 | then throw("Assets must be different") | |
375 | 375 | else { | |
376 | 376 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
377 | 377 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
378 | 378 | if (!(isActive)) | |
379 | 379 | then throw("DApp is inactive at this moment") | |
380 | 380 | else if (if ((0 > slippageTolerance)) | |
381 | 381 | then true | |
382 | 382 | else (slippageTolerance > slippageToleranceDelimiter)) | |
383 | 383 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
384 | 384 | else if ((size(i.payments) != 2)) | |
385 | 385 | then throw("Two attached assets expected") | |
386 | 386 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
387 | 387 | then true | |
388 | 388 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
389 | 389 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
390 | 390 | else if (if ((pmtAssetIdA != assetIdA)) | |
391 | 391 | then true | |
392 | 392 | else (pmtAssetIdB != assetIdB)) | |
393 | 393 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
394 | 394 | else if ((shareInitialSupply == 0)) | |
395 | 395 | then throw("Too small amount to replenish") | |
396 | 396 | else if (!(hasEnoughBalance)) | |
397 | 397 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
398 | 398 | else [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)] | |
399 | 399 | } | |
400 | 400 | } | |
401 | 401 | else { | |
402 | 402 | let tokenRatio = fraction(fraction(balanceA, scaleValue8, pmtAmountA), scaleValue3, fraction(balanceB, scaleValue8, pmtAmountB)) | |
403 | 403 | let ratioShareTokensInA = fraction(pmtAmountA, scaleValue8, balanceA) | |
404 | 404 | let ratioShareTokensInB = fraction(pmtAmountB, scaleValue8, balanceB) | |
405 | 405 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
406 | 406 | if (!(isActive)) | |
407 | 407 | then throw("DApp is inactive at this moment") | |
408 | 408 | else if (if ((0 > slippageTolerance)) | |
409 | 409 | then true | |
410 | 410 | else (slippageTolerance > slippageToleranceDelimiter)) | |
411 | 411 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
412 | 412 | else if ((size(i.payments) != 2)) | |
413 | 413 | then throw("Two attached assets expected") | |
414 | 414 | else if (if ((pmtAssetIdA != assetIdA)) | |
415 | 415 | then true | |
416 | 416 | else (pmtAssetIdB != assetIdB)) | |
417 | 417 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
418 | 418 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
419 | 419 | then true | |
420 | 420 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
421 | 421 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
422 | 422 | else if ((shareTokenToPayAmount == 0)) | |
423 | 423 | then throw("Too small amount to replenish") | |
424 | 424 | else if (!(hasEnoughBalance)) | |
425 | 425 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
426 | 426 | else [IntegerEntry(keyBalanceA, (balanceA + pmtAmountA)), IntegerEntry(keyBalanceB, (balanceB + pmtAmountB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)] | |
427 | 427 | } | |
428 | 428 | } | |
429 | 429 | ||
430 | 430 | ||
431 | 431 | ||
432 | 432 | @Callable(i) | |
433 | 433 | func withdraw () = { | |
434 | 434 | let $t01803118181 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
435 | 435 | let pmtAmount = $t01803118181._1 | |
436 | 436 | let pmtAssetId = $t01803118181._2 | |
437 | 437 | let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA, assetIdB) | |
438 | 438 | let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB, assetIdA) | |
439 | 439 | if (!(isActive)) | |
440 | 440 | then throw("DApp is inactive at this moment") | |
441 | 441 | else if ((size(i.payments) != 1)) | |
442 | 442 | then throw("One attached payment expected") | |
443 | 443 | else if ((pmtAssetId != shareAssetId)) | |
444 | 444 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
445 | 445 | else if (!(hasEnoughBalance)) | |
446 | 446 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
447 | 447 | else if (if ((amountToPayA > availableBalanceA)) | |
448 | 448 | then true | |
449 | 449 | else (amountToPayB > availableBalanceB)) | |
450 | 450 | then throwInsufficientAvailableBalances(amountToPayA, amountToPayB) | |
451 | 451 | else [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
452 | 452 | } | |
453 | 453 | ||
454 | 454 | ||
455 | 455 | ||
456 | 456 | @Callable(i) | |
457 | 457 | func exchange (minAmountToReceive) = { | |
458 | 458 | let $t01940719482 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
459 | 459 | let pmtAmount = $t01940719482._1 | |
460 | 460 | let pmtAssetId = $t01940719482._2 | |
461 | 461 | func calculateFees (tokenFrom,tokenTo) = { | |
462 | 462 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
463 | 463 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
464 | 464 | let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter) | |
465 | 465 | if ((minAmountToReceive > amountWithFee)) | |
466 | 466 | then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive))) | |
467 | 467 | else $Tuple3(amountWithoutFee, amountWithFee, governanceReward) | |
468 | 468 | } | |
469 | 469 | ||
470 | 470 | if (!(isActive)) | |
471 | 471 | then throw("DApp is inactive at this moment") | |
472 | 472 | else if (if ((balanceA == 0)) | |
473 | 473 | then true | |
474 | 474 | else (balanceB == 0)) | |
475 | 475 | then throw("Can't exchange with zero balance") | |
476 | 476 | else if ((0 >= minAmountToReceive)) | |
477 | 477 | then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive))) | |
478 | 478 | else if ((size(i.payments) != 1)) | |
479 | 479 | then throw("One attached payment expected") | |
480 | 480 | else if (!(hasEnoughBalance)) | |
481 | 481 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
482 | 482 | else if ((pmtAssetId == assetIdA)) | |
483 | 483 | then { | |
484 | 484 | let assetIdSend = assetIdB | |
485 | 485 | let $t02075620847 = calculateFees(balanceA, balanceB) | |
486 | 486 | let amountWithoutFee = $t02075620847._1 | |
487 | 487 | let amountWithFee = $t02075620847._2 | |
488 | 488 | let governanceReward = $t02075620847._3 | |
489 | 489 | let newBalanceA = (balanceA + pmtAmount) | |
490 | 490 | let newBalanceB = ((balanceB - amountWithFee) - governanceReward) | |
491 | 491 | if (if ((stakedAmountA >= newBalanceA)) | |
492 | 492 | then true | |
493 | 493 | else (stakedAmountB >= newBalanceB)) | |
494 | 494 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB) | |
495 | 495 | else $Tuple2([IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)], $Tuple2(amountWithFee, assetIdSend)) | |
496 | 496 | } | |
497 | 497 | else if ((pmtAssetId == assetIdB)) | |
498 | 498 | then { | |
499 | 499 | let assetIdSend = assetIdA | |
500 | 500 | let $t02170921800 = calculateFees(balanceB, balanceA) | |
501 | 501 | let amountWithoutFee = $t02170921800._1 | |
502 | 502 | let amountWithFee = $t02170921800._2 | |
503 | 503 | let governanceReward = $t02170921800._3 | |
504 | 504 | let newBalanceA = ((balanceA - amountWithFee) - governanceReward) | |
505 | 505 | let newBalanceB = (balanceB + pmtAmount) | |
506 | 506 | if (if ((stakedAmountA >= newBalanceA)) | |
507 | 507 | then true | |
508 | 508 | else (stakedAmountB >= newBalanceB)) | |
509 | 509 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA) | |
510 | 510 | else $Tuple2([IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)], $Tuple2(amountWithFee, assetIdSend)) | |
511 | 511 | } | |
512 | 512 | else throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
513 | 513 | } | |
514 | 514 | ||
515 | 515 | ||
516 | 516 | ||
517 | 517 | @Callable(i) | |
518 | 518 | func shutdown () = if (!(isActive)) | |
519 | 519 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
520 | 520 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
521 | 521 | then throw("Only admin can call this function") | |
522 | 522 | else suspend("Paused by admin") | |
523 | 523 | ||
524 | 524 | ||
525 | 525 | ||
526 | 526 | @Callable(i) | |
527 | 527 | func activate () = if (isActive) | |
528 | 528 | then throw("DApp is already active") | |
529 | 529 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
530 | 530 | then throw("Only admin can call this function") | |
531 | 531 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
532 | 532 | ||
533 | 533 | ||
534 | 534 | ||
535 | 535 | @Callable(i) | |
536 | 536 | func takeIntoAccountExtraFunds (amountLeave) = { | |
537 | 537 | let uncountableAmountEnrollAssetA = (accountBalanceWithStakedA - balanceA) | |
538 | 538 | let uncountableAmountEnrollAssetB = (accountBalanceWithStakedB - balanceB) | |
539 | 539 | let amountEnrollA = (uncountableAmountEnrollAssetA - (if ((assetIdA == unit)) | |
540 | 540 | then amountLeave | |
541 | 541 | else 0)) | |
542 | 542 | let amountEnrollB = (uncountableAmountEnrollAssetB - (if ((assetIdB == unit)) | |
543 | 543 | then amountLeave | |
544 | 544 | else 0)) | |
545 | 545 | if (!(isActive)) | |
546 | 546 | then throw("DApp is inactive at this moment") | |
547 | 547 | else if ((i.caller != this)) | |
548 | 548 | then throw("Only the DApp itself can call this function") | |
549 | 549 | else if ((0 > amountLeave)) | |
550 | 550 | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(amountLeave))) | |
551 | 551 | else if (if ((0 > uncountableAmountEnrollAssetA)) | |
552 | 552 | then true | |
553 | 553 | else (0 > uncountableAmountEnrollAssetB)) | |
554 | 554 | then suspend("Enroll amount negative") | |
555 | 555 | else if (if ((0 > amountEnrollA)) | |
556 | 556 | then true | |
557 | 557 | else (0 > amountEnrollB)) | |
558 | 558 | then throw("Too large amountLeave") | |
559 | 559 | else [IntegerEntry(keyBalanceA, (balanceA + amountEnrollA)), IntegerEntry(keyBalanceB, (balanceB + amountEnrollB)), IntegerEntry(("last_income_" + strAssetIdA), amountEnrollA), IntegerEntry(("last_income_" + strAssetIdB), amountEnrollB)] | |
560 | 560 | } | |
561 | 561 | ||
562 | 562 |
github/deemru/w8io/026f985 63.03 ms ◑