tx · HiW16mYq6KyiLmdMS3vLGTRWu8widLEP9dKFYCw9kpxg 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu: -0.05000000 Waves 2020.11.15 17:31 [1266602] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves
{ "type": 13, "id": "HiW16mYq6KyiLmdMS3vLGTRWu8widLEP9dKFYCw9kpxg", "fee": 5000000, "feeAssetId": null, "timestamp": 1605450738161, "version": 2, "chainId": 84, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "2LLdiwjZvaLTCzaPCszkwBdtPFf8PXWoC8bHrv8Eetwn7oywjB9tsXwwfA1P2waBMkPndym7EGFG4pNGy2Wsot3t" ], "script": "base64:AAIDAAAAAAAAACcIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgSABIDCgEBEgMKAQEAAAAQAAAAAAZ1cFZvdGUCAAAABnVwdm90ZQAAAAAMYWRtaW5BZGRyZXNzAQAAABoBVDi2IViANlgIPSCUAVQpoGSXhJ2Tw/Y0iwAAAAAFZHl6SWQBAAAAIH6rQdnOUsq3YY00nk9jVDL2OOQ/e846gXAImq8xTxZrAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAgAAAApzdGFrZV9wb29sAQAAAAxnZXRTdGFrZVBvb2wAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADGdldFN0YWtlcktleQAAAAEAAAAGc3Rha2VyCQABLAAAAAIFAAAABnN0YWtlcgIAAAAGX3N0YWtlAQAAAA9nZXRDdXJyZW50U3Rha2UAAAABAAAABnN0YWtlcgQAAAAHJG1hdGNoMAkABBo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haW4gbGF0ZXIDCQAAZgAAAAIFAAAABnJld2FyZAUAAAAJc3Rha2VQb29sCQAAAgAAAAECAAAAF05vIHJld2FyZHMgYXQgdGhpcyB0aW1lBAAAAAxuZXdTdGFrZVBvb2wJAABlAAAAAgUAAAAJc3Rha2VQb29sBQAAAAZyZXdhcmQEAAAADm5ld1N0YWtlQW1vdW50CQAAZQAAAAIFAAAADGN1cnJlbnRTdGFrZQUAAAAGcmV3YXJkCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAADGdldFN0YWtlcktleQAAAAEFAAAABnN0YWtlcgUAAAAObmV3U3Rha2VBbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAABQAAAAxuZXdTdGFrZVBvb2wFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABnJld2FyZAUAAAAFZHl6SWQFAAAAA25pbAAAAABIs+xe", "height": 1266602, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DBo8gern8siwr5h3cZKaV1p9GPuNDkkPEMVQ9rAq7kuf Next: HXhCWcTPfxBjG9SJEiqG3XwWDgfubBxrWKxoe55NwkKR Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let b = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC' | |
7 | 7 | ||
8 | - | let c = base58' | |
8 | + | let c = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' | |
9 | 9 | ||
10 | - | let d = base58'3Mucpi1K4FMVrZKnYEgjxQf5DkkBX7QrHoJ' | |
11 | - | ||
12 | - | let e = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' | |
13 | - | ||
14 | - | func f (g) = (g + "_entrepreneurProfile") | |
10 | + | func d () = "stake_pool" | |
15 | 11 | ||
16 | 12 | ||
17 | - | func h (g) = (g + "_status") | |
13 | + | func e () = { | |
14 | + | let f = getInteger(this, d()) | |
15 | + | if ($isInstanceOf(f, "Int")) | |
16 | + | then { | |
17 | + | let g = f | |
18 | + | g | |
19 | + | } | |
20 | + | else 0 | |
21 | + | } | |
18 | 22 | ||
19 | 23 | ||
20 | - | func | |
24 | + | func h (i) = (i + "_stake") | |
21 | 25 | ||
22 | 26 | ||
23 | - | func k (g,l) = if ((l == "upvote")) | |
24 | - | then (g + "_upvote") | |
27 | + | func j (i) = { | |
28 | + | let f = getInteger(this, h(i)) | |
29 | + | if ($isInstanceOf(f, "Int")) | |
30 | + | then { | |
31 | + | let g = f | |
32 | + | g | |
33 | + | } | |
34 | + | else 0 | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func k (l) = (l + "_entrepreneurProfile") | |
39 | + | ||
40 | + | ||
41 | + | func m (l) = (l + "_status") | |
42 | + | ||
43 | + | ||
44 | + | func n (l,o) = if ((o == "upvote")) | |
45 | + | then (l + "_upvote") | |
25 | 46 | else throw("Invalid vote type") | |
26 | 47 | ||
27 | 48 | ||
28 | - | func m (g,l) = if ((l == "upvote")) | |
29 | - | then (((g + "_") + l) + "_amount") | |
30 | - | else throw("Invalid vote type") | |
31 | - | ||
32 | - | ||
33 | - | func n (g) = { | |
34 | - | let o = getString(this, f(g)) | |
35 | - | if ($isInstanceOf(o, "String")) | |
49 | + | func p (l) = { | |
50 | + | let f = getString(this, k(l)) | |
51 | + | if ($isInstanceOf(f, "String")) | |
36 | 52 | then { | |
37 | - | let | |
53 | + | let g = f | |
38 | 54 | true | |
39 | 55 | } | |
40 | 56 | else false | |
41 | 57 | } | |
42 | 58 | ||
43 | 59 | ||
44 | - | func q ( | |
45 | - | let | |
46 | - | if ($isInstanceOf( | |
60 | + | func q (r) = { | |
61 | + | let f = getString(this, m(r)) | |
62 | + | if ($isInstanceOf(f, "String")) | |
47 | 63 | then { | |
48 | - | let | |
49 | - | | |
64 | + | let g = f | |
65 | + | g | |
50 | 66 | } | |
51 | 67 | else false | |
52 | 68 | } | |
53 | 69 | ||
54 | 70 | ||
55 | - | func | |
56 | - | let | |
57 | - | if ($isInstanceOf( | |
71 | + | func s (r,t) = { | |
72 | + | let f = getInteger(this, n(r, t)) | |
73 | + | if ($isInstanceOf(f, "Int")) | |
58 | 74 | then { | |
59 | - | let | |
60 | - | | |
75 | + | let g = f | |
76 | + | g | |
61 | 77 | } | |
62 | 78 | else throw("Not a valid vote ID") | |
63 | 79 | } | |
64 | 80 | ||
65 | 81 | ||
66 | - | func t (j,s) = { | |
67 | - | let o = getInteger(this, m(j, s)) | |
68 | - | if ($isInstanceOf(o, "Int")) | |
69 | - | then { | |
70 | - | let p = o | |
71 | - | p | |
72 | - | } | |
73 | - | else 0 | |
74 | - | } | |
82 | + | func u (v,r) = ((((v + "_") + r) + "_") + "vote") | |
75 | 83 | ||
76 | 84 | ||
77 | - | func u (v,j) = ((((v + "_") + j) + "_") + "vote") | |
78 | - | ||
79 | - | ||
80 | - | func w (v,j) = { | |
81 | - | let o = getString(this, u(v, j)) | |
82 | - | if ($isInstanceOf(o, "String")) | |
85 | + | func w (v,r) = { | |
86 | + | let f = getString(this, u(v, r)) | |
87 | + | if ($isInstanceOf(f, "String")) | |
83 | 88 | then { | |
84 | - | let | |
85 | - | | |
89 | + | let g = f | |
90 | + | g | |
86 | 91 | } | |
87 | 92 | else "" | |
88 | 93 | } | |
89 | 94 | ||
90 | 95 | ||
91 | - | func x (v, | |
92 | - | let y = w(v, | |
96 | + | func x (v,r) = { | |
97 | + | let y = w(v, r) | |
93 | 98 | if ((y == "")) | |
94 | 99 | then true | |
95 | 100 | else false | |
96 | 101 | } | |
97 | 102 | ||
98 | 103 | ||
99 | - | func z (A) = (A + "_stake") | |
100 | - | ||
101 | - | ||
102 | - | func B (A) = { | |
103 | - | let o = getInteger(this, z(A)) | |
104 | - | if ($isInstanceOf(o, "Int")) | |
105 | - | then { | |
106 | - | let p = o | |
107 | - | p | |
108 | - | } | |
109 | - | else 0 | |
110 | - | } | |
111 | - | ||
112 | - | ||
113 | - | func C () = "stake_pool" | |
114 | - | ||
115 | - | ||
116 | - | func D () = { | |
117 | - | let o = getInteger(this, C()) | |
118 | - | if ($isInstanceOf(o, "Int")) | |
119 | - | then { | |
120 | - | let p = o | |
121 | - | p | |
122 | - | } | |
123 | - | else 0 | |
124 | - | } | |
125 | - | ||
126 | - | ||
127 | - | @Callable(E) | |
128 | - | func addEntrepreneurProfile (F,G,H,I,J) = if (if (if ((E.caller.bytes == b)) | |
129 | - | then true | |
130 | - | else (E.caller.bytes == c)) | |
131 | - | then true | |
132 | - | else (E.caller.bytes == d)) | |
133 | - | then { | |
134 | - | let K = toBase58String(E.transactionId) | |
135 | - | WriteSet([DataEntry(f(K), ((((((((F + "_") + G) + "_") + H) + "_") + I) + "_") + J)), DataEntry(k(K, "upvote"), 0), DataEntry(m(K, "upvote"), 0), DataEntry(h(K), "open")]) | |
104 | + | @Callable(z) | |
105 | + | func addEntrepreneurProfile (A,B,C,D,E) = if ((z.caller.bytes != b)) | |
106 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
107 | + | else { | |
108 | + | let F = toBase58String(z.transactionId) | |
109 | + | WriteSet([DataEntry(k(F), ((((((((A + "_") + B) + "_") + C) + "_") + D) + "_") + E)), DataEntry(n(F, "upvote"), 0), DataEntry(m(F), "open")]) | |
136 | 110 | } | |
137 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
138 | 111 | ||
139 | 112 | ||
140 | 113 | ||
141 | - | @Callable(E) | |
142 | - | func vote (j,s) = { | |
143 | - | let L = extract(E.payment) | |
144 | - | let y = toBase58String(E.caller.bytes) | |
145 | - | if ((L.amount == 0)) | |
114 | + | @Callable(z) | |
115 | + | func vote (r,t) = { | |
116 | + | let G = extract(z.payment) | |
117 | + | if ((G.amount == 0)) | |
146 | 118 | then throw("You cannot vote without paying voting fee") | |
147 | - | else if (( | |
119 | + | else if ((G.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
148 | 120 | then throw("You can only vote with DYZRUPT token") | |
149 | - | else if (x( | |
150 | - | then if ( | |
151 | - | then if ((q( | |
152 | - | then if (( | |
121 | + | else if (x(toBase58String(z.caller.bytes), r)) | |
122 | + | then if (p(r)) | |
123 | + | then if ((q(r) == "open")) | |
124 | + | then if ((t == a)) | |
153 | 125 | then { | |
154 | - | let M = r(j, s) | |
155 | - | let N = t(j, s) | |
156 | - | let O = (M + 1) | |
157 | - | let P = (N + L.amount) | |
158 | - | ScriptResult(WriteSet([DataEntry(k(j, s), O), DataEntry(u(y, j), j), DataEntry(i(y, j), L.amount), DataEntry(m(j, s), P)]), TransferSet([ScriptTransfer(this, L.amount, e)])) | |
126 | + | let H = s(r, t) | |
127 | + | let I = (H + 1) | |
128 | + | ScriptResult(WriteSet([DataEntry(n(r, t), I), DataEntry(u(toBase58String(z.caller.bytes), r), r)]), TransferSet([ScriptTransfer(this, G.amount, c)])) | |
159 | 129 | } | |
160 | 130 | else throw("Not a valid vote value") | |
161 | 131 | else throw("This profile is not open for voting") | |
165 | 135 | ||
166 | 136 | ||
167 | 137 | ||
168 | - | @Callable(E) | |
169 | - | func openVote (j) = if (if (if ((E.caller.bytes == b)) | |
170 | - | then true | |
171 | - | else (E.caller.bytes == c)) | |
172 | - | then true | |
173 | - | else (E.caller.bytes == d)) | |
174 | - | then if (n(j)) | |
175 | - | then WriteSet([DataEntry(h(j), "open")]) | |
138 | + | @Callable(z) | |
139 | + | func openVote (r) = if ((z.caller.bytes != b)) | |
140 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
141 | + | else if (p(r)) | |
142 | + | then WriteSet([DataEntry(m(r), "open")]) | |
176 | 143 | else throw("Invalid ID") | |
177 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
178 | 144 | ||
179 | 145 | ||
180 | 146 | ||
181 | - | @Callable(E) | |
182 | - | func closeVote (j) = if (if (if ((E.caller.bytes == b)) | |
183 | - | then true | |
184 | - | else (E.caller.bytes == c)) | |
185 | - | then true | |
186 | - | else (E.caller.bytes == d)) | |
187 | - | then if (n(j)) | |
188 | - | then WriteSet([DataEntry(h(j), "closed")]) | |
147 | + | @Callable(z) | |
148 | + | func closeVote (r) = if ((z.caller.bytes != b)) | |
149 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
150 | + | else if (p(r)) | |
151 | + | then WriteSet([DataEntry(m(r), "closed")]) | |
189 | 152 | else throw("Invalid ID") | |
190 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
191 | 153 | ||
192 | 154 | ||
193 | 155 | ||
194 | - | @Callable(E) | |
195 | - | func withdraw (j) = { | |
196 | - | let y = toBase58String(E.caller.bytes) | |
197 | - | if ((w(y, j) != "")) | |
198 | - | then if ((q(j) == "closed")) | |
199 | - | then { | |
200 | - | let Q = i(y, j) | |
201 | - | let R = { | |
202 | - | let o = getInteger(this, Q) | |
203 | - | if ($isInstanceOf(o, "Int")) | |
204 | - | then { | |
205 | - | let p = o | |
206 | - | p | |
207 | - | } | |
208 | - | else throw("You didn't vote for this entrepreneur") | |
209 | - | } | |
210 | - | if ((R == 0)) | |
211 | - | then throw("Seems you have previously withdrawn.") | |
212 | - | else ScriptResult(WriteSet([DataEntry(Q, 0)]), TransferSet([ScriptTransfer(E.caller, R, e)])) | |
213 | - | } | |
214 | - | else throw("Can't withdraw vote amount while voting is still open.") | |
215 | - | else throw("You didn't vote for this entrepreneur") | |
216 | - | } | |
217 | - | ||
218 | - | ||
219 | - | ||
220 | - | @Callable(E) | |
156 | + | @Callable(z) | |
221 | 157 | func stake () = { | |
222 | - | let | |
223 | - | let | |
224 | - | if (( | |
158 | + | let i = toBase58String(z.caller.bytes) | |
159 | + | let G = extract(z.payment) | |
160 | + | if ((G.amount == 0)) | |
225 | 161 | then throw("Stake amount too low") | |
226 | - | else if (( | |
162 | + | else if ((G.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
227 | 163 | then throw("You can only stake with DYZRUPT token") | |
228 | 164 | else { | |
229 | - | let S = B(A) | |
230 | - | let T = (10 / 100) | |
231 | - | let U = (L.amount * T) | |
232 | - | let V = (L.amount - U) | |
233 | - | let W = (S + V) | |
234 | - | let X = D() | |
235 | - | let Y = (X + U) | |
236 | - | ScriptResult(WriteSet([DataEntry(z(A), W), DataEntry(C(), Y)]), TransferSet([ScriptTransfer(this, L.amount, e)])) | |
165 | + | let J = j(i) | |
166 | + | let K = fraction(G.amount, 10, 100) | |
167 | + | let L = (G.amount - K) | |
168 | + | let M = (J + L) | |
169 | + | let N = e() | |
170 | + | let O = (N + K) | |
171 | + | ScriptResult(WriteSet([DataEntry(h(i), M), DataEntry(d(), O)]), TransferSet(nil)) | |
237 | 172 | } | |
238 | 173 | } | |
239 | 174 | ||
240 | 175 | ||
241 | 176 | ||
242 | - | @Callable( | |
243 | - | func unstake ( | |
244 | - | let | |
245 | - | let | |
246 | - | if (( | |
177 | + | @Callable(z) | |
178 | + | func unstake (P) = { | |
179 | + | let i = toBase58String(z.caller.bytes) | |
180 | + | let J = j(i) | |
181 | + | if ((J == 0)) | |
247 | 182 | then throw("You don't have any stakes") | |
248 | - | else if (( | |
183 | + | else if ((P > J)) | |
249 | 184 | then throw("You can't withdraw an amount higher than you staked") | |
250 | 185 | else { | |
251 | - | let aa = (20 / 100) | |
252 | - | let ab = (Z * aa) | |
253 | - | let ac = (Z - ab) | |
254 | - | let ad = (S - Z) | |
255 | - | let X = D() | |
256 | - | let Y = (X + ab) | |
257 | - | ScriptResult(WriteSet([DataEntry(z(A), ad), DataEntry(C(), Y)]), TransferSet([ScriptTransfer(E.caller, ac, e)])) | |
186 | + | let Q = fraction(P, 20, 100) | |
187 | + | let R = (P - Q) | |
188 | + | let S = (J - P) | |
189 | + | let N = e() | |
190 | + | let O = (N + Q) | |
191 | + | ScriptResult(WriteSet([DataEntry(h(i), S), DataEntry(d(), O)]), TransferSet([ScriptTransfer(z.caller, R, c)])) | |
258 | 192 | } | |
259 | 193 | } | |
260 | 194 | ||
261 | 195 | ||
262 | 196 | ||
263 | - | @Callable( | |
264 | - | func claimDailyStakeReward ( | |
265 | - | let | |
266 | - | let | |
267 | - | let | |
268 | - | if (( | |
197 | + | @Callable(z) | |
198 | + | func claimDailyStakeReward (T) = { | |
199 | + | let i = toBase58String(z.caller.bytes) | |
200 | + | let J = j(i) | |
201 | + | let N = e() | |
202 | + | if ((J == 0)) | |
269 | 203 | then throw("You don't have any stakes") | |
270 | - | else if (( | |
204 | + | else if ((N == 0)) | |
271 | 205 | then throw("Nothing in Stake pool at this time. Try again later") | |
272 | - | else if (( | |
206 | + | else if ((T > N)) | |
273 | 207 | then throw("No rewards at this time") | |
274 | 208 | else { | |
275 | - | let | |
276 | - | let | |
277 | - | ScriptResult(WriteSet([DataEntry( | |
209 | + | let O = (N - T) | |
210 | + | let U = (J - T) | |
211 | + | ScriptResult(WriteSet([DataEntry(h(i), U), DataEntry(d(), O)]), TransferSet([ScriptTransfer(z.caller, T, c)])) | |
278 | 212 | } | |
279 | 213 | } | |
280 | 214 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "upvote" | |
5 | 5 | ||
6 | 6 | let b = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC' | |
7 | 7 | ||
8 | - | let c = base58' | |
8 | + | let c = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' | |
9 | 9 | ||
10 | - | let d = base58'3Mucpi1K4FMVrZKnYEgjxQf5DkkBX7QrHoJ' | |
11 | - | ||
12 | - | let e = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' | |
13 | - | ||
14 | - | func f (g) = (g + "_entrepreneurProfile") | |
10 | + | func d () = "stake_pool" | |
15 | 11 | ||
16 | 12 | ||
17 | - | func h (g) = (g + "_status") | |
13 | + | func e () = { | |
14 | + | let f = getInteger(this, d()) | |
15 | + | if ($isInstanceOf(f, "Int")) | |
16 | + | then { | |
17 | + | let g = f | |
18 | + | g | |
19 | + | } | |
20 | + | else 0 | |
21 | + | } | |
18 | 22 | ||
19 | 23 | ||
20 | - | func | |
24 | + | func h (i) = (i + "_stake") | |
21 | 25 | ||
22 | 26 | ||
23 | - | func k (g,l) = if ((l == "upvote")) | |
24 | - | then (g + "_upvote") | |
27 | + | func j (i) = { | |
28 | + | let f = getInteger(this, h(i)) | |
29 | + | if ($isInstanceOf(f, "Int")) | |
30 | + | then { | |
31 | + | let g = f | |
32 | + | g | |
33 | + | } | |
34 | + | else 0 | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func k (l) = (l + "_entrepreneurProfile") | |
39 | + | ||
40 | + | ||
41 | + | func m (l) = (l + "_status") | |
42 | + | ||
43 | + | ||
44 | + | func n (l,o) = if ((o == "upvote")) | |
45 | + | then (l + "_upvote") | |
25 | 46 | else throw("Invalid vote type") | |
26 | 47 | ||
27 | 48 | ||
28 | - | func m (g,l) = if ((l == "upvote")) | |
29 | - | then (((g + "_") + l) + "_amount") | |
30 | - | else throw("Invalid vote type") | |
31 | - | ||
32 | - | ||
33 | - | func n (g) = { | |
34 | - | let o = getString(this, f(g)) | |
35 | - | if ($isInstanceOf(o, "String")) | |
49 | + | func p (l) = { | |
50 | + | let f = getString(this, k(l)) | |
51 | + | if ($isInstanceOf(f, "String")) | |
36 | 52 | then { | |
37 | - | let | |
53 | + | let g = f | |
38 | 54 | true | |
39 | 55 | } | |
40 | 56 | else false | |
41 | 57 | } | |
42 | 58 | ||
43 | 59 | ||
44 | - | func q ( | |
45 | - | let | |
46 | - | if ($isInstanceOf( | |
60 | + | func q (r) = { | |
61 | + | let f = getString(this, m(r)) | |
62 | + | if ($isInstanceOf(f, "String")) | |
47 | 63 | then { | |
48 | - | let | |
49 | - | | |
64 | + | let g = f | |
65 | + | g | |
50 | 66 | } | |
51 | 67 | else false | |
52 | 68 | } | |
53 | 69 | ||
54 | 70 | ||
55 | - | func | |
56 | - | let | |
57 | - | if ($isInstanceOf( | |
71 | + | func s (r,t) = { | |
72 | + | let f = getInteger(this, n(r, t)) | |
73 | + | if ($isInstanceOf(f, "Int")) | |
58 | 74 | then { | |
59 | - | let | |
60 | - | | |
75 | + | let g = f | |
76 | + | g | |
61 | 77 | } | |
62 | 78 | else throw("Not a valid vote ID") | |
63 | 79 | } | |
64 | 80 | ||
65 | 81 | ||
66 | - | func t (j,s) = { | |
67 | - | let o = getInteger(this, m(j, s)) | |
68 | - | if ($isInstanceOf(o, "Int")) | |
69 | - | then { | |
70 | - | let p = o | |
71 | - | p | |
72 | - | } | |
73 | - | else 0 | |
74 | - | } | |
82 | + | func u (v,r) = ((((v + "_") + r) + "_") + "vote") | |
75 | 83 | ||
76 | 84 | ||
77 | - | func u (v,j) = ((((v + "_") + j) + "_") + "vote") | |
78 | - | ||
79 | - | ||
80 | - | func w (v,j) = { | |
81 | - | let o = getString(this, u(v, j)) | |
82 | - | if ($isInstanceOf(o, "String")) | |
85 | + | func w (v,r) = { | |
86 | + | let f = getString(this, u(v, r)) | |
87 | + | if ($isInstanceOf(f, "String")) | |
83 | 88 | then { | |
84 | - | let | |
85 | - | | |
89 | + | let g = f | |
90 | + | g | |
86 | 91 | } | |
87 | 92 | else "" | |
88 | 93 | } | |
89 | 94 | ||
90 | 95 | ||
91 | - | func x (v, | |
92 | - | let y = w(v, | |
96 | + | func x (v,r) = { | |
97 | + | let y = w(v, r) | |
93 | 98 | if ((y == "")) | |
94 | 99 | then true | |
95 | 100 | else false | |
96 | 101 | } | |
97 | 102 | ||
98 | 103 | ||
99 | - | func z (A) = (A + "_stake") | |
100 | - | ||
101 | - | ||
102 | - | func B (A) = { | |
103 | - | let o = getInteger(this, z(A)) | |
104 | - | if ($isInstanceOf(o, "Int")) | |
105 | - | then { | |
106 | - | let p = o | |
107 | - | p | |
108 | - | } | |
109 | - | else 0 | |
110 | - | } | |
111 | - | ||
112 | - | ||
113 | - | func C () = "stake_pool" | |
114 | - | ||
115 | - | ||
116 | - | func D () = { | |
117 | - | let o = getInteger(this, C()) | |
118 | - | if ($isInstanceOf(o, "Int")) | |
119 | - | then { | |
120 | - | let p = o | |
121 | - | p | |
122 | - | } | |
123 | - | else 0 | |
124 | - | } | |
125 | - | ||
126 | - | ||
127 | - | @Callable(E) | |
128 | - | func addEntrepreneurProfile (F,G,H,I,J) = if (if (if ((E.caller.bytes == b)) | |
129 | - | then true | |
130 | - | else (E.caller.bytes == c)) | |
131 | - | then true | |
132 | - | else (E.caller.bytes == d)) | |
133 | - | then { | |
134 | - | let K = toBase58String(E.transactionId) | |
135 | - | WriteSet([DataEntry(f(K), ((((((((F + "_") + G) + "_") + H) + "_") + I) + "_") + J)), DataEntry(k(K, "upvote"), 0), DataEntry(m(K, "upvote"), 0), DataEntry(h(K), "open")]) | |
104 | + | @Callable(z) | |
105 | + | func addEntrepreneurProfile (A,B,C,D,E) = if ((z.caller.bytes != b)) | |
106 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
107 | + | else { | |
108 | + | let F = toBase58String(z.transactionId) | |
109 | + | WriteSet([DataEntry(k(F), ((((((((A + "_") + B) + "_") + C) + "_") + D) + "_") + E)), DataEntry(n(F, "upvote"), 0), DataEntry(m(F), "open")]) | |
136 | 110 | } | |
137 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
138 | 111 | ||
139 | 112 | ||
140 | 113 | ||
141 | - | @Callable(E) | |
142 | - | func vote (j,s) = { | |
143 | - | let L = extract(E.payment) | |
144 | - | let y = toBase58String(E.caller.bytes) | |
145 | - | if ((L.amount == 0)) | |
114 | + | @Callable(z) | |
115 | + | func vote (r,t) = { | |
116 | + | let G = extract(z.payment) | |
117 | + | if ((G.amount == 0)) | |
146 | 118 | then throw("You cannot vote without paying voting fee") | |
147 | - | else if (( | |
119 | + | else if ((G.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
148 | 120 | then throw("You can only vote with DYZRUPT token") | |
149 | - | else if (x( | |
150 | - | then if ( | |
151 | - | then if ((q( | |
152 | - | then if (( | |
121 | + | else if (x(toBase58String(z.caller.bytes), r)) | |
122 | + | then if (p(r)) | |
123 | + | then if ((q(r) == "open")) | |
124 | + | then if ((t == a)) | |
153 | 125 | then { | |
154 | - | let M = r(j, s) | |
155 | - | let N = t(j, s) | |
156 | - | let O = (M + 1) | |
157 | - | let P = (N + L.amount) | |
158 | - | ScriptResult(WriteSet([DataEntry(k(j, s), O), DataEntry(u(y, j), j), DataEntry(i(y, j), L.amount), DataEntry(m(j, s), P)]), TransferSet([ScriptTransfer(this, L.amount, e)])) | |
126 | + | let H = s(r, t) | |
127 | + | let I = (H + 1) | |
128 | + | ScriptResult(WriteSet([DataEntry(n(r, t), I), DataEntry(u(toBase58String(z.caller.bytes), r), r)]), TransferSet([ScriptTransfer(this, G.amount, c)])) | |
159 | 129 | } | |
160 | 130 | else throw("Not a valid vote value") | |
161 | 131 | else throw("This profile is not open for voting") | |
162 | 132 | else throw("Invalid Profile") | |
163 | 133 | else throw("You can't vote twice") | |
164 | 134 | } | |
165 | 135 | ||
166 | 136 | ||
167 | 137 | ||
168 | - | @Callable(E) | |
169 | - | func openVote (j) = if (if (if ((E.caller.bytes == b)) | |
170 | - | then true | |
171 | - | else (E.caller.bytes == c)) | |
172 | - | then true | |
173 | - | else (E.caller.bytes == d)) | |
174 | - | then if (n(j)) | |
175 | - | then WriteSet([DataEntry(h(j), "open")]) | |
138 | + | @Callable(z) | |
139 | + | func openVote (r) = if ((z.caller.bytes != b)) | |
140 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
141 | + | else if (p(r)) | |
142 | + | then WriteSet([DataEntry(m(r), "open")]) | |
176 | 143 | else throw("Invalid ID") | |
177 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
178 | 144 | ||
179 | 145 | ||
180 | 146 | ||
181 | - | @Callable(E) | |
182 | - | func closeVote (j) = if (if (if ((E.caller.bytes == b)) | |
183 | - | then true | |
184 | - | else (E.caller.bytes == c)) | |
185 | - | then true | |
186 | - | else (E.caller.bytes == d)) | |
187 | - | then if (n(j)) | |
188 | - | then WriteSet([DataEntry(h(j), "closed")]) | |
147 | + | @Callable(z) | |
148 | + | func closeVote (r) = if ((z.caller.bytes != b)) | |
149 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
150 | + | else if (p(r)) | |
151 | + | then WriteSet([DataEntry(m(r), "closed")]) | |
189 | 152 | else throw("Invalid ID") | |
190 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
191 | 153 | ||
192 | 154 | ||
193 | 155 | ||
194 | - | @Callable(E) | |
195 | - | func withdraw (j) = { | |
196 | - | let y = toBase58String(E.caller.bytes) | |
197 | - | if ((w(y, j) != "")) | |
198 | - | then if ((q(j) == "closed")) | |
199 | - | then { | |
200 | - | let Q = i(y, j) | |
201 | - | let R = { | |
202 | - | let o = getInteger(this, Q) | |
203 | - | if ($isInstanceOf(o, "Int")) | |
204 | - | then { | |
205 | - | let p = o | |
206 | - | p | |
207 | - | } | |
208 | - | else throw("You didn't vote for this entrepreneur") | |
209 | - | } | |
210 | - | if ((R == 0)) | |
211 | - | then throw("Seems you have previously withdrawn.") | |
212 | - | else ScriptResult(WriteSet([DataEntry(Q, 0)]), TransferSet([ScriptTransfer(E.caller, R, e)])) | |
213 | - | } | |
214 | - | else throw("Can't withdraw vote amount while voting is still open.") | |
215 | - | else throw("You didn't vote for this entrepreneur") | |
216 | - | } | |
217 | - | ||
218 | - | ||
219 | - | ||
220 | - | @Callable(E) | |
156 | + | @Callable(z) | |
221 | 157 | func stake () = { | |
222 | - | let | |
223 | - | let | |
224 | - | if (( | |
158 | + | let i = toBase58String(z.caller.bytes) | |
159 | + | let G = extract(z.payment) | |
160 | + | if ((G.amount == 0)) | |
225 | 161 | then throw("Stake amount too low") | |
226 | - | else if (( | |
162 | + | else if ((G.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
227 | 163 | then throw("You can only stake with DYZRUPT token") | |
228 | 164 | else { | |
229 | - | let S = B(A) | |
230 | - | let T = (10 / 100) | |
231 | - | let U = (L.amount * T) | |
232 | - | let V = (L.amount - U) | |
233 | - | let W = (S + V) | |
234 | - | let X = D() | |
235 | - | let Y = (X + U) | |
236 | - | ScriptResult(WriteSet([DataEntry(z(A), W), DataEntry(C(), Y)]), TransferSet([ScriptTransfer(this, L.amount, e)])) | |
165 | + | let J = j(i) | |
166 | + | let K = fraction(G.amount, 10, 100) | |
167 | + | let L = (G.amount - K) | |
168 | + | let M = (J + L) | |
169 | + | let N = e() | |
170 | + | let O = (N + K) | |
171 | + | ScriptResult(WriteSet([DataEntry(h(i), M), DataEntry(d(), O)]), TransferSet(nil)) | |
237 | 172 | } | |
238 | 173 | } | |
239 | 174 | ||
240 | 175 | ||
241 | 176 | ||
242 | - | @Callable( | |
243 | - | func unstake ( | |
244 | - | let | |
245 | - | let | |
246 | - | if (( | |
177 | + | @Callable(z) | |
178 | + | func unstake (P) = { | |
179 | + | let i = toBase58String(z.caller.bytes) | |
180 | + | let J = j(i) | |
181 | + | if ((J == 0)) | |
247 | 182 | then throw("You don't have any stakes") | |
248 | - | else if (( | |
183 | + | else if ((P > J)) | |
249 | 184 | then throw("You can't withdraw an amount higher than you staked") | |
250 | 185 | else { | |
251 | - | let aa = (20 / 100) | |
252 | - | let ab = (Z * aa) | |
253 | - | let ac = (Z - ab) | |
254 | - | let ad = (S - Z) | |
255 | - | let X = D() | |
256 | - | let Y = (X + ab) | |
257 | - | ScriptResult(WriteSet([DataEntry(z(A), ad), DataEntry(C(), Y)]), TransferSet([ScriptTransfer(E.caller, ac, e)])) | |
186 | + | let Q = fraction(P, 20, 100) | |
187 | + | let R = (P - Q) | |
188 | + | let S = (J - P) | |
189 | + | let N = e() | |
190 | + | let O = (N + Q) | |
191 | + | ScriptResult(WriteSet([DataEntry(h(i), S), DataEntry(d(), O)]), TransferSet([ScriptTransfer(z.caller, R, c)])) | |
258 | 192 | } | |
259 | 193 | } | |
260 | 194 | ||
261 | 195 | ||
262 | 196 | ||
263 | - | @Callable( | |
264 | - | func claimDailyStakeReward ( | |
265 | - | let | |
266 | - | let | |
267 | - | let | |
268 | - | if (( | |
197 | + | @Callable(z) | |
198 | + | func claimDailyStakeReward (T) = { | |
199 | + | let i = toBase58String(z.caller.bytes) | |
200 | + | let J = j(i) | |
201 | + | let N = e() | |
202 | + | if ((J == 0)) | |
269 | 203 | then throw("You don't have any stakes") | |
270 | - | else if (( | |
204 | + | else if ((N == 0)) | |
271 | 205 | then throw("Nothing in Stake pool at this time. Try again later") | |
272 | - | else if (( | |
206 | + | else if ((T > N)) | |
273 | 207 | then throw("No rewards at this time") | |
274 | 208 | else { | |
275 | - | let | |
276 | - | let | |
277 | - | ScriptResult(WriteSet([DataEntry( | |
209 | + | let O = (N - T) | |
210 | + | let U = (J - T) | |
211 | + | ScriptResult(WriteSet([DataEntry(h(i), U), DataEntry(d(), O)]), TransferSet([ScriptTransfer(z.caller, T, c)])) | |
278 | 212 | } | |
279 | 213 | } | |
280 | 214 | ||
281 | 215 |
github/deemru/w8io/169f3d6 55.97 ms ◑