tx · HFqCVY3kVGib5gm4JsSKBMGvGbFKKVLxB8jDHsodNUHg 3N2wcNfEWihUVJV2S6jKwcw3QDupKgXPBnp: -0.01400000 Waves 2021.03.13 15:27 [1435910] smart account 3N2wcNfEWihUVJV2S6jKwcw3QDupKgXPBnp > SELF 0.00000000 Waves
{ "type": 13, "id": "HFqCVY3kVGib5gm4JsSKBMGvGbFKKVLxB8jDHsodNUHg", "fee": 1400000, "feeAssetId": null, "timestamp": 1615638483185, "version": 1, "sender": "3N2wcNfEWihUVJV2S6jKwcw3QDupKgXPBnp", "senderPublicKey": "2Ek8QRiW2SC3s4ZC79pXUmvJbmqU6agaNsjN2wmnzmSs", "proofs": [ "5WXg7fuPtX6YfLaRTJXnVwjHb5GYpmzihvi5H1kgnSGhj89VRNd6HjiTNax2xWS2R6PwHToHWeyQiDyuJjDFHGCE" ], "script": "base64:AAIEAAAAAAAAAAgIAhIECgIYEQAAAAcAAAAAEWtVc2VyUG9vbFZvdGVTV09QAgAAAAVfdm90ZQAAAAASa1VzZXJUb3RhbFZvdGVTV09QAgAAABVfdXNlcl90b3RhbF9TV09QX3ZvdGUAAAAADWtQb29sVm90ZVNXT1ACAAAACl92b3RlX1NXT1AAAAAADmtUb3RhbFZvdGVTV09QAgAAAA90b3RhbF92b3RlX1NXT1AAAAAAB2dvdkFkZHIJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVRAR/HWw3DxHB4C9lwcyuInima35raJGzsBAAAAFGlzQ2FsbGVySW5Hb3Zlcm5hbmNlAAAAAQAAAAR1c2VyAwMJAABmAAAAAgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBoAAAACBQAAAAdnb3ZBZGRyCQABLAAAAAIJAAQlAAAAAQUAAAAEdXNlcgIAAAAMX1NXT1BfYW1vdW50AAAAAAAAAAAAAAAAAAAAAAAABgkAAGYAAAACCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgkABCUAAAABBQAAAAR1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hY2M0MzIzNzMyNzgJAAGRAAAAAgUAAAANJGxpc3QzMjM3MzI3OAAAAAAAAAAABAMJAAAAAAAAAgUAAAANJHNpemUzMjM3MzI3OAAAAAAAAAAABQUAAAANJGFjYzUzMjM3MzI3OAQAAAANJGFjYzYzMjM3MzI3OAkBAAAADXBvb2xWb3RlRW50cnkAAAACBQAAAA0kYWNjNTMyMzczMjc4CQABkQAAAAIFAAAADSRsaXN0MzIzNzMyNzgAAAAAAAAAAAUJAAACAAAAAQIAAAASTGlzdCBzaXplIGV4Y2VlZCA1AwkAAGYAAAACBQAAABR1c2VyU1dPUGluR292ZXJuYW5jZQUAAAAUdXNlclRvdGFsVm90ZVNXT1BOZXcJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQAEJQAAAAEFAAAABHRoaXMCAAAABSBoYXMgCQABpAAAAAEFAAAAFHVzZXJTV09QaW5Hb3Zlcm5hbmNlAgAAACdTV09QIGluIGdvdmVybmFuY2UuIE5ldyBTV09QIGluIHZvdGluZyAJAAGkAAAAAQUAAAAUdXNlclRvdGFsVm90ZVNXT1BOZXcJAAROAAAAAgkABE4AAAACBQAAAA11c2VyRGF0YUVudHJ5BQAAAA1wb29sRGF0YUVudHJ5CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAABJrVXNlclRvdGFsVm90ZVNXT1AFAAAAFHVzZXJUb3RhbFZvdGVTV09QTmV3CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAA5rVG90YWxWb3RlU1dPUAUAAAAQdG90YWxWb3RlU1dPUG5ldwUAAAADbmlsAAAAAB57Aks=", "chainId": 84, "height": 1435910, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: cnjgS154pFETMTS2p15gRPc4HpEWY1z3seEneB9D63g Next: 8FHWy6nxEbWwM6v6HwWfJDHiNwABYpP1J7Fj2zsiYTks Diff:
Old | New | Differences | |
---|---|---|---|
30 | 30 | else { | |
31 | 31 | let poolIndex = value(indexOf(poolAddresses, poolAddress)) | |
32 | 32 | let userPoolVoteSWOPNew = poolsVoteSWOPNew[poolIndex] | |
33 | - | let userPoolVoteSWOP = valueOrElse(getInteger(this, (((toString(i.caller) + | |
33 | + | let userPoolVoteSWOP = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolVoteSWOP)), 0) | |
34 | 34 | let poolVoteDiffSWOP = (userPoolVoteSWOPNew - userPoolVoteSWOP) | |
35 | - | if (true) | |
36 | - | then throw(((toString(userPoolVoteSWOPNew) + " ") + toString(userPoolVoteSWOP))) | |
37 | - | else (accumulated + poolVoteDiffSWOP) | |
35 | + | (accumulated + poolVoteDiffSWOP) | |
38 | 36 | } | |
39 | 37 | ||
40 | 38 | func userVoteEntry (accumulated,poolAddress) = { | |
60 | 58 | let userTotalVoteSWOP = valueOrElse(getInteger(this, (toString(i.caller) + kUserTotalVoteSWOP)), 0) | |
61 | 59 | let userSWOPinGovernance = getIntegerValue(govAddr, (toString(i.caller) + "_SWOP_amount")) | |
62 | 60 | let userVoteDiffSWOP = { | |
63 | - | let $ | |
64 | - | let $ | |
65 | - | let $ | |
66 | - | if (($ | |
67 | - | then $ | |
61 | + | let $list28482891 = poolAddresses | |
62 | + | let $size28482891 = size($list28482891) | |
63 | + | let $acc028482891 = 0 | |
64 | + | if (($size28482891 == 0)) | |
65 | + | then $acc028482891 | |
68 | 66 | else { | |
69 | - | let $ | |
70 | - | if (($ | |
71 | - | then $ | |
67 | + | let $acc128482891 = calcVoteDiffSWOP($acc028482891, $list28482891[0]) | |
68 | + | if (($size28482891 == 1)) | |
69 | + | then $acc128482891 | |
72 | 70 | else { | |
73 | - | let $ | |
74 | - | if (($ | |
75 | - | then $ | |
71 | + | let $acc228482891 = calcVoteDiffSWOP($acc128482891, $list28482891[1]) | |
72 | + | if (($size28482891 == 2)) | |
73 | + | then $acc228482891 | |
76 | 74 | else { | |
77 | - | let $ | |
78 | - | if (($ | |
79 | - | then $ | |
75 | + | let $acc328482891 = calcVoteDiffSWOP($acc228482891, $list28482891[2]) | |
76 | + | if (($size28482891 == 3)) | |
77 | + | then $acc328482891 | |
80 | 78 | else { | |
81 | - | let $ | |
82 | - | if (($ | |
83 | - | then $ | |
79 | + | let $acc428482891 = calcVoteDiffSWOP($acc328482891, $list28482891[3]) | |
80 | + | if (($size28482891 == 4)) | |
81 | + | then $acc428482891 | |
84 | 82 | else { | |
85 | - | let $ | |
86 | - | if (($ | |
87 | - | then $ | |
83 | + | let $acc528482891 = calcVoteDiffSWOP($acc428482891, $list28482891[4]) | |
84 | + | if (($size28482891 == 5)) | |
85 | + | then $acc528482891 | |
88 | 86 | else { | |
89 | - | let $ | |
87 | + | let $acc628482891 = calcVoteDiffSWOP($acc528482891, $list28482891[5]) | |
90 | 88 | throw("List size exceed 5") | |
91 | 89 | } | |
92 | 90 | } | |
101 | 99 | then throw(((((toString(totalVoteSWOPnew) + " ") + toString(totalVoteSWOP)) + " ") + toString(userVoteDiffSWOP))) | |
102 | 100 | else { | |
103 | 101 | let userDataEntry = { | |
104 | - | let $ | |
105 | - | let $ | |
106 | - | let $ | |
107 | - | if (($ | |
108 | - | then $ | |
102 | + | let $list31713212 = poolAddresses | |
103 | + | let $size31713212 = size($list31713212) | |
104 | + | let $acc031713212 = nil | |
105 | + | if (($size31713212 == 0)) | |
106 | + | then $acc031713212 | |
109 | 107 | else { | |
110 | - | let $ | |
111 | - | if (($ | |
112 | - | then $ | |
108 | + | let $acc131713212 = userVoteEntry($acc031713212, $list31713212[0]) | |
109 | + | if (($size31713212 == 1)) | |
110 | + | then $acc131713212 | |
113 | 111 | else { | |
114 | - | let $ | |
115 | - | if (($ | |
116 | - | then $ | |
112 | + | let $acc231713212 = userVoteEntry($acc131713212, $list31713212[1]) | |
113 | + | if (($size31713212 == 2)) | |
114 | + | then $acc231713212 | |
117 | 115 | else { | |
118 | - | let $ | |
119 | - | if (($ | |
120 | - | then $ | |
116 | + | let $acc331713212 = userVoteEntry($acc231713212, $list31713212[2]) | |
117 | + | if (($size31713212 == 3)) | |
118 | + | then $acc331713212 | |
121 | 119 | else { | |
122 | - | let $ | |
123 | - | if (($ | |
124 | - | then $ | |
120 | + | let $acc431713212 = userVoteEntry($acc331713212, $list31713212[3]) | |
121 | + | if (($size31713212 == 4)) | |
122 | + | then $acc431713212 | |
125 | 123 | else { | |
126 | - | let $ | |
127 | - | if (($ | |
128 | - | then $ | |
124 | + | let $acc531713212 = userVoteEntry($acc431713212, $list31713212[4]) | |
125 | + | if (($size31713212 == 5)) | |
126 | + | then $acc531713212 | |
129 | 127 | else { | |
130 | - | let $ | |
128 | + | let $acc631713212 = userVoteEntry($acc531713212, $list31713212[5]) | |
131 | 129 | throw("List size exceed 5") | |
132 | 130 | } | |
133 | 131 | } | |
137 | 135 | } | |
138 | 136 | } | |
139 | 137 | let poolDataEntry = { | |
140 | - | let $ | |
141 | - | let $ | |
142 | - | let $ | |
143 | - | if (($ | |
144 | - | then $ | |
138 | + | let $list32373278 = poolAddresses | |
139 | + | let $size32373278 = size($list32373278) | |
140 | + | let $acc032373278 = nil | |
141 | + | if (($size32373278 == 0)) | |
142 | + | then $acc032373278 | |
145 | 143 | else { | |
146 | - | let $ | |
147 | - | if (($ | |
148 | - | then $ | |
144 | + | let $acc132373278 = poolVoteEntry($acc032373278, $list32373278[0]) | |
145 | + | if (($size32373278 == 1)) | |
146 | + | then $acc132373278 | |
149 | 147 | else { | |
150 | - | let $ | |
151 | - | if (($ | |
152 | - | then $ | |
148 | + | let $acc232373278 = poolVoteEntry($acc132373278, $list32373278[1]) | |
149 | + | if (($size32373278 == 2)) | |
150 | + | then $acc232373278 | |
153 | 151 | else { | |
154 | - | let $ | |
155 | - | if (($ | |
156 | - | then $ | |
152 | + | let $acc332373278 = poolVoteEntry($acc232373278, $list32373278[2]) | |
153 | + | if (($size32373278 == 3)) | |
154 | + | then $acc332373278 | |
157 | 155 | else { | |
158 | - | let $ | |
159 | - | if (($ | |
160 | - | then $ | |
156 | + | let $acc432373278 = poolVoteEntry($acc332373278, $list32373278[3]) | |
157 | + | if (($size32373278 == 4)) | |
158 | + | then $acc432373278 | |
161 | 159 | else { | |
162 | - | let $ | |
163 | - | if (($ | |
164 | - | then $ | |
160 | + | let $acc532373278 = poolVoteEntry($acc432373278, $list32373278[4]) | |
161 | + | if (($size32373278 == 5)) | |
162 | + | then $acc532373278 | |
165 | 163 | else { | |
166 | - | let $ | |
164 | + | let $acc632373278 = poolVoteEntry($acc532373278, $list32373278[5]) | |
167 | 165 | throw("List size exceed 5") | |
168 | 166 | } | |
169 | 167 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kUserPoolVoteSWOP = "_vote" | |
5 | 5 | ||
6 | 6 | let kUserTotalVoteSWOP = "_user_total_SWOP_vote" | |
7 | 7 | ||
8 | 8 | let kPoolVoteSWOP = "_vote_SWOP" | |
9 | 9 | ||
10 | 10 | let kTotalVoteSWOP = "total_vote_SWOP" | |
11 | 11 | ||
12 | 12 | let govAddr = Address(base58'3MumyD14hrRb2Vj3HAifsnCcUpsELAZWxAE') | |
13 | 13 | ||
14 | 14 | func isCallerInGovernance (user) = if (if ((valueOrElse(getInteger(govAddr, (toString(user) + "_SWOP_amount")), 0) > 0)) | |
15 | 15 | then true | |
16 | 16 | else (valueOrElse(getInteger(this, (toString(user) + kUserTotalVoteSWOP)), 0) > 0)) | |
17 | 17 | then true | |
18 | 18 | else false | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func isPoolInGovernance (poolAddress) = if ((valueOrElse(getInteger(govAddr, (poolAddress + "_current_pool_fraction_reward")), 0) > 0)) | |
22 | 22 | then true | |
23 | 23 | else false | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(i) | |
27 | 27 | func votePoolWeight (poolAddresses,poolsVoteSWOPNew) = { | |
28 | 28 | func calcVoteDiffSWOP (accumulated,poolAddress) = if (!(isPoolInGovernance(poolAddress))) | |
29 | 29 | then throw("This pool has no _current_pool_fraction_reward in Governance dApp") | |
30 | 30 | else { | |
31 | 31 | let poolIndex = value(indexOf(poolAddresses, poolAddress)) | |
32 | 32 | let userPoolVoteSWOPNew = poolsVoteSWOPNew[poolIndex] | |
33 | - | let userPoolVoteSWOP = valueOrElse(getInteger(this, (((toString(i.caller) + | |
33 | + | let userPoolVoteSWOP = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolVoteSWOP)), 0) | |
34 | 34 | let poolVoteDiffSWOP = (userPoolVoteSWOPNew - userPoolVoteSWOP) | |
35 | - | if (true) | |
36 | - | then throw(((toString(userPoolVoteSWOPNew) + " ") + toString(userPoolVoteSWOP))) | |
37 | - | else (accumulated + poolVoteDiffSWOP) | |
35 | + | (accumulated + poolVoteDiffSWOP) | |
38 | 36 | } | |
39 | 37 | ||
40 | 38 | func userVoteEntry (accumulated,poolAddress) = { | |
41 | 39 | let poolIndex = value(indexOf(poolAddresses, poolAddress)) | |
42 | 40 | let userPoolVoteSWOPNew = poolsVoteSWOPNew[poolIndex] | |
43 | 41 | IntegerEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolVoteSWOP), userPoolVoteSWOPNew) :: accumulated | |
44 | 42 | } | |
45 | 43 | ||
46 | 44 | func poolVoteEntry (accumulated,poolAddress) = { | |
47 | 45 | let poolIndex = value(indexOf(poolAddresses, poolAddress)) | |
48 | 46 | let userPoolVoteSWOP = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolVoteSWOP)), 0) | |
49 | 47 | let userPoolVoteSWOPNew = poolsVoteSWOPNew[poolIndex] | |
50 | 48 | let poolVoteDiffSWOP = (userPoolVoteSWOPNew - userPoolVoteSWOP) | |
51 | 49 | let poolVoteSWOP = valueOrElse(getInteger(this, (poolAddress + kPoolVoteSWOP)), 0) | |
52 | 50 | let poolVoteSWOPnew = (poolVoteSWOP + poolVoteDiffSWOP) | |
53 | 51 | IntegerEntry((poolAddress + kPoolVoteSWOP), poolVoteSWOPnew) :: accumulated | |
54 | 52 | } | |
55 | 53 | ||
56 | 54 | if (!(isCallerInGovernance(i.caller))) | |
57 | 55 | then throw("This address has 0 SWOP in Governance dApp") | |
58 | 56 | else { | |
59 | 57 | let totalVoteSWOP = valueOrElse(getInteger(this, kTotalVoteSWOP), 0) | |
60 | 58 | let userTotalVoteSWOP = valueOrElse(getInteger(this, (toString(i.caller) + kUserTotalVoteSWOP)), 0) | |
61 | 59 | let userSWOPinGovernance = getIntegerValue(govAddr, (toString(i.caller) + "_SWOP_amount")) | |
62 | 60 | let userVoteDiffSWOP = { | |
63 | - | let $ | |
64 | - | let $ | |
65 | - | let $ | |
66 | - | if (($ | |
67 | - | then $ | |
61 | + | let $list28482891 = poolAddresses | |
62 | + | let $size28482891 = size($list28482891) | |
63 | + | let $acc028482891 = 0 | |
64 | + | if (($size28482891 == 0)) | |
65 | + | then $acc028482891 | |
68 | 66 | else { | |
69 | - | let $ | |
70 | - | if (($ | |
71 | - | then $ | |
67 | + | let $acc128482891 = calcVoteDiffSWOP($acc028482891, $list28482891[0]) | |
68 | + | if (($size28482891 == 1)) | |
69 | + | then $acc128482891 | |
72 | 70 | else { | |
73 | - | let $ | |
74 | - | if (($ | |
75 | - | then $ | |
71 | + | let $acc228482891 = calcVoteDiffSWOP($acc128482891, $list28482891[1]) | |
72 | + | if (($size28482891 == 2)) | |
73 | + | then $acc228482891 | |
76 | 74 | else { | |
77 | - | let $ | |
78 | - | if (($ | |
79 | - | then $ | |
75 | + | let $acc328482891 = calcVoteDiffSWOP($acc228482891, $list28482891[2]) | |
76 | + | if (($size28482891 == 3)) | |
77 | + | then $acc328482891 | |
80 | 78 | else { | |
81 | - | let $ | |
82 | - | if (($ | |
83 | - | then $ | |
79 | + | let $acc428482891 = calcVoteDiffSWOP($acc328482891, $list28482891[3]) | |
80 | + | if (($size28482891 == 4)) | |
81 | + | then $acc428482891 | |
84 | 82 | else { | |
85 | - | let $ | |
86 | - | if (($ | |
87 | - | then $ | |
83 | + | let $acc528482891 = calcVoteDiffSWOP($acc428482891, $list28482891[4]) | |
84 | + | if (($size28482891 == 5)) | |
85 | + | then $acc528482891 | |
88 | 86 | else { | |
89 | - | let $ | |
87 | + | let $acc628482891 = calcVoteDiffSWOP($acc528482891, $list28482891[5]) | |
90 | 88 | throw("List size exceed 5") | |
91 | 89 | } | |
92 | 90 | } | |
93 | 91 | } | |
94 | 92 | } | |
95 | 93 | } | |
96 | 94 | } | |
97 | 95 | } | |
98 | 96 | let userTotalVoteSWOPNew = (userTotalVoteSWOP + userVoteDiffSWOP) | |
99 | 97 | let totalVoteSWOPnew = (totalVoteSWOP + userVoteDiffSWOP) | |
100 | 98 | if (true) | |
101 | 99 | then throw(((((toString(totalVoteSWOPnew) + " ") + toString(totalVoteSWOP)) + " ") + toString(userVoteDiffSWOP))) | |
102 | 100 | else { | |
103 | 101 | let userDataEntry = { | |
104 | - | let $ | |
105 | - | let $ | |
106 | - | let $ | |
107 | - | if (($ | |
108 | - | then $ | |
102 | + | let $list31713212 = poolAddresses | |
103 | + | let $size31713212 = size($list31713212) | |
104 | + | let $acc031713212 = nil | |
105 | + | if (($size31713212 == 0)) | |
106 | + | then $acc031713212 | |
109 | 107 | else { | |
110 | - | let $ | |
111 | - | if (($ | |
112 | - | then $ | |
108 | + | let $acc131713212 = userVoteEntry($acc031713212, $list31713212[0]) | |
109 | + | if (($size31713212 == 1)) | |
110 | + | then $acc131713212 | |
113 | 111 | else { | |
114 | - | let $ | |
115 | - | if (($ | |
116 | - | then $ | |
112 | + | let $acc231713212 = userVoteEntry($acc131713212, $list31713212[1]) | |
113 | + | if (($size31713212 == 2)) | |
114 | + | then $acc231713212 | |
117 | 115 | else { | |
118 | - | let $ | |
119 | - | if (($ | |
120 | - | then $ | |
116 | + | let $acc331713212 = userVoteEntry($acc231713212, $list31713212[2]) | |
117 | + | if (($size31713212 == 3)) | |
118 | + | then $acc331713212 | |
121 | 119 | else { | |
122 | - | let $ | |
123 | - | if (($ | |
124 | - | then $ | |
120 | + | let $acc431713212 = userVoteEntry($acc331713212, $list31713212[3]) | |
121 | + | if (($size31713212 == 4)) | |
122 | + | then $acc431713212 | |
125 | 123 | else { | |
126 | - | let $ | |
127 | - | if (($ | |
128 | - | then $ | |
124 | + | let $acc531713212 = userVoteEntry($acc431713212, $list31713212[4]) | |
125 | + | if (($size31713212 == 5)) | |
126 | + | then $acc531713212 | |
129 | 127 | else { | |
130 | - | let $ | |
128 | + | let $acc631713212 = userVoteEntry($acc531713212, $list31713212[5]) | |
131 | 129 | throw("List size exceed 5") | |
132 | 130 | } | |
133 | 131 | } | |
134 | 132 | } | |
135 | 133 | } | |
136 | 134 | } | |
137 | 135 | } | |
138 | 136 | } | |
139 | 137 | let poolDataEntry = { | |
140 | - | let $ | |
141 | - | let $ | |
142 | - | let $ | |
143 | - | if (($ | |
144 | - | then $ | |
138 | + | let $list32373278 = poolAddresses | |
139 | + | let $size32373278 = size($list32373278) | |
140 | + | let $acc032373278 = nil | |
141 | + | if (($size32373278 == 0)) | |
142 | + | then $acc032373278 | |
145 | 143 | else { | |
146 | - | let $ | |
147 | - | if (($ | |
148 | - | then $ | |
144 | + | let $acc132373278 = poolVoteEntry($acc032373278, $list32373278[0]) | |
145 | + | if (($size32373278 == 1)) | |
146 | + | then $acc132373278 | |
149 | 147 | else { | |
150 | - | let $ | |
151 | - | if (($ | |
152 | - | then $ | |
148 | + | let $acc232373278 = poolVoteEntry($acc132373278, $list32373278[1]) | |
149 | + | if (($size32373278 == 2)) | |
150 | + | then $acc232373278 | |
153 | 151 | else { | |
154 | - | let $ | |
155 | - | if (($ | |
156 | - | then $ | |
152 | + | let $acc332373278 = poolVoteEntry($acc232373278, $list32373278[2]) | |
153 | + | if (($size32373278 == 3)) | |
154 | + | then $acc332373278 | |
157 | 155 | else { | |
158 | - | let $ | |
159 | - | if (($ | |
160 | - | then $ | |
156 | + | let $acc432373278 = poolVoteEntry($acc332373278, $list32373278[3]) | |
157 | + | if (($size32373278 == 4)) | |
158 | + | then $acc432373278 | |
161 | 159 | else { | |
162 | - | let $ | |
163 | - | if (($ | |
164 | - | then $ | |
160 | + | let $acc532373278 = poolVoteEntry($acc432373278, $list32373278[4]) | |
161 | + | if (($size32373278 == 5)) | |
162 | + | then $acc532373278 | |
165 | 163 | else { | |
166 | - | let $ | |
164 | + | let $acc632373278 = poolVoteEntry($acc532373278, $list32373278[5]) | |
167 | 165 | throw("List size exceed 5") | |
168 | 166 | } | |
169 | 167 | } | |
170 | 168 | } | |
171 | 169 | } | |
172 | 170 | } | |
173 | 171 | } | |
174 | 172 | } | |
175 | 173 | if ((userSWOPinGovernance > userTotalVoteSWOPNew)) | |
176 | 174 | then throw(((((toString(this) + " has ") + toString(userSWOPinGovernance)) + "SWOP in governance. New SWOP in voting ") + toString(userTotalVoteSWOPNew))) | |
177 | 175 | else ((userDataEntry ++ poolDataEntry) ++ [IntegerEntry((toString(i.caller) + kUserTotalVoteSWOP), userTotalVoteSWOPNew), IntegerEntry(kTotalVoteSWOP, totalVoteSWOPnew)]) | |
178 | 176 | } | |
179 | 177 | } | |
180 | 178 | } | |
181 | 179 | ||
182 | 180 |
github/deemru/w8io/169f3d6 93.56 ms ◑