tx · 9fj3ZmTGFxyvvQvRMp6zCJbStp2HExHRHauZGsuUG2MT 3MvdzbvEZLHEE3EXHXxaRQjgpNqq28733ao: -0.01000000 Waves 2021.12.22 16:18 [1845520] smart account 3MvdzbvEZLHEE3EXHXxaRQjgpNqq28733ao > SELF 0.00000000 Waves
{ "type": 13, "id": "9fj3ZmTGFxyvvQvRMp6zCJbStp2HExHRHauZGsuUG2MT", "fee": 1000000, "feeAssetId": null, "timestamp": 1640179161405, "version": 1, "sender": "3MvdzbvEZLHEE3EXHXxaRQjgpNqq28733ao", "senderPublicKey": "HQmnkZjA2Ehwb2iKXAadqRsrXsHGZChU6WfgmHRsMW8t", "proofs": [ "3BeUFzsFrumUc7ok7eZG6eZP2qqe2HuqcEph8L4LxbzqqA3UPTCRoULr5ofymyVrJJ1fwpeLUdYE2uvS34kpK2P3" ], "script": "base64:AAIFAAAAAAAAAAoIAhIGCgQICAEBAAAABwAAAAAJY29sbGVjdG9yCQEAAAAHQWRkcmVzcwAAAAEBAAAAAAAAAAAGb3JhY2xlCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQmAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAABm9yYWNsZQIAAAAAAgAAAAAAAAAABXBvb2xzCQAEtQAAAAIJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAZvcmFjbGUCAAAABXBvb2xzAgAAAAACAAAAASwBAAAACmdldEFzc2V0SWQAAAABAAAABWFzc2V0AwkAAAAAAAACBQAAAAVhc3NldAIAAAAFV0FWRVMFAAAABHVuaXQJAAJZAAAAAQUAAAAFYXNzZXQBAAAACmdldEJhbGFuY2UAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbW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original | compacted Prev: none Next: hJc2yCLUiTiqXXmM6Yfdxcx3mkVCU52bBFs721pry4S Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = Address(base58'') | |
5 | + | ||
6 | + | let b = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "oracle"), "")), "") | |
7 | + | ||
8 | + | let c = split(valueOrErrorMessage(getString(b, "pools"), ""), ",") | |
9 | + | ||
10 | + | func d (e) = if ((e == "WAVES")) | |
11 | + | then unit | |
12 | + | else fromBase58String(e) | |
13 | + | ||
14 | + | ||
15 | + | func f (g) = { | |
16 | + | let h = g | |
17 | + | if ($isInstanceOf(h, "ByteVector")) | |
18 | + | then { | |
19 | + | let e = h | |
20 | + | assetBalance(this, e) | |
21 | + | } | |
22 | + | else if ($isInstanceOf(h, "Unit")) | |
23 | + | then { | |
24 | + | let i = h | |
25 | + | wavesBalance(this).available | |
26 | + | } | |
27 | + | else throw("Match error") | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | let j = { | |
32 | + | let k = split(valueOrErrorMessage(getString(this, "fee-assets"), ""), ",") | |
33 | + | func l (m,n) = (m :+ d(n)) | |
34 | + | ||
35 | + | let o = k | |
36 | + | let p = size(o) | |
37 | + | let q = nil | |
38 | + | func r (s,t) = if ((t >= p)) | |
39 | + | then s | |
40 | + | else l(s, o[t]) | |
41 | + | ||
42 | + | func u (s,t) = if ((t >= p)) | |
43 | + | then s | |
44 | + | else throw("List size exceeds 10") | |
45 | + | ||
46 | + | u(r(r(r(r(r(r(r(r(r(r(q, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
47 | + | } | |
48 | + | ||
49 | + | func v (w,x,y,z,A) = { | |
50 | + | let B = valueOrErrorMessage(addressFromString(w), "") | |
51 | + | let C = d(y) | |
52 | + | if ((0 >= z)) | |
53 | + | then throw("") | |
54 | + | else if ((0 > A)) | |
55 | + | then throw("") | |
56 | + | else { | |
57 | + | let D = f(C) | |
58 | + | if ((D == D)) | |
59 | + | then { | |
60 | + | let E = if (!(containsElement(c, w))) | |
61 | + | then throw("") | |
62 | + | else { | |
63 | + | let F = valueOrErrorMessage(getString(B, "A_asset_id"), "") | |
64 | + | let G = valueOrErrorMessage(getString(B, "B_asset_id"), "") | |
65 | + | let H = d(F) | |
66 | + | let I = d(G) | |
67 | + | let J = valueOrErrorMessage(parseInt(split(valueOrErrorMessage(getString(B, "version"), ""), ".")[0]), "") | |
68 | + | let K = if ((J == 1)) | |
69 | + | then [z] | |
70 | + | else if ((J == 2)) | |
71 | + | then if ((0 >= A)) | |
72 | + | then throw("") | |
73 | + | else [A, z] | |
74 | + | else throw("") | |
75 | + | invoke(B, "exchange", K, [x]) | |
76 | + | } | |
77 | + | if ((E == E)) | |
78 | + | then { | |
79 | + | let L = (f(C) - D) | |
80 | + | if ((L == L)) | |
81 | + | then $Tuple2(D, L) | |
82 | + | else throw("Strict value is not equal to itself.") | |
83 | + | } | |
84 | + | else throw("Strict value is not equal to itself.") | |
85 | + | } | |
86 | + | else throw("Strict value is not equal to itself.") | |
87 | + | } | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | @Callable(M) | |
92 | + | func swap (w,N,z,A) = { | |
93 | + | let O = if ((size(M.payments) > 0)) | |
94 | + | then M.payments[0] | |
95 | + | else throw("") | |
96 | + | let C = d(N) | |
97 | + | let P = { | |
98 | + | let Q = valueOrElse(indexOf(j, O.assetId), -1) | |
99 | + | let R = valueOrElse(indexOf(j, C), -1) | |
100 | + | (R > Q) | |
101 | + | } | |
102 | + | func S (T) = fraction(T, 1, 1000) | |
103 | + | ||
104 | + | if ((0 >= z)) | |
105 | + | then throw("") | |
106 | + | else { | |
107 | + | let U = if (P) | |
108 | + | then AttachedPayment(O.assetId, S(O.amount)) | |
109 | + | else O | |
110 | + | let V = { | |
111 | + | let h = v(w, O, N, z, A) | |
112 | + | if (if (if ($isInstanceOf(h._1, "Int")) | |
113 | + | then $isInstanceOf(h._2, "Int") | |
114 | + | else false) | |
115 | + | then $isInstanceOf(h, "(Int, Int)") | |
116 | + | else false) | |
117 | + | then { | |
118 | + | let W = h._1 | |
119 | + | let X = h._2 | |
120 | + | $Tuple2(W, X) | |
121 | + | } | |
122 | + | else throw("") | |
123 | + | } | |
124 | + | let D = V._1 | |
125 | + | let L = V._2 | |
126 | + | if ((0 >= L)) | |
127 | + | then throw("") | |
128 | + | else if (P) | |
129 | + | then [ScriptTransfer(M.caller, L, C), ScriptTransfer(a, (O.amount - U.amount), U.assetId)] | |
130 | + | else { | |
131 | + | let Y = S(L) | |
132 | + | [ScriptTransfer(M.caller, (L - Y), C), ScriptTransfer(a, Y, C)] | |
133 | + | } | |
134 | + | } | |
135 | + | } | |
136 | + | ||
137 | + |
github/deemru/w8io/169f3d6 19.98 ms ◑