tx · FbDETRYBnqtwDBgMfHFTqC8X5KYN78FgkMYFfJa3QNor 3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33: -0.01300000 Waves 2023.03.22 22:26 [2501639] smart account 3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33 > SELF 0.00000000 Waves
{ "type": 13, "id": "FbDETRYBnqtwDBgMfHFTqC8X5KYN78FgkMYFfJa3QNor", "fee": 1300000, "feeAssetId": null, "timestamp": 1679513199685, "version": 2, "chainId": 84, "sender": "3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33", "senderPublicKey": "5yoY2Atq5TS6YzXkDHGig1DJdaYnWskuGToqK61rQWQd", "proofs": [ "5s7zi59Qn9MALftXSjzDTm8F4WELp27iS8jirB3mL3nzVipy6bJjdvF9XiCWCWfVgq84J1gqurncM6ewwDfFi2J8" ], "script": "base64:BgILCAISABIDCgEIEgANARNrZXlJbnZlc3RXeFh0bkRlbGF5AAITJV9faW52ZXN0V3hYdG5EZWxheQEXa2V5SW52ZXN0V3hYdG5BbW91bnRYdG4AAhclX19pbnZlc3RXeFh0bkFtb3VudFh0bgEMa2V5V3hYdG5Qb29sAAIMJV9fd3hYdG5Qb29sAQ1rZXlYdG5Bc3NldElkAAINJV9feHRuQXNzZXRJZAEKa2V5V3hYdG5McAACCiVfX3d4WHRuTHABDmtleUxwVG9BZGRyZXNzAAIOJV9fbHBUb0FkZHJlc3MBE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBGGtleUludmVzdFd4WHRuTGFzdEhlaWdodAACGCVfX2ludmVzdFd4WHRuTGFzdEhlaWdodAEWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAEByRtYXRjaDAJAKIIAQkBE2tleU1hbmFnZXJQdWJsaWNLZXkAAwkAAQIFByRtYXRjaDACBlN0cmluZ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SBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tlefMjKbM=", "height": 2501639, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4CytMZxhPesoTXAfYRzapDMBnEXLhX4agEVD5e82fYUC Next: 6wRM5vehNqyUqgQ2gVcQSKTgMW3bJymqw4xiyiuh49w2 Diff:
Old | New | Differences | |
---|---|---|---|
77 | 77 | ||
78 | 78 | @Callable(q) | |
79 | 79 | func investWxXtn () = { | |
80 | - | let t = p(q) | |
81 | - | if ((t == t)) | |
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)) | |
82 | 86 | then { | |
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)) | |
87 | + | let w = fromBase58String(getStringValue(e())) | |
88 | + | let x = assetBalance(this, w) | |
89 | + | if ((x == x)) | |
89 | 90 | then { | |
90 | - | let x = fromBase58String(getStringValue(e())) | |
91 | - | let y = assetBalance(this, x) | |
91 | + | let y = invoke(addressFromStringValue(getStringValue(c())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(d())), getIntegerValue(b()))]) | |
92 | 92 | if ((y == y)) | |
93 | 93 | then { | |
94 | - | let z = | |
94 | + | let z = assetBalance(this, w) | |
95 | 95 | if ((z == z)) | |
96 | 96 | then { | |
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 | - | } | |
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)] | |
108 | 103 | else throw("Strict value is not equal to itself.") | |
109 | 104 | } | |
110 | 105 | else throw("Strict value is not equal to itself.") | |
119 | 114 | ||
120 | 115 | ||
121 | 116 | @Callable(q) | |
122 | - | func setManager ( | |
123 | - | let | |
124 | - | if (( | |
117 | + | func setManager (C) = { | |
118 | + | let D = p(q) | |
119 | + | if ((D == D)) | |
125 | 120 | then { | |
126 | - | let E = fromBase58String( | |
121 | + | let E = fromBase58String(C) | |
127 | 122 | if ((E == E)) | |
128 | - | then [StringEntry(h(), | |
123 | + | then [StringEntry(h(), C)] | |
129 | 124 | else throw("Strict value is not equal to itself.") | |
130 | 125 | } | |
131 | 126 | 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 = p(q) | |
81 | - | if ((t == t)) | |
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)) | |
82 | 86 | then { | |
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)) | |
87 | + | let w = fromBase58String(getStringValue(e())) | |
88 | + | let x = assetBalance(this, w) | |
89 | + | if ((x == x)) | |
89 | 90 | then { | |
90 | - | let x = fromBase58String(getStringValue(e())) | |
91 | - | let y = assetBalance(this, x) | |
91 | + | let y = invoke(addressFromStringValue(getStringValue(c())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(d())), getIntegerValue(b()))]) | |
92 | 92 | if ((y == y)) | |
93 | 93 | then { | |
94 | - | let z = | |
94 | + | let z = assetBalance(this, w) | |
95 | 95 | if ((z == z)) | |
96 | 96 | then { | |
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 | - | } | |
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)] | |
108 | 103 | else throw("Strict value is not equal to itself.") | |
109 | 104 | } | |
110 | 105 | else throw("Strict value is not equal to itself.") | |
111 | 106 | } | |
112 | 107 | else throw("Strict value is not equal to itself.") | |
113 | 108 | } | |
114 | 109 | else throw("Strict value is not equal to itself.") | |
115 | 110 | } | |
116 | 111 | else throw("Strict value is not equal to itself.") | |
117 | 112 | } | |
118 | 113 | ||
119 | 114 | ||
120 | 115 | ||
121 | 116 | @Callable(q) | |
122 | - | func setManager ( | |
123 | - | let | |
124 | - | if (( | |
117 | + | func setManager (C) = { | |
118 | + | let D = p(q) | |
119 | + | if ((D == D)) | |
125 | 120 | then { | |
126 | - | let E = fromBase58String( | |
121 | + | let E = fromBase58String(C) | |
127 | 122 | if ((E == E)) | |
128 | - | then [StringEntry(h(), | |
123 | + | then [StringEntry(h(), C)] | |
129 | 124 | else throw("Strict value is not equal to itself.") | |
130 | 125 | } | |
131 | 126 | else throw("Strict value is not equal to itself.") | |
132 | 127 | } | |
133 | 128 | ||
134 | 129 | ||
135 | 130 | ||
136 | 131 | @Callable(q) | |
137 | 132 | func confirmManager () = { | |
138 | 133 | let F = m() | |
139 | 134 | let G = if (isDefined(F)) | |
140 | 135 | then true | |
141 | 136 | else throw("No pending manager") | |
142 | 137 | if ((G == G)) | |
143 | 138 | then { | |
144 | 139 | let H = if ((q.callerPublicKey == value(F))) | |
145 | 140 | then true | |
146 | 141 | else throw("You are not pending manager") | |
147 | 142 | if ((H == H)) | |
148 | 143 | then [StringEntry(g(), toBase58String(value(F))), DeleteEntry(h())] | |
149 | 144 | else throw("Strict value is not equal to itself.") | |
150 | 145 | } | |
151 | 146 | else throw("Strict value is not equal to itself.") | |
152 | 147 | } | |
153 | 148 | ||
154 | 149 | ||
155 | 150 | @Verifier(I) | |
156 | 151 | func J () = { | |
157 | 152 | let K = { | |
158 | 153 | let k = j() | |
159 | 154 | if ($isInstanceOf(k, "ByteVector")) | |
160 | 155 | then { | |
161 | 156 | let s = k | |
162 | 157 | s | |
163 | 158 | } | |
164 | 159 | else if ($isInstanceOf(k, "Unit")) | |
165 | 160 | then I.senderPublicKey | |
166 | 161 | else throw("Match error") | |
167 | 162 | } | |
168 | 163 | sigVerify(I.bodyBytes, I.proofs[0], K) | |
169 | 164 | } | |
170 | 165 |
github/deemru/w8io/169f3d6 37.52 ms ◑