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