tx · C7YJ5Jd4Sm89gwyG2Pinfr3LKUM57LiAL7XD7eL39g7m 3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33: -0.01300000 Waves 2023.03.22 10:52 [2500954] smart account 3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33 > SELF 0.00000000 Waves
{ "type": 13, "id": "C7YJ5Jd4Sm89gwyG2Pinfr3LKUM57LiAL7XD7eL39g7m", "fee": 1300000, "feeAssetId": null, "timestamp": 1679471535479, "version": 2, "chainId": 84, "sender": "3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33", "senderPublicKey": "5yoY2Atq5TS6YzXkDHGig1DJdaYnWskuGToqK61rQWQd", "proofs": [ "64fLAnfdj4usb1CpzjfcMi7hKxjJfKiPYQFobzCjQjYBkA5rpbUQEnSD9roeVDHuAooqxez51GQEDRfZ7byuVVXt" ], "script": "base64:BgILCAISABIDCgEIEgANARNrZXlJbnZlc3RXeFh0bkRlbGF5AAITJV9faW52ZXN0V3hYdG5EZWxheQEXa2V5SW52ZXN0V3hYdG5BbW91bnRYdG4AAhclX19pbnZlc3RXeFh0bkFtb3VudFh0bgEMa2V5V3hYdG5Qb29sAAIMJV9fd3hYdG5Qb29sAQ1rZXlYdG5Bc3NldElkAAINJV9feHRuQXNzZXRJZAEKa2V5V3hYdG5McAACCiVfX3d4WHRuTHABDmtleUxwVG9BZGRyZXNzAAIOJV9fbHBUb0FkZHJlc3MBE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBGGtleUludmVzdFd4WHRuTGFzdEhlaWdodAACGCVfX2ludmVzdFd4WHRuTGFzdEhlaWdodAEWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAEByRtYXRjaDAJAKIIAQkBE2tleU1hbmFnZXJQdWJsaWNLZXkAAwkAAQIFByRtYXRjaDAC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UVudHJ5AQkBGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQPdGFyZ2V0UHVibGljS2V5BAckbWF0Y2gwCQEWbWFuYWdlclB1YmxpY0tleU9yVW5pdAADCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCcGsFByRtYXRjaDAFAnBrAwkAAQIFByRtYXRjaDACBFVuaXQIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5K17qbA==", "height": 2500954, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3nJkUjxdAteAU7TY77b5Lc8PtxpHnu5wL4SA31XLrt22 Next: 6vHuVSbyymW6czHJj21vW5v9CH69x5KdjzB2kLiT7znY Diff:
Old | New | Differences | |
---|---|---|---|
77 | 77 | ||
78 | 78 | @Callable(q) | |
79 | 79 | func investWxXtn () = { | |
80 | - | let t = valueOrElse(getInteger(i()), 0) | |
81 | - | let u = getIntegerValue(a()) | |
82 | - | let v = [if ((height > (t + u))) | |
83 | - | then true | |
84 | - | else n("wait to invest")] | |
85 | - | if ((v == v)) | |
80 | + | let t = p(q) | |
81 | + | if ((t == t)) | |
86 | 82 | then { | |
87 | - | let w = fromBase58String(getStringValue(e())) | |
88 | - | let x = assetBalance(this, w) | |
89 | - | if ((x == x)) | |
83 | + | let u = valueOrElse(getInteger(i()), 0) | |
84 | + | let v = getIntegerValue(a()) | |
85 | + | let w = [if ((height > (u + v))) | |
86 | + | then true | |
87 | + | else n("wait to invest")] | |
88 | + | if ((w == w)) | |
90 | 89 | then { | |
91 | - | let y = invoke(addressFromStringValue(getStringValue(c())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(d())), getIntegerValue(b()))]) | |
90 | + | let x = fromBase58String(getStringValue(e())) | |
91 | + | let y = assetBalance(this, x) | |
92 | 92 | if ((y == y)) | |
93 | 93 | then { | |
94 | - | let z = | |
94 | + | let z = invoke(addressFromStringValue(getStringValue(c())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(d())), getIntegerValue(b()))]) | |
95 | 95 | if ((z == z)) | |
96 | 96 | then { | |
97 | - | let A = (z - x) | |
98 | - | let B = if ((A == 0)) | |
99 | - | then n("lp to get is zero") | |
100 | - | else unit | |
101 | - | if ((B == B)) | |
102 | - | then [IntegerEntry(i(), height), ScriptTransfer(addressFromStringValue(getStringValue(f())), A, w)] | |
97 | + | let A = assetBalance(this, x) | |
98 | + | if ((A == A)) | |
99 | + | then { | |
100 | + | let B = (A - y) | |
101 | + | let C = if ((B == 0)) | |
102 | + | then n("lp to get is zero") | |
103 | + | else unit | |
104 | + | if ((C == C)) | |
105 | + | then [IntegerEntry(i(), height), ScriptTransfer(addressFromStringValue(getStringValue(f())), B, x)] | |
106 | + | else throw("Strict value is not equal to itself.") | |
107 | + | } | |
103 | 108 | else throw("Strict value is not equal to itself.") | |
104 | 109 | } | |
105 | 110 | else throw("Strict value is not equal to itself.") | |
114 | 119 | ||
115 | 120 | ||
116 | 121 | @Callable(q) | |
117 | - | func setManager ( | |
118 | - | let | |
119 | - | if (( | |
122 | + | func setManager (D) = { | |
123 | + | let t = p(q) | |
124 | + | if ((t == t)) | |
120 | 125 | then { | |
121 | - | let E = fromBase58String( | |
126 | + | let E = fromBase58String(D) | |
122 | 127 | if ((E == E)) | |
123 | - | then [StringEntry(h(), | |
128 | + | then [StringEntry(h(), D)] | |
124 | 129 | else throw("Strict value is not equal to itself.") | |
125 | 130 | } | |
126 | 131 | else throw("Strict value is not equal to itself.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a () = "%__investWxXtnDelay" | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func b () = "%__investWxXtnAmountXtn" | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func c () = "%__wxXtnPool" | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func d () = "%__xtnAssetId" | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func e () = "%__wxXtnLp" | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func f () = "%__lpToAddress" | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func g () = "%s__managerPublicKey" | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func h () = "%s__pendingManagerPublicKey" | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func i () = "%__investWxXtnLastHeight" | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func j () = { | |
32 | 32 | let k = getString(g()) | |
33 | 33 | if ($isInstanceOf(k, "String")) | |
34 | 34 | then { | |
35 | 35 | let l = k | |
36 | 36 | fromBase58String(l) | |
37 | 37 | } | |
38 | 38 | else if ($isInstanceOf(k, "Unit")) | |
39 | 39 | then unit | |
40 | 40 | else throw("Match error") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func m () = { | |
45 | 45 | let k = getString(h()) | |
46 | 46 | if ($isInstanceOf(k, "String")) | |
47 | 47 | then { | |
48 | 48 | let l = k | |
49 | 49 | fromBase58String(l) | |
50 | 50 | } | |
51 | 51 | else if ($isInstanceOf(k, "Unit")) | |
52 | 52 | then unit | |
53 | 53 | else throw("Match error") | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func n (o) = throw(makeString(["investor.ride:", o], " ")) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func p (q) = { | |
61 | 61 | let r = n("permission denied") | |
62 | 62 | let k = j() | |
63 | 63 | if ($isInstanceOf(k, "ByteVector")) | |
64 | 64 | then { | |
65 | 65 | let s = k | |
66 | 66 | if ((q.callerPublicKey == s)) | |
67 | 67 | then true | |
68 | 68 | else r | |
69 | 69 | } | |
70 | 70 | else if ($isInstanceOf(k, "Unit")) | |
71 | 71 | then if ((q.caller == this)) | |
72 | 72 | then true | |
73 | 73 | else r | |
74 | 74 | else throw("Match error") | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | @Callable(q) | |
79 | 79 | func investWxXtn () = { | |
80 | - | let t = valueOrElse(getInteger(i()), 0) | |
81 | - | let u = getIntegerValue(a()) | |
82 | - | let v = [if ((height > (t + u))) | |
83 | - | then true | |
84 | - | else n("wait to invest")] | |
85 | - | if ((v == v)) | |
80 | + | let t = p(q) | |
81 | + | if ((t == t)) | |
86 | 82 | then { | |
87 | - | let w = fromBase58String(getStringValue(e())) | |
88 | - | let x = assetBalance(this, w) | |
89 | - | if ((x == x)) | |
83 | + | let u = valueOrElse(getInteger(i()), 0) | |
84 | + | let v = getIntegerValue(a()) | |
85 | + | let w = [if ((height > (u + v))) | |
86 | + | then true | |
87 | + | else n("wait to invest")] | |
88 | + | if ((w == w)) | |
90 | 89 | then { | |
91 | - | let y = invoke(addressFromStringValue(getStringValue(c())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(d())), getIntegerValue(b()))]) | |
90 | + | let x = fromBase58String(getStringValue(e())) | |
91 | + | let y = assetBalance(this, x) | |
92 | 92 | if ((y == y)) | |
93 | 93 | then { | |
94 | - | let z = | |
94 | + | let z = invoke(addressFromStringValue(getStringValue(c())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(d())), getIntegerValue(b()))]) | |
95 | 95 | if ((z == z)) | |
96 | 96 | then { | |
97 | - | let A = (z - x) | |
98 | - | let B = if ((A == 0)) | |
99 | - | then n("lp to get is zero") | |
100 | - | else unit | |
101 | - | if ((B == B)) | |
102 | - | then [IntegerEntry(i(), height), ScriptTransfer(addressFromStringValue(getStringValue(f())), A, w)] | |
97 | + | let A = assetBalance(this, x) | |
98 | + | if ((A == A)) | |
99 | + | then { | |
100 | + | let B = (A - y) | |
101 | + | let C = if ((B == 0)) | |
102 | + | then n("lp to get is zero") | |
103 | + | else unit | |
104 | + | if ((C == C)) | |
105 | + | then [IntegerEntry(i(), height), ScriptTransfer(addressFromStringValue(getStringValue(f())), B, x)] | |
106 | + | else throw("Strict value is not equal to itself.") | |
107 | + | } | |
103 | 108 | else throw("Strict value is not equal to itself.") | |
104 | 109 | } | |
105 | 110 | else throw("Strict value is not equal to itself.") | |
106 | 111 | } | |
107 | 112 | else throw("Strict value is not equal to itself.") | |
108 | 113 | } | |
109 | 114 | else throw("Strict value is not equal to itself.") | |
110 | 115 | } | |
111 | 116 | else throw("Strict value is not equal to itself.") | |
112 | 117 | } | |
113 | 118 | ||
114 | 119 | ||
115 | 120 | ||
116 | 121 | @Callable(q) | |
117 | - | func setManager ( | |
118 | - | let | |
119 | - | if (( | |
122 | + | func setManager (D) = { | |
123 | + | let t = p(q) | |
124 | + | if ((t == t)) | |
120 | 125 | then { | |
121 | - | let E = fromBase58String( | |
126 | + | let E = fromBase58String(D) | |
122 | 127 | if ((E == E)) | |
123 | - | then [StringEntry(h(), | |
128 | + | then [StringEntry(h(), D)] | |
124 | 129 | else throw("Strict value is not equal to itself.") | |
125 | 130 | } | |
126 | 131 | else throw("Strict value is not equal to itself.") | |
127 | 132 | } | |
128 | 133 | ||
129 | 134 | ||
130 | 135 | ||
131 | 136 | @Callable(q) | |
132 | 137 | func confirmManager () = { | |
133 | 138 | let F = m() | |
134 | 139 | let G = if (isDefined(F)) | |
135 | 140 | then true | |
136 | 141 | else throw("No pending manager") | |
137 | 142 | if ((G == G)) | |
138 | 143 | then { | |
139 | 144 | let H = if ((q.callerPublicKey == value(F))) | |
140 | 145 | then true | |
141 | 146 | else throw("You are not pending manager") | |
142 | 147 | if ((H == H)) | |
143 | 148 | then [StringEntry(g(), toBase58String(value(F))), DeleteEntry(h())] | |
144 | 149 | else throw("Strict value is not equal to itself.") | |
145 | 150 | } | |
146 | 151 | else throw("Strict value is not equal to itself.") | |
147 | 152 | } | |
148 | 153 | ||
149 | 154 | ||
150 | 155 | @Verifier(I) | |
151 | 156 | func J () = { | |
152 | 157 | let K = { | |
153 | 158 | let k = j() | |
154 | 159 | if ($isInstanceOf(k, "ByteVector")) | |
155 | 160 | then { | |
156 | 161 | let s = k | |
157 | 162 | s | |
158 | 163 | } | |
159 | 164 | else if ($isInstanceOf(k, "Unit")) | |
160 | 165 | then I.senderPublicKey | |
161 | 166 | else throw("Match error") | |
162 | 167 | } | |
163 | 168 | sigVerify(I.bodyBytes, I.proofs[0], K) | |
164 | 169 | } | |
165 | 170 |
github/deemru/w8io/169f3d6 33.26 ms ◑