tx · Bvw6u6GTGPf6eG5b2vv3CR4nqVRUFBtTj1xeXpTFn4ib 3N2j6yXv5aLx1DTVGpwUmJHKZb5XwMfWZhk: -0.05000000 Waves 2022.07.13 18:44 [2138155] smart account 3N2j6yXv5aLx1DTVGpwUmJHKZb5XwMfWZhk > SELF 0.00000000 Waves
{ "type": 13, "id": "Bvw6u6GTGPf6eG5b2vv3CR4nqVRUFBtTj1xeXpTFn4ib", "fee": 5000000, "feeAssetId": null, "timestamp": 1657727189655, "version": 2, "chainId": 84, "sender": "3N2j6yXv5aLx1DTVGpwUmJHKZb5XwMfWZhk", "senderPublicKey": "8ZzMCsQ15BKiHk944146A5WQ8eSFd8vaff4xaktCKSBK", "proofs": [ "5Ei1zjNGjNYPzkdaWX3dqHnFzemmcdLyikJnSZRmk3iXRJfKbVHV4Kv5ErjLNuoATZXjzBKUdcZnSiefHxBRkR9d" ], "script": "base64:BgIMCAISABIAEgQKAggIEAAJc2VwYXJhdG9yAgFfAQ1nZXRQYWlyTGVuZ3RoAAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzAgpwYWlyTGVuZ3RoAAABDXNldFBhaXJMZW5naHQBCW5ld0xlbmd0aAkBDEludGVnZXJFbnRyeQICCnBhaXJMZW5ndGgFCW5ld0xlbmd0aAEKZ2V0UGFpcktleQIGdG9rZW4wBnRva2VuMQQIdG9rZW4wQlYJALEJAQkA2QQBBQZ0b2tlbjAECHRva2VuMUJWCQCxCQEJANkEAQUGdG9rZW4xAwkAZgIFCHRva2VuMUJWBQh0b2tlbjBCVgkAuQkCCQDMCAIFBnRva2VuMAkAzAgCBQZ0b2tlbjEFA25pbAUJc2VwYXJhdG9yCQC5CQIJAMwIAgUGdG9rZW4xCQDMCAIFBnRva2VuMAUDbmlsBQlzZXBhcmF0b3IBDmdldFBhaXJUb2tlbklkAgZ0b2tlbjAGdG9rZW4xCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzCQEKZ2V0UGFpcktleQIFBnRva2VuM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aXICBQZ0b2tlbjAFBnRva2VuMQMJAQIhPQIFBnRva2VuMAUGdG9rZW4xAwMJAQ1pc1Rva2VuRXhpc3RzAQUGdG9rZW4wCQENaXNUb2tlbkV4aXN0cwEFBnRva2VuMQcECG5ld1Rva2VuCQDCCAUJANgEAQkAyQECCAUBaQ10cmFuc2FjdGlvbklkAAoCAAAAAAAGBAdpc3N1ZUlkCQDYBAEJALgIAQUIbmV3VG9rZW4EEGN1cnJlbnRQYWlySW5kZXgJAQ1nZXRQYWlyTGVuZ3RoAAkAzAgCBQhuZXdUb2tlbgkAzAgCCQELU3RyaW5nRW50cnkCCQCkAwEFEGN1cnJlbnRQYWlySW5kZXgFB2lzc3VlSWQJAMwIAgkBDXNldFBhaXJMZW5naHQBCQBkAgUQY3VycmVudFBhaXJJbmRleAABCQDMCAIJAQ5zZXRQYWlyVG9rZW5JZAMFBnRva2VuMAUGdG9rZW4xBQdpc3N1ZUlkCQDMCAIJAQ5zZXRQYWlyRGV0YWlscwUFB2lzc3VlSWQFBnRva2VuMAUGdG9rZW4xAAAAAAUDbmlsCQACAQIMV3JvbmcgdG9rZW5zCQACAQIMRXF1YWwgdG9rZW5zCQACAQITUGFpciBhbHJlYWR5IGV4aXN0cwAkZbmA", "height": 2138155, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Gv1U45NncsM3aiCmtw837WHdw4xS1MzpJcqFe15PC6oe Next: B2DDZ8w6q11WQ1tef5ojtMWJHdTZNMYaDdu83GS7t6iZ Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_" | |
5 | 5 | ||
6 | 6 | func b () = valueOrElse(getInteger(this, "pairLength"), 0) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func c (d) = IntegerEntry("pairLength", d) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func e (f,g) = { | |
13 | 13 | let h = toInt(fromBase58String(f)) | |
14 | 14 | let i = toInt(fromBase58String(g)) | |
15 | 15 | if ((i > h)) | |
16 | 16 | then makeString([f, g], a) | |
17 | 17 | else makeString([g, f], a) | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func j (f,g) = getStringValue(this, e(f, g)) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func k (f,g,l) = StringEntry(e(f, g), l) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func m (f,g,n,o) = makeString([f, g, toString(n), toString(o)], a) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func p (q) = { | |
31 | 31 | let r = split(valueOrElse(getString(this, q), "assetId0_assetId1_0_0"), a) | |
32 | 32 | $Tuple4(r[0], r[1], parseIntValue(r[2]), parseIntValue(r[3])) | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func s (q,f,g,n,o) = StringEntry(q, m(f, g, n, o)) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func t (q) = valueOrElse(getInteger(this, (("totalSupply" + a) + q)), 0) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func u (q,v) = IntegerEntry((("totalSupply" + a) + q), v) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func w (f,g) = !(isDefined(getString(e(f, g)))) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func x (y) = true | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | let z = 1000000000000 | |
52 | 52 | ||
53 | 53 | let A = value(addressFromString("3M4qwDomRabJKLZxuXhwfqLApQkU592nWxF")) | |
54 | 54 | ||
55 | 55 | let B = 100000 | |
56 | 56 | ||
57 | 57 | @Callable(C) | |
58 | 58 | func mint () = { | |
59 | 59 | let f = toBase58String(value(C.payments[0].assetId)) | |
60 | 60 | let g = toBase58String(value(C.payments[1].assetId)) | |
61 | 61 | let D = j(f, g) | |
62 | 62 | let E = value(C.payments[0].amount) | |
63 | 63 | let F = value(C.payments[1].amount) | |
64 | 64 | let G = p(D) | |
65 | 65 | let H = G._1 | |
66 | 66 | let I = G._2 | |
67 | 67 | let J = G._3 | |
68 | 68 | let K = G._4 | |
69 | 69 | let L = t(D) | |
70 | 70 | if ((L == 0)) | |
71 | 71 | then { | |
72 | 72 | let M = (sqrt((E * F), 0, 0, DOWN) - B) | |
73 | 73 | [Reissue(fromBase58String(D), (M + B), true), ScriptTransfer(A, B, fromBase58String(D)), ScriptTransfer(C.caller, M, fromBase58String(D)), u(D, (M + B)), s(D, f, g, (J + E), (K + F))] | |
74 | 74 | } | |
75 | 75 | else { | |
76 | 76 | let M = min([((E * L) / J), ((F * L) / K)]) | |
77 | 77 | [Reissue(fromBase58String(D), M, true), ScriptTransfer(C.caller, M, fromBase58String(D)), u(D, M), s(D, f, g, (J + E), (K + F))] | |
78 | 78 | } | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | ||
83 | 83 | @Callable(C) | |
84 | 84 | func burn () = { | |
85 | 85 | let N = value(C.payments[0].amount) | |
86 | 86 | let O = value(C.payments[0].assetId) | |
87 | 87 | let P = p(toBase58String(O)) | |
88 | 88 | let H = P._1 | |
89 | 89 | let I = P._2 | |
90 | 90 | let J = P._3 | |
91 | 91 | let K = P._4 | |
92 | 92 | let D = j(H, I) | |
93 | 93 | let L = t(D) | |
94 | 94 | let Q = ((N * z) / L) | |
95 | 95 | let E = ((Q * J) / z) | |
96 | 96 | let F = ((Q * K) / z) | |
97 | 97 | [Burn(fromBase58String(D), N), ScriptTransfer(C.caller, E, fromBase58String(H)), ScriptTransfer(C.caller, F, fromBase58String(I)), u(D, (L - N)), s(D, H, I, (J - E), (K - F))] | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(C) | |
103 | 103 | func addLiquidityPool (f,g) = if (w(f, g)) | |
104 | 104 | then if ((f != g)) | |
105 | 105 | then if (if (x(f)) | |
106 | 106 | then x(g) | |
107 | 107 | else false) | |
108 | 108 | then { | |
109 | 109 | let R = Issue(toBase58String(take(C.transactionId, 10)), "", 0, 0, true) | |
110 | 110 | let l = toBase58String(calculateAssetId(R)) | |
111 | 111 | let S = b() | |
112 | 112 | [R, StringEntry(toString(S), l), c((S + 1)), k(f, g, l), s(l, f, g, 0, 0)] | |
113 | 113 | } | |
114 | 114 | else throw("Wrong tokens") | |
115 | 115 | else throw("Equal tokens") | |
116 | 116 | else throw("Pair already exists") | |
117 | 117 | ||
118 | 118 |
github/deemru/w8io/169f3d6 23.75 ms ◑