tx · 6fefZLiPHpWLS8x1Q8epL6WFoW7Bv1DKzBf8E7zJZTyv
3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu: -0.01400000 Waves
2020.09.06 21:26 [1165897] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves
{
"type": 13,
"id": "6fefZLiPHpWLS8x1Q8epL6WFoW7Bv1DKzBf8E7zJZTyv",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1599416823262,
"version": 1,
"sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu",
"senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun",
"proofs": [
"4gvMU5ZQH7GFdLsA3pPs828dGmXTM35ZjHF4oYa5jW5SjpKYWueWHHyFW7XC4pGbxNBopfi6onfRojByYb1ZYDTb"
],
"script": "base64:AAIDAAAAAAAAABsIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgAAAAMAAAAAAZ1cFZvdGUCAAAABnVwdm90ZQAAAAAMYWRtaW5BZGRyZXNzAQAAABoBVDi2IViANlgIPSCUAVQpoGSXhJ2Tw/Y0iwAAAAAFZHl6SWQBAAAAIH6rQdnOUsq3YY00nk9jVDL2OOQ/e846gXAImq8xTxZrAQAAAA1nZXRQcm9maWxlS2V5AAAAAQAAAAJpZAkAASwAAAACBQAAAAJpZAIAAAAUX2VudHJlcHJlbmV1clByb2ZpbGUBAAAADGdldFN0YXR1c0tleQAAAAEAAAACaWQJAAEsAAAAAgUAAAACaWQCAAAAB19zdGF0dXMBAAAACmdldFZvdGVLZXkAAAACAAAAAmlkAAAABHR5cGUDCQAAAAAAAAIFAAAABHR5cGUCAAAABnVwdm90ZQkAASwAAAACBQAAAAJpZAIAAAAHX3Vwdm90ZQkAAAIAAAABAgAAABFJbnZhbGlkIHZvdGUgdHlwZQEAAAAMcHJvZmlsZUV4aXN0AAAAAQAAAAJpZAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aG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AAAFk5vdCBhIHZhbGlkIHZvdGUgdmFsdWUJAAACAAAAAQIAAAAjVGhpcyBwcm9maWxlIGlzIG5vdCBvcGVuIGZvciB2b3RpbmcJAAACAAAAAQIAAAAPSW52YWxpZCBQcm9maWxlCQAAAgAAAAECAAAAFFlvdSBjYW4ndCB2b3RlIHR3aWNlAAAAAWkBAAAACG9wZW5Wb3RlAAAAAQAAAAZ2b3RlSWQDCQEAAAACIT0AAAACCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBQAAAAxhZG1pbkFkZHJlc3MJAAACAAAAAQIAAAAuT25seSBEeXpydXB0IEFkbWluIGNhbiBjYWxsIHRoaXMgZEFwcCBmdW5jdGlvbgMJAQAAAAxwcm9maWxlRXhpc3QAAAABBQAAAAZ2b3RlSWQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAAxnZXRTdGF0dXNLZXkAAAABBQAAAAZ2b3RlSWQCAAAABG9wZW4FAAAAA25pbAkAAAIAAAABAgAAAApJbnZhbGlkIElEAAAAAWkBAAAACWNsb3NlVm90ZQAAAAEAAAAGdm90ZUlkAwkBAAAAAiE9AAAAAggIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwUAAAAMYWRtaW5BZGRyZXNzCQAAAgAAAAECAAAALk9ubHkgRHl6cnVwdCBBZG1pbiBjYW4gY2FsbCB0aGlzIGRBcHAgZnVuY3Rpb24DCQEAAAAMcHJvZmlsZUV4aXN0AAAAAQUAAAAGdm90ZUlkCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAMZ2V0U3RhdHVzS2V5AAAAAQUAAAAGdm90ZUlkAgAAAAZjbG9zZWQFAAAAA25pbAkAAAIAAAABAgAAAApJbnZhbGlkIElEAAAAAJ57AOM=",
"chainId": 84,
"height": 1165897,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Hee47hqHSerHkFYv38TzHviUUTXnxR8pze5pfAZz4927
Next: Eu4ZUxXSzux8gxzQ5NgSd9Q2fsroLQcUNT2UPQ8QUbG4
Diff:
Old | New | | Differences |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "upvote" |
---|
5 | 5 | | |
---|
6 | | - | let b = "downvote" |
---|
| 6 | + | let b = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC' |
---|
7 | 7 | | |
---|
8 | | - | let c = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC' |
---|
| 8 | + | let c = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' |
---|
9 | 9 | | |
---|
10 | | - | let d = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' |
---|
11 | | - | |
---|
12 | | - | func e (f) = (f + "_entrepreneurProfile") |
---|
| 10 | + | func d (e) = (e + "_entrepreneurProfile") |
---|
13 | 11 | | |
---|
14 | 12 | | |
---|
15 | | - | func g (f) = (f + "_status") |
---|
| 13 | + | func f (e) = (e + "_status") |
---|
16 | 14 | | |
---|
17 | 15 | | |
---|
18 | | - | func h (f,i) = if ((i == "upvote")) |
---|
19 | | - | then (f + "_upvote") |
---|
20 | | - | else if ((i == "downvote")) |
---|
21 | | - | then (f + "_downvote") |
---|
22 | | - | else throw("Invalid vote type") |
---|
| 16 | + | func g (e,h) = if ((h == "upvote")) |
---|
| 17 | + | then (e + "_upvote") |
---|
| 18 | + | else throw("Invalid vote type") |
---|
23 | 19 | | |
---|
24 | 20 | | |
---|
25 | | - | func j (f) = { |
---|
26 | | - | let k = getString(this, e(f)) |
---|
27 | | - | if ($isInstanceOf(k, "String")) |
---|
| 21 | + | func i (e) = { |
---|
| 22 | + | let j = getString(this, d(e)) |
---|
| 23 | + | if ($isInstanceOf(j, "String")) |
---|
28 | 24 | | then { |
---|
29 | | - | let l = k |
---|
| 25 | + | let k = j |
---|
30 | 26 | | true |
---|
31 | 27 | | } |
---|
32 | 28 | | else false |
---|
33 | 29 | | } |
---|
34 | 30 | | |
---|
35 | 31 | | |
---|
36 | | - | func m (n) = { |
---|
37 | | - | let k = getString(this, g(n)) |
---|
38 | | - | if ($isInstanceOf(k, "String")) |
---|
| 32 | + | func l (m) = { |
---|
| 33 | + | let j = getString(this, f(m)) |
---|
| 34 | + | if ($isInstanceOf(j, "String")) |
---|
39 | 35 | | then { |
---|
40 | | - | let l = k |
---|
41 | | - | l |
---|
| 36 | + | let k = j |
---|
| 37 | + | k |
---|
42 | 38 | | } |
---|
43 | 39 | | else false |
---|
44 | 40 | | } |
---|
45 | 41 | | |
---|
46 | 42 | | |
---|
47 | | - | func o (n,p) = { |
---|
48 | | - | let k = getInteger(this, h(n, p)) |
---|
49 | | - | if ($isInstanceOf(k, "Int")) |
---|
| 43 | + | func n (m,o) = { |
---|
| 44 | + | let j = getInteger(this, g(m, o)) |
---|
| 45 | + | if ($isInstanceOf(j, "Int")) |
---|
50 | 46 | | then { |
---|
51 | | - | let l = k |
---|
52 | | - | l |
---|
| 47 | + | let k = j |
---|
| 48 | + | k |
---|
53 | 49 | | } |
---|
54 | 50 | | else throw("Not a valid vote ID") |
---|
55 | 51 | | } |
---|
56 | 52 | | |
---|
57 | 53 | | |
---|
58 | | - | func q (r,n) = ((((r + "_") + n) + "_") + "vote") |
---|
| 54 | + | func p (q,m) = ((((q + "_") + m) + "_") + "vote") |
---|
59 | 55 | | |
---|
60 | 56 | | |
---|
61 | | - | func s (r,n) = { |
---|
62 | | - | let k = getString(this, q(r, n)) |
---|
63 | | - | if ($isInstanceOf(k, "String")) |
---|
| 57 | + | func r (q,m) = { |
---|
| 58 | + | let j = getString(this, p(q, m)) |
---|
| 59 | + | if ($isInstanceOf(j, "String")) |
---|
64 | 60 | | then { |
---|
65 | | - | let l = k |
---|
66 | | - | l |
---|
| 61 | + | let k = j |
---|
| 62 | + | k |
---|
67 | 63 | | } |
---|
68 | 64 | | else "" |
---|
69 | 65 | | } |
---|
70 | 66 | | |
---|
71 | 67 | | |
---|
72 | | - | func t (r,n) = { |
---|
73 | | - | let u = s(r, n) |
---|
74 | | - | if ((u == "")) |
---|
| 68 | + | func s (q,m) = { |
---|
| 69 | + | let t = r(q, m) |
---|
| 70 | + | if ((t == "")) |
---|
75 | 71 | | then true |
---|
76 | 72 | | else false |
---|
77 | 73 | | } |
---|
78 | 74 | | |
---|
79 | 75 | | |
---|
80 | | - | @Callable(v) |
---|
81 | | - | func addEntrepreneurProfile (w,x,y,z,A) = if ((v.caller.bytes != c)) |
---|
| 76 | + | @Callable(u) |
---|
| 77 | + | func addEntrepreneurProfile (v,w,x,y,z) = if ((u.caller.bytes != b)) |
---|
82 | 78 | | then throw("Only Dyzrupt Admin can call this dApp function") |
---|
83 | 79 | | else { |
---|
84 | | - | let B = toBase58String(v.transactionId) |
---|
85 | | - | WriteSet([DataEntry(e(B), ((((((((w + "_") + x) + "_") + y) + "_") + z) + "_") + A)), DataEntry(h(B, "upvote"), 0), DataEntry(g(B), "open"), DataEntry(h(B, "downvote"), 0)]) |
---|
| 80 | + | let A = toBase58String(u.transactionId) |
---|
| 81 | + | WriteSet([DataEntry(d(A), ((((((((v + "_") + w) + "_") + x) + "_") + y) + "_") + z)), DataEntry(g(A, "upvote"), 0), DataEntry(f(A), "open")]) |
---|
86 | 82 | | } |
---|
87 | 83 | | |
---|
88 | 84 | | |
---|
89 | 85 | | |
---|
90 | | - | @Callable(v) |
---|
91 | | - | func vote (n,p) = { |
---|
92 | | - | let C = extract(v.payment) |
---|
93 | | - | if ((C.amount == 0)) |
---|
| 86 | + | @Callable(u) |
---|
| 87 | + | func vote (m,o) = { |
---|
| 88 | + | let B = extract(u.payment) |
---|
| 89 | + | if ((B.amount == 0)) |
---|
94 | 90 | | then throw("You cannot vote without paying voting fee") |
---|
95 | | - | else if ((C.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) |
---|
| 91 | + | else if ((B.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) |
---|
96 | 92 | | then throw("You can only vote with DYZRUPT token") |
---|
97 | | - | else if (t(toBase58String(v.caller.bytes), n)) |
---|
98 | | - | then if (j(n)) |
---|
99 | | - | then if ((m(n) == "open")) |
---|
100 | | - | then if (if ((p == a)) |
---|
101 | | - | then true |
---|
102 | | - | else (p == b)) |
---|
| 93 | + | else if (s(toBase58String(u.caller.bytes), m)) |
---|
| 94 | + | then if (i(m)) |
---|
| 95 | + | then if ((l(m) == "open")) |
---|
| 96 | + | then if ((o == a)) |
---|
103 | 97 | | then { |
---|
104 | | - | let D = o(n, p) |
---|
105 | | - | let E = (D + 1) |
---|
106 | | - | ScriptResult(WriteSet([DataEntry(h(n, p), E), DataEntry(q(toBase58String(v.caller.bytes), n), n)]), TransferSet([ScriptTransfer(this, C.amount, d)])) |
---|
| 98 | + | let C = n(m, o) |
---|
| 99 | + | let D = (C + 1) |
---|
| 100 | + | ScriptResult(WriteSet([DataEntry(g(m, o), D), DataEntry(p(toBase58String(u.caller.bytes), m), m)]), TransferSet([ScriptTransfer(this, B.amount, c)])) |
---|
107 | 101 | | } |
---|
108 | 102 | | else throw("Not a valid vote value") |
---|
109 | 103 | | else throw("This profile is not open for voting") |
---|
|
113 | 107 | | |
---|
114 | 108 | | |
---|
115 | 109 | | |
---|
116 | | - | @Callable(v) |
---|
117 | | - | func openVote (n) = if ((v.caller.bytes != c)) |
---|
| 110 | + | @Callable(u) |
---|
| 111 | + | func openVote (m) = if ((u.caller.bytes != b)) |
---|
118 | 112 | | then throw("Only Dyzrupt Admin can call this dApp function") |
---|
119 | | - | else if (j(n)) |
---|
120 | | - | then WriteSet([DataEntry(g(n), "open")]) |
---|
| 113 | + | else if (i(m)) |
---|
| 114 | + | then WriteSet([DataEntry(f(m), "open")]) |
---|
121 | 115 | | else throw("Invalid ID") |
---|
122 | 116 | | |
---|
123 | 117 | | |
---|
124 | 118 | | |
---|
125 | | - | @Callable(v) |
---|
126 | | - | func closeVote (n) = if ((v.caller.bytes != c)) |
---|
| 119 | + | @Callable(u) |
---|
| 120 | + | func closeVote (m) = if ((u.caller.bytes != b)) |
---|
127 | 121 | | then throw("Only Dyzrupt Admin can call this dApp function") |
---|
128 | | - | else if (j(n)) |
---|
129 | | - | then WriteSet([DataEntry(g(n), "closed")]) |
---|
| 122 | + | else if (i(m)) |
---|
| 123 | + | then WriteSet([DataEntry(f(m), "closed")]) |
---|
130 | 124 | | else throw("Invalid ID") |
---|
131 | 125 | | |
---|
132 | 126 | | |
---|
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 | | - | let b = "downvote" |
---|
| 6 | + | let b = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC' |
---|
7 | 7 | | |
---|
8 | | - | let c = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC' |
---|
| 8 | + | let c = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' |
---|
9 | 9 | | |
---|
10 | | - | let d = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G' |
---|
11 | | - | |
---|
12 | | - | func e (f) = (f + "_entrepreneurProfile") |
---|
| 10 | + | func d (e) = (e + "_entrepreneurProfile") |
---|
13 | 11 | | |
---|
14 | 12 | | |
---|
15 | | - | func g (f) = (f + "_status") |
---|
| 13 | + | func f (e) = (e + "_status") |
---|
16 | 14 | | |
---|
17 | 15 | | |
---|
18 | | - | func h (f,i) = if ((i == "upvote")) |
---|
19 | | - | then (f + "_upvote") |
---|
20 | | - | else if ((i == "downvote")) |
---|
21 | | - | then (f + "_downvote") |
---|
22 | | - | else throw("Invalid vote type") |
---|
| 16 | + | func g (e,h) = if ((h == "upvote")) |
---|
| 17 | + | then (e + "_upvote") |
---|
| 18 | + | else throw("Invalid vote type") |
---|
23 | 19 | | |
---|
24 | 20 | | |
---|
25 | | - | func j (f) = { |
---|
26 | | - | let k = getString(this, e(f)) |
---|
27 | | - | if ($isInstanceOf(k, "String")) |
---|
| 21 | + | func i (e) = { |
---|
| 22 | + | let j = getString(this, d(e)) |
---|
| 23 | + | if ($isInstanceOf(j, "String")) |
---|
28 | 24 | | then { |
---|
29 | | - | let l = k |
---|
| 25 | + | let k = j |
---|
30 | 26 | | true |
---|
31 | 27 | | } |
---|
32 | 28 | | else false |
---|
33 | 29 | | } |
---|
34 | 30 | | |
---|
35 | 31 | | |
---|
36 | | - | func m (n) = { |
---|
37 | | - | let k = getString(this, g(n)) |
---|
38 | | - | if ($isInstanceOf(k, "String")) |
---|
| 32 | + | func l (m) = { |
---|
| 33 | + | let j = getString(this, f(m)) |
---|
| 34 | + | if ($isInstanceOf(j, "String")) |
---|
39 | 35 | | then { |
---|
40 | | - | let l = k |
---|
41 | | - | l |
---|
| 36 | + | let k = j |
---|
| 37 | + | k |
---|
42 | 38 | | } |
---|
43 | 39 | | else false |
---|
44 | 40 | | } |
---|
45 | 41 | | |
---|
46 | 42 | | |
---|
47 | | - | func o (n,p) = { |
---|
48 | | - | let k = getInteger(this, h(n, p)) |
---|
49 | | - | if ($isInstanceOf(k, "Int")) |
---|
| 43 | + | func n (m,o) = { |
---|
| 44 | + | let j = getInteger(this, g(m, o)) |
---|
| 45 | + | if ($isInstanceOf(j, "Int")) |
---|
50 | 46 | | then { |
---|
51 | | - | let l = k |
---|
52 | | - | l |
---|
| 47 | + | let k = j |
---|
| 48 | + | k |
---|
53 | 49 | | } |
---|
54 | 50 | | else throw("Not a valid vote ID") |
---|
55 | 51 | | } |
---|
56 | 52 | | |
---|
57 | 53 | | |
---|
58 | | - | func q (r,n) = ((((r + "_") + n) + "_") + "vote") |
---|
| 54 | + | func p (q,m) = ((((q + "_") + m) + "_") + "vote") |
---|
59 | 55 | | |
---|
60 | 56 | | |
---|
61 | | - | func s (r,n) = { |
---|
62 | | - | let k = getString(this, q(r, n)) |
---|
63 | | - | if ($isInstanceOf(k, "String")) |
---|
| 57 | + | func r (q,m) = { |
---|
| 58 | + | let j = getString(this, p(q, m)) |
---|
| 59 | + | if ($isInstanceOf(j, "String")) |
---|
64 | 60 | | then { |
---|
65 | | - | let l = k |
---|
66 | | - | l |
---|
| 61 | + | let k = j |
---|
| 62 | + | k |
---|
67 | 63 | | } |
---|
68 | 64 | | else "" |
---|
69 | 65 | | } |
---|
70 | 66 | | |
---|
71 | 67 | | |
---|
72 | | - | func t (r,n) = { |
---|
73 | | - | let u = s(r, n) |
---|
74 | | - | if ((u == "")) |
---|
| 68 | + | func s (q,m) = { |
---|
| 69 | + | let t = r(q, m) |
---|
| 70 | + | if ((t == "")) |
---|
75 | 71 | | then true |
---|
76 | 72 | | else false |
---|
77 | 73 | | } |
---|
78 | 74 | | |
---|
79 | 75 | | |
---|
80 | | - | @Callable(v) |
---|
81 | | - | func addEntrepreneurProfile (w,x,y,z,A) = if ((v.caller.bytes != c)) |
---|
| 76 | + | @Callable(u) |
---|
| 77 | + | func addEntrepreneurProfile (v,w,x,y,z) = if ((u.caller.bytes != b)) |
---|
82 | 78 | | then throw("Only Dyzrupt Admin can call this dApp function") |
---|
83 | 79 | | else { |
---|
84 | | - | let B = toBase58String(v.transactionId) |
---|
85 | | - | WriteSet([DataEntry(e(B), ((((((((w + "_") + x) + "_") + y) + "_") + z) + "_") + A)), DataEntry(h(B, "upvote"), 0), DataEntry(g(B), "open"), DataEntry(h(B, "downvote"), 0)]) |
---|
| 80 | + | let A = toBase58String(u.transactionId) |
---|
| 81 | + | WriteSet([DataEntry(d(A), ((((((((v + "_") + w) + "_") + x) + "_") + y) + "_") + z)), DataEntry(g(A, "upvote"), 0), DataEntry(f(A), "open")]) |
---|
86 | 82 | | } |
---|
87 | 83 | | |
---|
88 | 84 | | |
---|
89 | 85 | | |
---|
90 | | - | @Callable(v) |
---|
91 | | - | func vote (n,p) = { |
---|
92 | | - | let C = extract(v.payment) |
---|
93 | | - | if ((C.amount == 0)) |
---|
| 86 | + | @Callable(u) |
---|
| 87 | + | func vote (m,o) = { |
---|
| 88 | + | let B = extract(u.payment) |
---|
| 89 | + | if ((B.amount == 0)) |
---|
94 | 90 | | then throw("You cannot vote without paying voting fee") |
---|
95 | | - | else if ((C.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) |
---|
| 91 | + | else if ((B.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G')) |
---|
96 | 92 | | then throw("You can only vote with DYZRUPT token") |
---|
97 | | - | else if (t(toBase58String(v.caller.bytes), n)) |
---|
98 | | - | then if (j(n)) |
---|
99 | | - | then if ((m(n) == "open")) |
---|
100 | | - | then if (if ((p == a)) |
---|
101 | | - | then true |
---|
102 | | - | else (p == b)) |
---|
| 93 | + | else if (s(toBase58String(u.caller.bytes), m)) |
---|
| 94 | + | then if (i(m)) |
---|
| 95 | + | then if ((l(m) == "open")) |
---|
| 96 | + | then if ((o == a)) |
---|
103 | 97 | | then { |
---|
104 | | - | let D = o(n, p) |
---|
105 | | - | let E = (D + 1) |
---|
106 | | - | ScriptResult(WriteSet([DataEntry(h(n, p), E), DataEntry(q(toBase58String(v.caller.bytes), n), n)]), TransferSet([ScriptTransfer(this, C.amount, d)])) |
---|
| 98 | + | let C = n(m, o) |
---|
| 99 | + | let D = (C + 1) |
---|
| 100 | + | ScriptResult(WriteSet([DataEntry(g(m, o), D), DataEntry(p(toBase58String(u.caller.bytes), m), m)]), TransferSet([ScriptTransfer(this, B.amount, c)])) |
---|
107 | 101 | | } |
---|
108 | 102 | | else throw("Not a valid vote value") |
---|
109 | 103 | | else throw("This profile is not open for voting") |
---|
110 | 104 | | else throw("Invalid Profile") |
---|
111 | 105 | | else throw("You can't vote twice") |
---|
112 | 106 | | } |
---|
113 | 107 | | |
---|
114 | 108 | | |
---|
115 | 109 | | |
---|
116 | | - | @Callable(v) |
---|
117 | | - | func openVote (n) = if ((v.caller.bytes != c)) |
---|
| 110 | + | @Callable(u) |
---|
| 111 | + | func openVote (m) = if ((u.caller.bytes != b)) |
---|
118 | 112 | | then throw("Only Dyzrupt Admin can call this dApp function") |
---|
119 | | - | else if (j(n)) |
---|
120 | | - | then WriteSet([DataEntry(g(n), "open")]) |
---|
| 113 | + | else if (i(m)) |
---|
| 114 | + | then WriteSet([DataEntry(f(m), "open")]) |
---|
121 | 115 | | else throw("Invalid ID") |
---|
122 | 116 | | |
---|
123 | 117 | | |
---|
124 | 118 | | |
---|
125 | | - | @Callable(v) |
---|
126 | | - | func closeVote (n) = if ((v.caller.bytes != c)) |
---|
| 119 | + | @Callable(u) |
---|
| 120 | + | func closeVote (m) = if ((u.caller.bytes != b)) |
---|
127 | 121 | | then throw("Only Dyzrupt Admin can call this dApp function") |
---|
128 | | - | else if (j(n)) |
---|
129 | | - | then WriteSet([DataEntry(g(n), "closed")]) |
---|
| 122 | + | else if (i(m)) |
---|
| 123 | + | then WriteSet([DataEntry(f(m), "closed")]) |
---|
130 | 124 | | else throw("Invalid ID") |
---|
131 | 125 | | |
---|
132 | 126 | | |
---|