tx · 7QWw8qRa772iU5o4Mov522tWri7JHSB5BamV4PzUGNNj 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu: -0.01400000 Waves 2020.09.22 22:01 [1188903] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves
{ "type": 13, "id": "7QWw8qRa772iU5o4Mov522tWri7JHSB5BamV4PzUGNNj", "fee": 1400000, "feeAssetId": null, "timestamp": 1600801326396, "version": 2, "chainId": 84, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "4sDocNduLnqjNcgXhWhEpqFVyh27YNqjue4N4eudP9mVmEoExKMrAvTeYtY3EwRCPd4zEEQtwQTtKaaiWzFbQrBh" ], "script": "base64:AAIDAAAAAAAAACAIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgSAwoBCAAAABEAAAAABnVwVm90ZQIAAAAGdXB2b3RlAAAAAA1hZG1pbkFkZHJlc3MxAQAAABoBVDi2IViANlgIPSCUAVQpoGSXhJ2Tw/Y0iwAAAAANYWRtaW5BZGRyZXNzMgEAAAAaAVTlj1A9878YQ058BBZUI9QC+LwgFva37DoAAAAADWFkbWluQWRkcmVzczMBAAAAGgFUPo0bC5weIFiGP3KzAhxqwrizqd9EMgoVAAAAAAVkeXpJZAEAAAAgfqtB2c5SyrdhjTSeT2NUMvY45D97zjqBcAiarzFPFmsBAAAADWdldFByb2ZpbGVLZXkAAAABAAAAAmlkCQABLAAAAAIFAAAAAmlkAgAAABRfZW50cmVwcmVuZXVyUHJvZmlsZQEAAAAMZ2V0U3RhdHVzS2V5AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAHX3N0YXR1cwEAAAARZ2V0Vm90ZXJBbW91bnRLZXkAAAACAAAAAmlkAAAABnZvdGVJZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAACaWQCAAAAAV8FAAAAB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AAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADWN1cnJlbnRBbW91bnQFAAAABWR5eklkBQAAAANuaWwJAAACAAAAAQIAAAA2Q2FuJ3Qgd2l0aGRyYXcgdm90ZSBhbW91bnQgd2hpbGUgdm90aW5nIGlzIHN0aWxsIG9wZW4uCQAAAgAAAAECAAAAJVlvdSBkaWRuJ3Qgdm90ZSBmb3IgdGhpcyBlbnRyZXByZW5ldXIAAAAAhQCsEQ==", "height": 1188903, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AnVCgpToNVwyGpZRvYo3Strh62KTY7AdapAz68vLYitB Next: F3Fdv54noSFXLmYRku2G9QF9ktXH6PQaop6nVLY43tby Diff:
Old | New | Differences | |
---|---|---|---|
70 | 70 | let p = o | |
71 | 71 | p | |
72 | 72 | } | |
73 | - | else | |
73 | + | else 0 | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 |
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'3NAqtCScgFynCuRLUoXm2BHTdu8suatCe7b' | |
9 | 9 | ||
10 | 10 | let d = base58'3Mucpi1K4FMVrZKnYEgjxQf5DkkBX7QrHoJ' | |
11 | 11 | ||
12 | 12 | let e = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' | |
13 | 13 | ||
14 | 14 | func f (g) = (g + "_entrepreneurProfile") | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func h (g) = (g + "_status") | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func i (g,j) = (((g + "_") + j) + "_amount") | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func k (g,l) = if ((l == "upvote")) | |
24 | 24 | then (g + "_upvote") | |
25 | 25 | else throw("Invalid vote type") | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func m (g,l) = if ((l == "upvote")) | |
29 | 29 | then (((g + "_") + l) + "_amount") | |
30 | 30 | else throw("Invalid vote type") | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func n (g) = { | |
34 | 34 | let o = getString(this, f(g)) | |
35 | 35 | if ($isInstanceOf(o, "String")) | |
36 | 36 | then { | |
37 | 37 | let p = o | |
38 | 38 | true | |
39 | 39 | } | |
40 | 40 | else false | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func q (j) = { | |
45 | 45 | let o = getString(this, h(j)) | |
46 | 46 | if ($isInstanceOf(o, "String")) | |
47 | 47 | then { | |
48 | 48 | let p = o | |
49 | 49 | p | |
50 | 50 | } | |
51 | 51 | else false | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func r (j,s) = { | |
56 | 56 | let o = getInteger(this, k(j, s)) | |
57 | 57 | if ($isInstanceOf(o, "Int")) | |
58 | 58 | then { | |
59 | 59 | let p = o | |
60 | 60 | p | |
61 | 61 | } | |
62 | 62 | else throw("Not a valid vote ID") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func t (j,s) = { | |
67 | 67 | let o = getInteger(this, m(j, s)) | |
68 | 68 | if ($isInstanceOf(o, "Int")) | |
69 | 69 | then { | |
70 | 70 | let p = o | |
71 | 71 | p | |
72 | 72 | } | |
73 | - | else | |
73 | + | else 0 | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func u (v,j) = ((((v + "_") + j) + "_") + "vote") | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func w (v,j) = { | |
81 | 81 | let o = getString(this, u(v, j)) | |
82 | 82 | if ($isInstanceOf(o, "String")) | |
83 | 83 | then { | |
84 | 84 | let p = o | |
85 | 85 | p | |
86 | 86 | } | |
87 | 87 | else "" | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func x (v,j) = { | |
92 | 92 | let y = w(v, j) | |
93 | 93 | if ((y == "")) | |
94 | 94 | then true | |
95 | 95 | else false | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(z) | |
100 | 100 | func addEntrepreneurProfile (A,B,C,D,E) = if (if (if ((z.caller.bytes == b)) | |
101 | 101 | then true | |
102 | 102 | else (z.caller.bytes == c)) | |
103 | 103 | then true | |
104 | 104 | else (z.caller.bytes == d)) | |
105 | 105 | then { | |
106 | 106 | let F = toBase58String(z.transactionId) | |
107 | 107 | WriteSet([DataEntry(f(F), ((((((((A + "_") + B) + "_") + C) + "_") + D) + "_") + E)), DataEntry(k(F, "upvote"), 0), DataEntry(m(F, "upvote"), 0), DataEntry(h(F), "open")]) | |
108 | 108 | } | |
109 | 109 | else throw("Only Dyzrupt Admin can call this dApp function") | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | ||
113 | 113 | @Callable(z) | |
114 | 114 | func vote (j,s) = { | |
115 | 115 | let G = extract(z.payment) | |
116 | 116 | let y = toBase58String(z.caller.bytes) | |
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(y, j)) | |
122 | 122 | then if (n(j)) | |
123 | 123 | then if ((q(j) == "open")) | |
124 | 124 | then if ((s == a)) | |
125 | 125 | then { | |
126 | 126 | let H = r(j, s) | |
127 | 127 | let I = t(j, s) | |
128 | 128 | let J = (H + 1) | |
129 | 129 | let K = (I + G.amount) | |
130 | 130 | ScriptResult(WriteSet([DataEntry(k(j, s), J), DataEntry(u(y, j), j), DataEntry(i(y, j), G.amount)]), TransferSet([ScriptTransfer(this, G.amount, e)])) | |
131 | 131 | } | |
132 | 132 | else throw("Not a valid vote value") | |
133 | 133 | else throw("This profile is not open for voting") | |
134 | 134 | else throw("Invalid Profile") | |
135 | 135 | else throw("You can't vote twice") | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | ||
140 | 140 | @Callable(z) | |
141 | 141 | func openVote (j) = if (if (if ((z.caller.bytes == b)) | |
142 | 142 | then true | |
143 | 143 | else (z.caller.bytes == c)) | |
144 | 144 | then true | |
145 | 145 | else (z.caller.bytes == d)) | |
146 | 146 | then if (n(j)) | |
147 | 147 | then WriteSet([DataEntry(h(j), "open")]) | |
148 | 148 | else throw("Invalid ID") | |
149 | 149 | else throw("Only Dyzrupt Admin can call this dApp function") | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(z) | |
154 | 154 | func closeVote (j) = if (if (if ((z.caller.bytes == b)) | |
155 | 155 | then true | |
156 | 156 | else (z.caller.bytes == c)) | |
157 | 157 | then true | |
158 | 158 | else (z.caller.bytes == d)) | |
159 | 159 | then if (n(j)) | |
160 | 160 | then WriteSet([DataEntry(h(j), "closed")]) | |
161 | 161 | else throw("Invalid ID") | |
162 | 162 | else throw("Only Dyzrupt Admin can call this dApp function") | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | ||
166 | 166 | @Callable(z) | |
167 | 167 | func withdraw (j) = { | |
168 | 168 | let y = toBase58String(z.caller.bytes) | |
169 | 169 | if ((w(y, j) != "")) | |
170 | 170 | then if ((q(j) == "closed")) | |
171 | 171 | then { | |
172 | 172 | let L = i(y, j) | |
173 | 173 | let M = { | |
174 | 174 | let o = getInteger(this, L) | |
175 | 175 | if ($isInstanceOf(o, "Int")) | |
176 | 176 | then { | |
177 | 177 | let p = o | |
178 | 178 | p | |
179 | 179 | } | |
180 | 180 | else throw("You didn't vote for this entrepreneur") | |
181 | 181 | } | |
182 | 182 | if ((M == 0)) | |
183 | 183 | then throw("Seems you have previously withdrawn.") | |
184 | 184 | else ScriptResult(WriteSet([DataEntry(L, 0)]), TransferSet([ScriptTransfer(z.caller, M, e)])) | |
185 | 185 | } | |
186 | 186 | else throw("Can't withdraw vote amount while voting is still open.") | |
187 | 187 | else throw("You didn't vote for this entrepreneur") | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 |
github/deemru/w8io/169f3d6 52.55 ms ◑