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