tx · 3CHyyt5jbdWJLwefWPdFLsoULr7esVBNzRjDoaREYCPy 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu: -0.05000000 Waves 2020.11.25 18:22 [1281111] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves
{ "type": 13, "id": "3CHyyt5jbdWJLwefWPdFLsoULr7esVBNzRjDoaREYCPy", "fee": 5000000, "feeAssetId": null, "timestamp": 1606317806440, "version": 2, "chainId": 84, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "2e1EsmAuAg28NDnoRwUyzPrcyZqdzAb3WyiLZTQGMHncpJQfGAe48Ci47tg5FvL9FcGCjb4Yj8WqWT7KVvvV97db" ], "script": "base64:AAIDAAAAAAAAACcIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgSABIDCgEBEgMKAQEAAAARAAAAAAZ1cFZvdGUCAAAABnVwdm90ZQAAAAAMYWRtaW5BZGRyZXNzAQAAABoBVKwsfOull8+XvAKI3oesQVhDOp0+0MrSkgAAAAAFZHl6SWQBAAAAIH6rQdnOUsq3YY00nk9jVDL2OOQ/e846gXAImq8xTxZrAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAgAAAApzdGFrZV9wb29sAQAAAAxnZXRTdGFrZVBvb2wAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADGdldFN0YWtlcktleQAAAAEAAAAGc3Rha2VyCQABLAAAAAIFAAAABnN0YWtlcgIAAAAGX3N0YWtlAQAAAA9nZXRDdXJyZW50U3Rha2UAAAABAAAABnN0YWtlcgQAAAAHJG1hdGNoMAkABBoAAAACB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N0YWtlUG9vbEtleQAAAAAFAAAADG5ld1N0YWtlUG9vbAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGcmV3YXJkBQAAAAVkeXpJZAUAAAADbmlsAAAAAE3lltY=", "height": 1281111, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GXakgudwXb6iNeXLgPb2CrJxYW48UHHTSKQDJCuZNP26 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "upvote" | |
5 | 5 | ||
6 | - | let b = base58' | |
6 | + | let b = base58'3N5cTHzbHc9dyQuBfKMjFKaxcrmRq54XDLu' | |
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 (t) = { | |
72 | + | let f = getInteger(this, ("last_claim_" + t)) | |
73 | + | if ($isInstanceOf(f, "Int")) | |
58 | 74 | then { | |
59 | - | let p = o | |
60 | - | p | |
75 | + | let g = f | |
76 | + | g | |
77 | + | } | |
78 | + | else 0 | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func u (r,v) = { | |
83 | + | let f = getInteger(this, n(r, v)) | |
84 | + | if ($isInstanceOf(f, "Int")) | |
85 | + | then { | |
86 | + | let g = f | |
87 | + | g | |
61 | 88 | } | |
62 | 89 | else throw("Not a valid vote ID") | |
63 | 90 | } | |
64 | 91 | ||
65 | 92 | ||
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 | - | } | |
93 | + | func w (x,r) = ((((x + "_") + r) + "_") + "vote") | |
75 | 94 | ||
76 | 95 | ||
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")) | |
96 | + | func y (x,r) = { | |
97 | + | let f = getString(this, w(x, r)) | |
98 | + | if ($isInstanceOf(f, "String")) | |
83 | 99 | then { | |
84 | - | let | |
85 | - | | |
100 | + | let g = f | |
101 | + | g | |
86 | 102 | } | |
87 | 103 | else "" | |
88 | 104 | } | |
89 | 105 | ||
90 | 106 | ||
91 | - | func | |
92 | - | let | |
93 | - | if (( | |
107 | + | func z (x,r) = { | |
108 | + | let A = y(x, r) | |
109 | + | if ((A == "")) | |
94 | 110 | then true | |
95 | 111 | else false | |
96 | 112 | } | |
97 | 113 | ||
98 | 114 | ||
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")]) | |
115 | + | @Callable(B) | |
116 | + | func addEntrepreneurProfile (C,D,E,F,G) = if ((B.caller.bytes != b)) | |
117 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
118 | + | else { | |
119 | + | let H = toBase58String(B.transactionId) | |
120 | + | WriteSet([DataEntry(k(H), ((((((((C + "_") + D) + "_") + E) + "_") + F) + "_") + G)), DataEntry(n(H, "upvote"), 0), DataEntry(m(H), "open")]) | |
136 | 121 | } | |
137 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
138 | 122 | ||
139 | 123 | ||
140 | 124 | ||
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)) | |
125 | + | @Callable(B) | |
126 | + | func vote (r,v) = { | |
127 | + | let I = extract(B.payment) | |
128 | + | if ((I.amount == 0)) | |
146 | 129 | then throw("You cannot vote without paying voting fee") | |
147 | - | else if (( | |
130 | + | else if ((I.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
148 | 131 | then throw("You can only vote with DYZRUPT token") | |
149 | - | else if ( | |
150 | - | then if ( | |
151 | - | then if ((q( | |
152 | - | then if (( | |
132 | + | else if (z(toBase58String(B.caller.bytes), r)) | |
133 | + | then if (p(r)) | |
134 | + | then if ((q(r) == "open")) | |
135 | + | then if ((v == a)) | |
153 | 136 | 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)])) | |
137 | + | let J = u(r, v) | |
138 | + | let K = (J + 1) | |
139 | + | ScriptResult(WriteSet([DataEntry(n(r, v), K), DataEntry(w(toBase58String(B.caller.bytes), r), r)]), TransferSet([ScriptTransfer(this, I.amount, c)])) | |
159 | 140 | } | |
160 | 141 | else throw("Not a valid vote value") | |
161 | 142 | else throw("This profile is not open for voting") | |
165 | 146 | ||
166 | 147 | ||
167 | 148 | ||
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")]) | |
149 | + | @Callable(B) | |
150 | + | func openVote (r) = if ((B.caller.bytes != b)) | |
151 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
152 | + | else if (p(r)) | |
153 | + | then WriteSet([DataEntry(m(r), "open")]) | |
176 | 154 | else throw("Invalid ID") | |
177 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
178 | 155 | ||
179 | 156 | ||
180 | 157 | ||
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")]) | |
158 | + | @Callable(B) | |
159 | + | func closeVote (r) = if ((B.caller.bytes != b)) | |
160 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
161 | + | else if (p(r)) | |
162 | + | then WriteSet([DataEntry(m(r), "closed")]) | |
189 | 163 | else throw("Invalid ID") | |
190 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
191 | 164 | ||
192 | 165 | ||
193 | 166 | ||
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) | |
167 | + | @Callable(B) | |
221 | 168 | func stake () = { | |
222 | - | let | |
223 | - | let | |
224 | - | if (( | |
169 | + | let i = toBase58String(B.caller.bytes) | |
170 | + | let I = extract(B.payment) | |
171 | + | if ((I.amount == 0)) | |
225 | 172 | then throw("Stake amount too low") | |
226 | - | else if (( | |
173 | + | else if ((I.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
227 | 174 | then throw("You can only stake with DYZRUPT token") | |
228 | 175 | else { | |
229 | - | let S = B(A) | |
230 | - | let T = (20 / 100) | |
231 | - | let U = (L.amount * T) | |
232 | - | let V = (L.amount - U) | |
233 | - | let W = (S + V) | |
234 | - | ScriptResult(WriteSet([DataEntry(z(A), W)]), TransferSet([ScriptTransfer(this, L.amount, e)])) | |
176 | + | let L = j(i) | |
177 | + | let M = fraction(I.amount, 5, 100) | |
178 | + | let N = (I.amount - M) | |
179 | + | let O = (L + N) | |
180 | + | let P = e() | |
181 | + | let Q = (P + M) | |
182 | + | ScriptResult(WriteSet([DataEntry(h(i), O), DataEntry(d(), Q)]), TransferSet(nil)) | |
235 | 183 | } | |
236 | 184 | } | |
237 | 185 | ||
238 | 186 | ||
239 | 187 | ||
240 | - | @Callable( | |
241 | - | func unstake ( | |
242 | - | let | |
243 | - | let | |
244 | - | if (( | |
188 | + | @Callable(B) | |
189 | + | func unstake (R) = { | |
190 | + | let i = toBase58String(B.caller.bytes) | |
191 | + | let L = j(i) | |
192 | + | if ((L == 0)) | |
245 | 193 | then throw("You don't have any stakes") | |
246 | - | else if (( | |
194 | + | else if ((R > L)) | |
247 | 195 | then throw("You can't withdraw an amount higher than you staked") | |
248 | 196 | else { | |
249 | - | let W = (S - X) | |
250 | - | ScriptResult(WriteSet([DataEntry(z(A), W)]), TransferSet([ScriptTransfer(E.caller, X, e)])) | |
197 | + | let S = fraction(R, 10, 100) | |
198 | + | let T = (R - S) | |
199 | + | let U = (L - R) | |
200 | + | let P = e() | |
201 | + | let Q = (P + S) | |
202 | + | ScriptResult(WriteSet([DataEntry(h(i), U), DataEntry(d(), Q)]), TransferSet([ScriptTransfer(B.caller, T, c)])) | |
251 | 203 | } | |
252 | 204 | } | |
253 | 205 | ||
254 | 206 | ||
255 | 207 | ||
256 | - | @Callable(E) | |
257 | - | func claimDailyStakeReward (Y) = { | |
258 | - | let A = toBase58String(E.caller.bytes) | |
259 | - | let S = B(A) | |
260 | - | let Z = D() | |
261 | - | if ((S == 0)) | |
208 | + | @Callable(B) | |
209 | + | func claimDailyStakeReward (V) = { | |
210 | + | let i = toBase58String(B.caller.bytes) | |
211 | + | let L = j(i) | |
212 | + | let P = e() | |
213 | + | let W = height | |
214 | + | let X = s(i) | |
215 | + | if ((L == 0)) | |
262 | 216 | then throw("You don't have any stakes") | |
263 | - | else if (( | |
217 | + | else if ((P == 0)) | |
264 | 218 | then throw("Nothing in Stake pool at this time. Try again later") | |
265 | - | else if (( | |
219 | + | else if ((V > P)) | |
266 | 220 | then throw("No rewards at this time") | |
267 | - | else { | |
268 | - | let aa = (Z - Y) | |
269 | - | let ab = (S - Y) | |
270 | - | ScriptResult(WriteSet([DataEntry(z(A), ab), DataEntry(C(), aa)]), TransferSet([ScriptTransfer(E.caller, Y, e)])) | |
271 | - | } | |
221 | + | else if (((X + 1440) > W)) | |
222 | + | then throw("You can only claim once a day") | |
223 | + | else { | |
224 | + | let Q = (P - V) | |
225 | + | let Y = (L - V) | |
226 | + | ScriptResult(WriteSet([DataEntry(("last_claim_" + i), W), DataEntry(h(i), Y), DataEntry(d(), Q)]), TransferSet([ScriptTransfer(B.caller, V, c)])) | |
227 | + | } | |
272 | 228 | } | |
273 | 229 | ||
274 | 230 |
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 | - | let b = base58' | |
6 | + | let b = base58'3N5cTHzbHc9dyQuBfKMjFKaxcrmRq54XDLu' | |
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 (t) = { | |
72 | + | let f = getInteger(this, ("last_claim_" + t)) | |
73 | + | if ($isInstanceOf(f, "Int")) | |
58 | 74 | then { | |
59 | - | let p = o | |
60 | - | p | |
75 | + | let g = f | |
76 | + | g | |
77 | + | } | |
78 | + | else 0 | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func u (r,v) = { | |
83 | + | let f = getInteger(this, n(r, v)) | |
84 | + | if ($isInstanceOf(f, "Int")) | |
85 | + | then { | |
86 | + | let g = f | |
87 | + | g | |
61 | 88 | } | |
62 | 89 | else throw("Not a valid vote ID") | |
63 | 90 | } | |
64 | 91 | ||
65 | 92 | ||
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 | - | } | |
93 | + | func w (x,r) = ((((x + "_") + r) + "_") + "vote") | |
75 | 94 | ||
76 | 95 | ||
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")) | |
96 | + | func y (x,r) = { | |
97 | + | let f = getString(this, w(x, r)) | |
98 | + | if ($isInstanceOf(f, "String")) | |
83 | 99 | then { | |
84 | - | let | |
85 | - | | |
100 | + | let g = f | |
101 | + | g | |
86 | 102 | } | |
87 | 103 | else "" | |
88 | 104 | } | |
89 | 105 | ||
90 | 106 | ||
91 | - | func | |
92 | - | let | |
93 | - | if (( | |
107 | + | func z (x,r) = { | |
108 | + | let A = y(x, r) | |
109 | + | if ((A == "")) | |
94 | 110 | then true | |
95 | 111 | else false | |
96 | 112 | } | |
97 | 113 | ||
98 | 114 | ||
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")]) | |
115 | + | @Callable(B) | |
116 | + | func addEntrepreneurProfile (C,D,E,F,G) = if ((B.caller.bytes != b)) | |
117 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
118 | + | else { | |
119 | + | let H = toBase58String(B.transactionId) | |
120 | + | WriteSet([DataEntry(k(H), ((((((((C + "_") + D) + "_") + E) + "_") + F) + "_") + G)), DataEntry(n(H, "upvote"), 0), DataEntry(m(H), "open")]) | |
136 | 121 | } | |
137 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
138 | 122 | ||
139 | 123 | ||
140 | 124 | ||
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)) | |
125 | + | @Callable(B) | |
126 | + | func vote (r,v) = { | |
127 | + | let I = extract(B.payment) | |
128 | + | if ((I.amount == 0)) | |
146 | 129 | then throw("You cannot vote without paying voting fee") | |
147 | - | else if (( | |
130 | + | else if ((I.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
148 | 131 | then throw("You can only vote with DYZRUPT token") | |
149 | - | else if ( | |
150 | - | then if ( | |
151 | - | then if ((q( | |
152 | - | then if (( | |
132 | + | else if (z(toBase58String(B.caller.bytes), r)) | |
133 | + | then if (p(r)) | |
134 | + | then if ((q(r) == "open")) | |
135 | + | then if ((v == a)) | |
153 | 136 | 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)])) | |
137 | + | let J = u(r, v) | |
138 | + | let K = (J + 1) | |
139 | + | ScriptResult(WriteSet([DataEntry(n(r, v), K), DataEntry(w(toBase58String(B.caller.bytes), r), r)]), TransferSet([ScriptTransfer(this, I.amount, c)])) | |
159 | 140 | } | |
160 | 141 | else throw("Not a valid vote value") | |
161 | 142 | else throw("This profile is not open for voting") | |
162 | 143 | else throw("Invalid Profile") | |
163 | 144 | else throw("You can't vote twice") | |
164 | 145 | } | |
165 | 146 | ||
166 | 147 | ||
167 | 148 | ||
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")]) | |
149 | + | @Callable(B) | |
150 | + | func openVote (r) = if ((B.caller.bytes != b)) | |
151 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
152 | + | else if (p(r)) | |
153 | + | then WriteSet([DataEntry(m(r), "open")]) | |
176 | 154 | else throw("Invalid ID") | |
177 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
178 | 155 | ||
179 | 156 | ||
180 | 157 | ||
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")]) | |
158 | + | @Callable(B) | |
159 | + | func closeVote (r) = if ((B.caller.bytes != b)) | |
160 | + | then throw("Only Dyzrupt Admin can call this dApp function") | |
161 | + | else if (p(r)) | |
162 | + | then WriteSet([DataEntry(m(r), "closed")]) | |
189 | 163 | else throw("Invalid ID") | |
190 | - | else throw("Only Dyzrupt Admin can call this dApp function") | |
191 | 164 | ||
192 | 165 | ||
193 | 166 | ||
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) | |
167 | + | @Callable(B) | |
221 | 168 | func stake () = { | |
222 | - | let | |
223 | - | let | |
224 | - | if (( | |
169 | + | let i = toBase58String(B.caller.bytes) | |
170 | + | let I = extract(B.payment) | |
171 | + | if ((I.amount == 0)) | |
225 | 172 | then throw("Stake amount too low") | |
226 | - | else if (( | |
173 | + | else if ((I.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
227 | 174 | then throw("You can only stake with DYZRUPT token") | |
228 | 175 | else { | |
229 | - | let S = B(A) | |
230 | - | let T = (20 / 100) | |
231 | - | let U = (L.amount * T) | |
232 | - | let V = (L.amount - U) | |
233 | - | let W = (S + V) | |
234 | - | ScriptResult(WriteSet([DataEntry(z(A), W)]), TransferSet([ScriptTransfer(this, L.amount, e)])) | |
176 | + | let L = j(i) | |
177 | + | let M = fraction(I.amount, 5, 100) | |
178 | + | let N = (I.amount - M) | |
179 | + | let O = (L + N) | |
180 | + | let P = e() | |
181 | + | let Q = (P + M) | |
182 | + | ScriptResult(WriteSet([DataEntry(h(i), O), DataEntry(d(), Q)]), TransferSet(nil)) | |
235 | 183 | } | |
236 | 184 | } | |
237 | 185 | ||
238 | 186 | ||
239 | 187 | ||
240 | - | @Callable( | |
241 | - | func unstake ( | |
242 | - | let | |
243 | - | let | |
244 | - | if (( | |
188 | + | @Callable(B) | |
189 | + | func unstake (R) = { | |
190 | + | let i = toBase58String(B.caller.bytes) | |
191 | + | let L = j(i) | |
192 | + | if ((L == 0)) | |
245 | 193 | then throw("You don't have any stakes") | |
246 | - | else if (( | |
194 | + | else if ((R > L)) | |
247 | 195 | then throw("You can't withdraw an amount higher than you staked") | |
248 | 196 | else { | |
249 | - | let W = (S - X) | |
250 | - | ScriptResult(WriteSet([DataEntry(z(A), W)]), TransferSet([ScriptTransfer(E.caller, X, e)])) | |
197 | + | let S = fraction(R, 10, 100) | |
198 | + | let T = (R - S) | |
199 | + | let U = (L - R) | |
200 | + | let P = e() | |
201 | + | let Q = (P + S) | |
202 | + | ScriptResult(WriteSet([DataEntry(h(i), U), DataEntry(d(), Q)]), TransferSet([ScriptTransfer(B.caller, T, c)])) | |
251 | 203 | } | |
252 | 204 | } | |
253 | 205 | ||
254 | 206 | ||
255 | 207 | ||
256 | - | @Callable(E) | |
257 | - | func claimDailyStakeReward (Y) = { | |
258 | - | let A = toBase58String(E.caller.bytes) | |
259 | - | let S = B(A) | |
260 | - | let Z = D() | |
261 | - | if ((S == 0)) | |
208 | + | @Callable(B) | |
209 | + | func claimDailyStakeReward (V) = { | |
210 | + | let i = toBase58String(B.caller.bytes) | |
211 | + | let L = j(i) | |
212 | + | let P = e() | |
213 | + | let W = height | |
214 | + | let X = s(i) | |
215 | + | if ((L == 0)) | |
262 | 216 | then throw("You don't have any stakes") | |
263 | - | else if (( | |
217 | + | else if ((P == 0)) | |
264 | 218 | then throw("Nothing in Stake pool at this time. Try again later") | |
265 | - | else if (( | |
219 | + | else if ((V > P)) | |
266 | 220 | then throw("No rewards at this time") | |
267 | - | else { | |
268 | - | let aa = (Z - Y) | |
269 | - | let ab = (S - Y) | |
270 | - | ScriptResult(WriteSet([DataEntry(z(A), ab), DataEntry(C(), aa)]), TransferSet([ScriptTransfer(E.caller, Y, e)])) | |
271 | - | } | |
221 | + | else if (((X + 1440) > W)) | |
222 | + | then throw("You can only claim once a day") | |
223 | + | else { | |
224 | + | let Q = (P - V) | |
225 | + | let Y = (L - V) | |
226 | + | ScriptResult(WriteSet([DataEntry(("last_claim_" + i), W), DataEntry(h(i), Y), DataEntry(d(), Q)]), TransferSet([ScriptTransfer(B.caller, V, c)])) | |
227 | + | } | |
272 | 228 | } | |
273 | 229 | ||
274 | 230 |
github/deemru/w8io/169f3d6 56.35 ms ◑