tx · 4oVksS6g6i7AR96fo6ifj4iZFbNyh5SvKRpUppKniDUW 3Mqtt9kSfBxTt5wKrQmeWSgMiP1EoWqi6DK: -0.14000000 Waves 2021.12.29 11:08 [1855250] smart account 3Mqtt9kSfBxTt5wKrQmeWSgMiP1EoWqi6DK > SELF 0.00000000 Waves
{ "type": 13, "id": "4oVksS6g6i7AR96fo6ifj4iZFbNyh5SvKRpUppKniDUW", "fee": 14000000, "feeAssetId": null, "timestamp": 1640765358323, "version": 2, "chainId": 84, "sender": "3Mqtt9kSfBxTt5wKrQmeWSgMiP1EoWqi6DK", "senderPublicKey": "CRw5cLM5Fwx3EoofhrEdm1FcwXVTrBvD7u19dwvUUBAk", "proofs": [ "5cgJkCGMhryqDNE1mry7vaX8riRqcE21rkuv99pkDsfwmaST7ewQt5e8JNfZbteym8Zx43HP47bty1qVP4g2NMDD" ], "script": "base64:AAIFAAAAAAAAAWAIAhIHCgUBAQEBARIFCgMBAQEaEgoBYRINQXNzZXRzV2VpZ2h0cxoaCgFiEhVBc3NldHNXZWlnaHRzRGVjaW1hbHMaFgoBYxIRUG9vbFRva2VuRGVjaW1hbHMaDQoBZBIIRGVjaW1hbHMaCwoBZRIGU2NhbGVzGggKAWYSA0ZlZRoKCgFnEgVTY2FsZRoLCgFoEgZTY2FsZTgaDQoBaRIIRmVlU2NhbGUaBgoBahIBaRoNCgFrEghBbW91bnRJbhoMCgFsEgdJbmRleEluGg0KAW0SCEluZGV4T3V0Gg4KAW4SCUJhbGFuY2VJbhoPCgFvEgpCYWxhbmNlT3V0GgkKAXASBGJhc2UaDQoBcRIIZXhwb25lbnQaCQoBchIEcG93MRoGCgFzEgF4GgYKAXQSAWQaBgoBdRIBYRoGCgF2EgFiGgYKAXcSAWMaBwoBeBICdHgaCwoBeRIGdmVyaWZ5AAAACQAAAAABYQkABEwAAAACAAAAAAAAAAAUCQAETAAAAAIAAAAAAAAAAAoJAARMAAAAAgAAAAAAAAAABQkABEwAAAACAAAAAAAAAAAFCQ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HJvb2ZzAAAAAAAAAAAACAUAAAABeAAAAA9zZW5kZXJQdWJsaWNLZXk9MPwQ", "height": 1855250, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Aqu8yCzXiSynciWWDA49h8WXdcPNcjDvNnCq8cnqDkYi Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let AssetsWeights = [20, 10, 5, 5, 5, 5, 5, 20, 10, 15] | |
5 | + | ||
6 | + | let AssetsWeightsDecimals = 2 | |
7 | + | ||
8 | + | let PoolTokenDecimals = 8 | |
9 | + | ||
10 | + | let Decimals = [8, 8, 8, 8, 6, 8, 8, 8, 6, 6] | |
11 | + | ||
12 | + | let Scales = [100000000, 100000000, 100000000, 100000000, 1000000, 100000000, 100000000, 100000000, 1000000, 1000000] | |
13 | + | ||
14 | + | let Fee = 200 | |
15 | + | ||
16 | + | let Scale = 10000 | |
17 | + | ||
18 | + | let Scale8 = 100000000 | |
19 | + | ||
20 | + | let FeeScale = 10000 | |
21 | + | ||
22 | + | @Callable(i) | |
23 | + | func calculateOutAmount (AmountIn,IndexIn,IndexOut,BalanceIn,BalanceOut) = { | |
24 | + | let base = fraction(BalanceIn, Scales[IndexIn], (BalanceIn + AmountIn)) | |
25 | + | let exponent = fraction(AssetsWeights[IndexIn], 10000, AssetsWeights[IndexOut]) | |
26 | + | let pow1 = pow(base, Decimals[IndexIn], exponent, 4, Decimals[IndexOut], CEILING) | |
27 | + | let x = (Scales[IndexOut] - pow1) | |
28 | + | let d = fraction(BalanceOut, x, Scales[IndexOut], DOWN) | |
29 | + | [IntegerEntry("base", base), IntegerEntry("exponent", exponent), IntegerEntry("pow1", pow1), IntegerEntry("x", x), IntegerEntry("result", d)] | |
30 | + | } | |
31 | + | ||
4 | 32 | ||
5 | 33 | ||
6 | 34 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let AssetsWeights = [20, 10, 5, 5, 5, 5, 5, 20, 10, 15] | |
5 | + | ||
6 | + | let AssetsWeightsDecimals = 2 | |
7 | + | ||
8 | + | let PoolTokenDecimals = 8 | |
9 | + | ||
10 | + | let Decimals = [8, 8, 8, 8, 6, 8, 8, 8, 6, 6] | |
11 | + | ||
12 | + | let Scales = [100000000, 100000000, 100000000, 100000000, 1000000, 100000000, 100000000, 100000000, 1000000, 1000000] | |
13 | + | ||
14 | + | let Fee = 200 | |
15 | + | ||
16 | + | let Scale = 10000 | |
17 | + | ||
18 | + | let Scale8 = 100000000 | |
19 | + | ||
20 | + | let FeeScale = 10000 | |
21 | + | ||
22 | + | @Callable(i) | |
23 | + | func calculateOutAmount (AmountIn,IndexIn,IndexOut,BalanceIn,BalanceOut) = { | |
24 | + | let base = fraction(BalanceIn, Scales[IndexIn], (BalanceIn + AmountIn)) | |
25 | + | let exponent = fraction(AssetsWeights[IndexIn], 10000, AssetsWeights[IndexOut]) | |
26 | + | let pow1 = pow(base, Decimals[IndexIn], exponent, 4, Decimals[IndexOut], CEILING) | |
27 | + | let x = (Scales[IndexOut] - pow1) | |
28 | + | let d = fraction(BalanceOut, x, Scales[IndexOut], DOWN) | |
29 | + | [IntegerEntry("base", base), IntegerEntry("exponent", exponent), IntegerEntry("pow1", pow1), IntegerEntry("x", x), IntegerEntry("result", d)] | |
30 | + | } | |
31 | + | ||
4 | 32 | ||
5 | 33 | ||
6 | 34 | @Callable(i) | |
7 | 35 | func call (a,b,c) = [IntegerEntry("CEILING", fraction(a, b, c, CEILING)), IntegerEntry("HALFUP", fraction(a, b, c, HALFUP)), IntegerEntry("HALFEVEN", fraction(a, b, c, HALFEVEN)), IntegerEntry("DOWN", fraction(a, b, c, DOWN))] | |
8 | 36 | ||
9 | 37 | ||
10 | 38 | @Verifier(tx) | |
11 | 39 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
12 | 40 |
github/deemru/w8io/026f985 26.41 ms ◑