tx · HXhCWcTPfxBjG9SJEiqG3XwWDgfubBxrWKxoe55NwkKR 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu: -0.05000000 Waves 2020.11.18 09:59 [1270466] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves
{ "type": 13, "id": "HXhCWcTPfxBjG9SJEiqG3XwWDgfubBxrWKxoe55NwkKR", "fee": 5000000, "feeAssetId": null, "timestamp": 1605682819142, "version": 2, "chainId": 84, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "4KSva7rSG7962k1VFizNgUgHVLKJ4hjfYm5seypGGaTWQJud4P7v2nS9xYFUjXk5iyZ3JircbxN6nMNZ6d2x3jfd" ], "script": "base64:AAIDAAAAAAAAACcIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgSABIDCgEBEgMKAQEAAAAQAAAAAAZ1cFZvdGUCAAAABnVwdm90ZQAAAAAMYWRtaW5BZGRyZXNzAQAAABoBVDi2IViANlgIPSCUAVQpoGSXhJ2Tw/Y0iwAAAAAFZHl6SWQBAAAAIH6rQdnOUsq3YY00nk9jVDL2OOQ/e846gXAImq8xTxZrAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAgAAAApzdGFrZV9wb29sAQAAAAxnZXRTdGFrZVBvb2wAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADGdldFN0YWtlcktleQAAAAEAAAAGc3Rha2VyCQABLAAAAAIFAAAABnN0YWtlcgIAAAAGX3N0YWtlAQAAAA9nZXRDdXJyZW50U3Rha2UAAAABAAAABnN0YWtlcgQAAAAHJG1hdGNoMAkABB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dhaW4gbGF0ZXIDCQAAZgAAAAIFAAAABnJld2FyZAUAAAAJc3Rha2VQb29sCQAAAgAAAAECAAAAF05vIHJld2FyZHMgYXQgdGhpcyB0aW1lBAAAAAxuZXdTdGFrZVBvb2wJAABlAAAAAgUAAAAJc3Rha2VQb29sBQAAAAZyZXdhcmQEAAAADm5ld1N0YWtlQW1vdW50CQAAZQAAAAIFAAAADGN1cnJlbnRTdGFrZQUAAAAGcmV3YXJkCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAADGdldFN0YWtlcktleQAAAAEFAAAABnN0YWtlcgUAAAAObmV3U3Rha2VBbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAABQAAAAxuZXdTdGFrZVBvb2wFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABnJld2FyZAUAAAAFZHl6SWQFAAAAA25pbAAAAACRSpmW", "height": 1270466, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HiW16mYq6KyiLmdMS3vLGTRWu8widLEP9dKFYCw9kpxg Next: 6XH57mNapFhK5QeFe4fpMET2nkXmFf9d3z95KVKQVR9D Diff:
Old | New | Differences | |
---|---|---|---|
163 | 163 | then throw("You can only stake with DYZRUPT token") | |
164 | 164 | else { | |
165 | 165 | let J = j(i) | |
166 | - | let K = fraction(G.amount, | |
166 | + | let K = fraction(G.amount, 5, 100) | |
167 | 167 | let L = (G.amount - K) | |
168 | 168 | let M = (J + L) | |
169 | 169 | let N = e() | |
183 | 183 | else if ((P > J)) | |
184 | 184 | then throw("You can't withdraw an amount higher than you staked") | |
185 | 185 | else { | |
186 | - | let Q = fraction(P, | |
186 | + | let Q = fraction(P, 10, 100) | |
187 | 187 | let R = (P - Q) | |
188 | 188 | let S = (J - P) | |
189 | 189 | let N = e() |
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 | 8 | let c = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' | |
9 | 9 | ||
10 | 10 | func d () = "stake_pool" | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func e () = { | |
14 | 14 | let f = getInteger(this, d()) | |
15 | 15 | if ($isInstanceOf(f, "Int")) | |
16 | 16 | then { | |
17 | 17 | let g = f | |
18 | 18 | g | |
19 | 19 | } | |
20 | 20 | else 0 | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func h (i) = (i + "_stake") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func j (i) = { | |
28 | 28 | let f = getInteger(this, h(i)) | |
29 | 29 | if ($isInstanceOf(f, "Int")) | |
30 | 30 | then { | |
31 | 31 | let g = f | |
32 | 32 | g | |
33 | 33 | } | |
34 | 34 | else 0 | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func k (l) = (l + "_entrepreneurProfile") | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func m (l) = (l + "_status") | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func n (l,o) = if ((o == "upvote")) | |
45 | 45 | then (l + "_upvote") | |
46 | 46 | else throw("Invalid vote type") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func p (l) = { | |
50 | 50 | let f = getString(this, k(l)) | |
51 | 51 | if ($isInstanceOf(f, "String")) | |
52 | 52 | then { | |
53 | 53 | let g = f | |
54 | 54 | true | |
55 | 55 | } | |
56 | 56 | else false | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func q (r) = { | |
61 | 61 | let f = getString(this, m(r)) | |
62 | 62 | if ($isInstanceOf(f, "String")) | |
63 | 63 | then { | |
64 | 64 | let g = f | |
65 | 65 | g | |
66 | 66 | } | |
67 | 67 | else false | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func s (r,t) = { | |
72 | 72 | let f = getInteger(this, n(r, t)) | |
73 | 73 | if ($isInstanceOf(f, "Int")) | |
74 | 74 | then { | |
75 | 75 | let g = f | |
76 | 76 | g | |
77 | 77 | } | |
78 | 78 | else throw("Not a valid vote ID") | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func u (v,r) = ((((v + "_") + r) + "_") + "vote") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func w (v,r) = { | |
86 | 86 | let f = getString(this, u(v, r)) | |
87 | 87 | if ($isInstanceOf(f, "String")) | |
88 | 88 | then { | |
89 | 89 | let g = f | |
90 | 90 | g | |
91 | 91 | } | |
92 | 92 | else "" | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func x (v,r) = { | |
97 | 97 | let y = w(v, r) | |
98 | 98 | if ((y == "")) | |
99 | 99 | then true | |
100 | 100 | else false | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | @Callable(z) | |
105 | 105 | func addEntrepreneurProfile (A,B,C,D,E) = if ((z.caller.bytes != b)) | |
106 | 106 | then throw("Only Dyzrupt Admin can call this dApp function") | |
107 | 107 | else { | |
108 | 108 | let F = toBase58String(z.transactionId) | |
109 | 109 | WriteSet([DataEntry(k(F), ((((((((A + "_") + B) + "_") + C) + "_") + D) + "_") + E)), DataEntry(n(F, "upvote"), 0), DataEntry(m(F), "open")]) | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | 114 | @Callable(z) | |
115 | 115 | func vote (r,t) = { | |
116 | 116 | let G = extract(z.payment) | |
117 | 117 | if ((G.amount == 0)) | |
118 | 118 | then throw("You cannot vote without paying voting fee") | |
119 | 119 | else if ((G.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
120 | 120 | then throw("You can only vote with DYZRUPT token") | |
121 | 121 | else if (x(toBase58String(z.caller.bytes), r)) | |
122 | 122 | then if (p(r)) | |
123 | 123 | then if ((q(r) == "open")) | |
124 | 124 | then if ((t == a)) | |
125 | 125 | then { | |
126 | 126 | let H = s(r, t) | |
127 | 127 | let I = (H + 1) | |
128 | 128 | ScriptResult(WriteSet([DataEntry(n(r, t), I), DataEntry(u(toBase58String(z.caller.bytes), r), r)]), TransferSet([ScriptTransfer(this, G.amount, c)])) | |
129 | 129 | } | |
130 | 130 | else throw("Not a valid vote value") | |
131 | 131 | else throw("This profile is not open for voting") | |
132 | 132 | else throw("Invalid Profile") | |
133 | 133 | else throw("You can't vote twice") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(z) | |
139 | 139 | func openVote (r) = if ((z.caller.bytes != b)) | |
140 | 140 | then throw("Only Dyzrupt Admin can call this dApp function") | |
141 | 141 | else if (p(r)) | |
142 | 142 | then WriteSet([DataEntry(m(r), "open")]) | |
143 | 143 | else throw("Invalid ID") | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | ||
147 | 147 | @Callable(z) | |
148 | 148 | func closeVote (r) = if ((z.caller.bytes != b)) | |
149 | 149 | then throw("Only Dyzrupt Admin can call this dApp function") | |
150 | 150 | else if (p(r)) | |
151 | 151 | then WriteSet([DataEntry(m(r), "closed")]) | |
152 | 152 | else throw("Invalid ID") | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | ||
156 | 156 | @Callable(z) | |
157 | 157 | func stake () = { | |
158 | 158 | let i = toBase58String(z.caller.bytes) | |
159 | 159 | let G = extract(z.payment) | |
160 | 160 | if ((G.amount == 0)) | |
161 | 161 | then throw("Stake amount too low") | |
162 | 162 | else if ((G.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) | |
163 | 163 | then throw("You can only stake with DYZRUPT token") | |
164 | 164 | else { | |
165 | 165 | let J = j(i) | |
166 | - | let K = fraction(G.amount, | |
166 | + | let K = fraction(G.amount, 5, 100) | |
167 | 167 | let L = (G.amount - K) | |
168 | 168 | let M = (J + L) | |
169 | 169 | let N = e() | |
170 | 170 | let O = (N + K) | |
171 | 171 | ScriptResult(WriteSet([DataEntry(h(i), M), DataEntry(d(), O)]), TransferSet(nil)) | |
172 | 172 | } | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | ||
177 | 177 | @Callable(z) | |
178 | 178 | func unstake (P) = { | |
179 | 179 | let i = toBase58String(z.caller.bytes) | |
180 | 180 | let J = j(i) | |
181 | 181 | if ((J == 0)) | |
182 | 182 | then throw("You don't have any stakes") | |
183 | 183 | else if ((P > J)) | |
184 | 184 | then throw("You can't withdraw an amount higher than you staked") | |
185 | 185 | else { | |
186 | - | let Q = fraction(P, | |
186 | + | let Q = fraction(P, 10, 100) | |
187 | 187 | let R = (P - Q) | |
188 | 188 | let S = (J - P) | |
189 | 189 | let N = e() | |
190 | 190 | let O = (N + Q) | |
191 | 191 | ScriptResult(WriteSet([DataEntry(h(i), S), DataEntry(d(), O)]), TransferSet([ScriptTransfer(z.caller, R, c)])) | |
192 | 192 | } | |
193 | 193 | } | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | ||
197 | 197 | @Callable(z) | |
198 | 198 | func claimDailyStakeReward (T) = { | |
199 | 199 | let i = toBase58String(z.caller.bytes) | |
200 | 200 | let J = j(i) | |
201 | 201 | let N = e() | |
202 | 202 | if ((J == 0)) | |
203 | 203 | then throw("You don't have any stakes") | |
204 | 204 | else if ((N == 0)) | |
205 | 205 | then throw("Nothing in Stake pool at this time. Try again later") | |
206 | 206 | else if ((T > N)) | |
207 | 207 | then throw("No rewards at this time") | |
208 | 208 | else { | |
209 | 209 | let O = (N - T) | |
210 | 210 | let U = (J - T) | |
211 | 211 | ScriptResult(WriteSet([DataEntry(h(i), U), DataEntry(d(), O)]), TransferSet([ScriptTransfer(z.caller, T, c)])) | |
212 | 212 | } | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 |
github/deemru/w8io/026f985 29.92 ms ◑