tx · 7E4MPk4bu9PG3WxV7cnCFKtH54d2R21vRfhrYaKuFdg9 3NBZkTq4XgvS9cWHQPutnUm3C1ZS4tDMqJa: -0.01100000 Waves 2023.01.24 14:00 [2418956] smart account 3NBZkTq4XgvS9cWHQPutnUm3C1ZS4tDMqJa > SELF 0.00000000 Waves
{ "type": 13, "id": "7E4MPk4bu9PG3WxV7cnCFKtH54d2R21vRfhrYaKuFdg9", "fee": 1100000, "feeAssetId": null, "timestamp": 1674558102135, "version": 2, "chainId": 84, "sender": "3NBZkTq4XgvS9cWHQPutnUm3C1ZS4tDMqJa", "senderPublicKey": "HJ4MXkC5hCwrUSxdnzS5VVpQGe5zYXcUVukdiKcGNVnV", "proofs": [ "5VB1WTr3oDryMsiEjwWnkQWXoXtURu5he4yUniKRuStDmuBPvcJjumynENn4wqvzmpEbGA1UuAZKzVbcB6SVFRG", "27KTqbwGm3SCtLkNZo5BtX7XX5n7eqxy33f36XioCqHEpDA5HLQnqM1XuBcW8A5zBPd9n3u5t8QuYarE4GUH8G8d" ], "script": "base64:BgIMCAISBAoCCAESABIALgAHa0FjdGl2ZQIGYWN0aXZlAA1rZXlBY3RpdmVHbG9iAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwAPa0RlcHJlY2F0ZWRQb29sAgtkZXByZWNhdGVkXwAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQANa1VzZXJQb29sVm90ZQIQX3VzZXJfdm90ZV9nU1dPUAAOa1VzZXJUb3RhbFZvdGUCFl91c2VyX3RvdGFsX3ZvdGVfZ1NXT1AACWtQb29sVm90ZQIQX3Bvb2xfdm90ZV9nU1dPUAAKa1RvdGFsVm90ZQIQdG90YWxfdm90ZV9nU1dPUAAQa0hhcnZlc3RQb29sVm90ZQIYX2hhcnZlc3RfcG9vbF92b3RlX2dTV09QABRrSGFydmVzdFVzZXJQb29sVm90ZQIdX2hhcnZlc3RfdXNlcl9wb29sX3ZvdGVfZ1NXT1AADGtTdGFydEhlaWdodAIMc3Rh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RYL1fw1wjm2K14CvYk Next: Dxp7zASLGcx2gPxzmtmkzM3ZaPmFcvCLE7PfFwP24kJn Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
5 | 5 | ||
6 | 6 | let keyActiveGlob = "active_all_contracts" | |
7 | 7 | ||
8 | 8 | let kDeprecatedPool = "deprecated_" | |
9 | 9 | ||
10 | 10 | let kCause = "shutdown_cause" | |
11 | 11 | ||
12 | 12 | let kUserPoolVote = "_user_vote_gSWOP" | |
13 | 13 | ||
14 | 14 | let kUserTotalVote = "_user_total_vote_gSWOP" | |
15 | 15 | ||
16 | 16 | let kPoolVote = "_pool_vote_gSWOP" | |
17 | 17 | ||
18 | 18 | let kTotalVote = "total_vote_gSWOP" | |
19 | 19 | ||
20 | 20 | let kHarvestPoolVote = "_harvest_pool_vote_gSWOP" | |
21 | 21 | ||
22 | 22 | let kHarvestUserPoolVote = "_harvest_user_pool_vote_gSWOP" | |
23 | 23 | ||
24 | 24 | let kStartHeight = "start_height" | |
25 | 25 | ||
26 | 26 | let kBasePeriod = "base_period" | |
27 | 27 | ||
28 | 28 | let kPeriodLength = "period_length" | |
29 | 29 | ||
30 | 30 | let kAdminPubKey1 = "admin_pub_1" | |
31 | 31 | ||
32 | 32 | let kAdminPubKey2 = "admin_pub_2" | |
33 | 33 | ||
34 | 34 | let kAdminPubKey3 = "admin_pub_3" | |
35 | 35 | ||
36 | 36 | let kFarmingAddr = "farming_address" | |
37 | 37 | ||
38 | 38 | let kGovAddress = "governance_address" | |
39 | 39 | ||
40 | 40 | let kPoolFirstHarvestEndHeight = "first_harvest_height" | |
41 | 41 | ||
42 | 42 | let kPoolStruc = "_pool_struc" | |
43 | 43 | ||
44 | 44 | let kUserPoolStruc = "_user_pool_struc" | |
45 | 45 | ||
46 | 46 | let kUserTotalStruc = "_user_total_struc" | |
47 | 47 | ||
48 | 48 | let kTotalStruc = "total_struc" | |
49 | 49 | ||
50 | 50 | let kHarvestPoolActiveVoteStruc = "_harvest_pool_activeVote_struc" | |
51 | 51 | ||
52 | 52 | let kHarvestUserPoolActiveVoteStruc = "_harvest_user_pool_activeVote_struc" | |
53 | 53 | ||
54 | 54 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
55 | 55 | ||
56 | 56 | let active = valueOrElse(getBoolean(this, kActive), true) | |
57 | 57 | ||
58 | 58 | let activeGlob = valueOrElse(getBoolean(oracle, keyActiveGlob), true) | |
59 | 59 | ||
60 | 60 | let basePeriod = valueOrErrorMessage(getInteger(this, kBasePeriod), "Empty kBasePeriod") | |
61 | 61 | ||
62 | 62 | let startHeight = valueOrErrorMessage(getInteger(this, kStartHeight), "Empty kStartHeight") | |
63 | 63 | ||
64 | 64 | let periodLength = valueOrErrorMessage(getInteger(this, kPeriodLength), "Empty kPeriodLength") | |
65 | 65 | ||
66 | 66 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
67 | 67 | case string: String => | |
68 | 68 | fromBase58String(string) | |
69 | 69 | case nothing => | |
70 | 70 | throw((key + "is empty")) | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
75 | 75 | ||
76 | 76 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
77 | 77 | ||
78 | 78 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
79 | 79 | ||
80 | 80 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
81 | 81 | ||
82 | 82 | let farmingAddr = Address(getBase58FromOracle(kFarmingAddr)) | |
83 | 83 | ||
84 | 84 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
85 | 85 | ||
86 | 86 | func isActive () = if (if (active) | |
87 | 87 | then activeGlob | |
88 | 88 | else false) | |
89 | 89 | then unit | |
90 | 90 | else throw("DApp is inactive at this moment") | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
94 | 94 | then unit | |
95 | 95 | else throw("Only admin can call this function") | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func isCallerInGovernance (user) = (valueOrElse(getInteger(govAddress, (toString(user) + "_SWOP_amount")), 0) > 0) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func isPoolInGovernance (poolAddress) = isDefined(getInteger(govAddress, (poolAddress + "_current_pool_fraction_reward"))) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getPoolDepricated (poolAddress) = valueOrElse(getBoolean(oracle, (kDeprecatedPool + poolAddress)), false) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func getPoolFirstHarvestStartHeight (poolAddress) = (valueOrElse(getInteger(Address(fromBase58String(poolAddress)), kPoolFirstHarvestEndHeight), 0) - periodLength) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func calcDeleteEntry (caller,poolAddress) = { | |
114 | 114 | func deleteIfExists (list,key) = if (isDefined(getString(this, key))) | |
115 | 115 | then (list :+ DeleteEntry(key)) | |
116 | 116 | else list | |
117 | 117 | ||
118 | 118 | deleteIfExists(deleteIfExists(deleteIfExists(deleteIfExists(deleteIfExists(deleteIfExists(nil, (((caller + "_") + poolAddress) + kUserPoolStruc)), (caller + kUserTotalStruc)), (poolAddress + kPoolStruc)), kTotalStruc), (poolAddress + kHarvestPoolActiveVoteStruc)), (((caller + "_") + poolAddress) + kHarvestUserPoolActiveVoteStruc)) | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | @Callable(i) | |
123 | 123 | func votePoolWeight (poolAddress,userPoolVoteNew) = valueOrElse(isActive(), if (!(isPoolInGovernance(poolAddress))) | |
124 | 124 | then throw("This pool is not in Governance dApp") | |
125 | 125 | else { | |
126 | 126 | let userSWOPinGovernance = valueOrErrorMessage(getInteger(govAddress, (toString(i.caller) + "_SWOP_amount")), "Empty _SWOP_amount at gov. address") | |
127 | 127 | let userGSWOPinGovernance = valueOrElse(getInteger(govAddress, (toString(i.caller) + "_GSwop_amount")), userSWOPinGovernance) | |
128 | 128 | let userPoolVote = if (isDefined(getString(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc)))) | |
129 | 129 | then parseIntValue(split(value(getString(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc))), "_")[0]) | |
130 | 130 | else valueOrElse(getInteger(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolVote)), 0) | |
131 | 131 | let userTotalVote = if (isDefined(getString(this, (toString(i.caller) + kUserTotalStruc)))) | |
132 | 132 | then parseIntValue(split(value(getString(this, (toString(i.caller) + kUserTotalStruc))), "_")[0]) | |
133 | 133 | else valueOrElse(getInteger(this, (toString(i.caller) + kUserTotalVote)), 0) | |
134 | 134 | let poolVote = if (isDefined(getString(this, (poolAddress + kPoolStruc)))) | |
135 | 135 | then parseIntValue(split(value(getString(this, (poolAddress + kPoolStruc))), "_")[0]) | |
136 | 136 | else valueOrElse(getInteger(this, (poolAddress + kPoolVote)), 0) | |
137 | 137 | let totalVote = if (isDefined(getString(this, kTotalStruc))) | |
138 | 138 | then parseIntValue(split(value(getString(this, kTotalStruc)), "_")[0]) | |
139 | 139 | else valueOrElse(getInteger(this, kTotalVote), 0) | |
140 | 140 | let poolVoteDiff = (userPoolVoteNew - userPoolVote) | |
141 | 141 | let userTotalVoteNew = (userTotalVote + poolVoteDiff) | |
142 | 142 | if (if (getPoolDepricated(poolAddress)) | |
143 | 143 | then (poolVoteDiff > 0) | |
144 | 144 | else false) | |
145 | 145 | then throw("You can't vote for deprecated pool") | |
146 | 146 | else if ((userTotalVoteNew > userGSWOPinGovernance)) | |
147 | 147 | then throw(((((toString(i.caller) + " has ") + toString(userGSWOPinGovernance)) + " GSWOP in governance. New GSWOP in voting ") + toString(userTotalVoteNew))) | |
148 | 148 | else if ((0 > userTotalVoteNew)) | |
149 | 149 | then throw("New userTotalVoteSWOPnew < 0") | |
150 | 150 | else if ((0 > userPoolVoteNew)) | |
151 | 151 | then throw("New userPoolVoteSWOPnew < 0") | |
152 | 152 | else { | |
153 | 153 | let removePoolVote = -(poolVoteDiff) | |
154 | 154 | let poolVoteNew = if ((userPoolVoteNew >= userPoolVote)) | |
155 | 155 | then (poolVote + poolVoteDiff) | |
156 | 156 | else (poolVote - removePoolVote) | |
157 | 157 | let totalVoteNew = if ((userPoolVoteNew >= userPoolVote)) | |
158 | 158 | then (totalVote + poolVoteDiff) | |
159 | 159 | else (totalVote - removePoolVote) | |
160 | 160 | if (if ((0 > poolVoteNew)) | |
161 | 161 | then true | |
162 | 162 | else (0 > totalVoteNew)) | |
163 | 163 | then throw("One or more values are negative") | |
164 | 164 | else { | |
165 | 165 | let harvestEntries = if ((getPoolFirstHarvestStartHeight(poolAddress) > height)) | |
166 | 166 | then [IntegerEntry((poolAddress + kHarvestPoolVote), poolVoteNew), IntegerEntry((((toString(i.caller) + "_") + poolAddress) + kHarvestUserPoolVote), userPoolVoteNew)] | |
167 | 167 | else nil | |
168 | 168 | let upUIntr = invoke(farmingAddr, "updateUserBoostInterest", [poolAddress, toString(i.caller)], nil) | |
169 | 169 | if ((upUIntr == upUIntr)) | |
170 | 170 | then (([IntegerEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolVote), userPoolVoteNew), IntegerEntry((toString(i.caller) + kUserTotalVote), userTotalVoteNew), IntegerEntry((poolAddress + kPoolVote), poolVoteNew), IntegerEntry(kTotalVote, totalVoteNew)] ++ calcDeleteEntry(toString(i.caller), poolAddress)) ++ harvestEntries) | |
171 | 171 | else throw("Strict value is not equal to itself.") | |
172 | 172 | } | |
173 | 173 | } | |
174 | 174 | }) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | ||
178 | 178 | @Callable(i) | |
179 | 179 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
180 | 180 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
181 | 181 | else suspend("Paused by admin")) | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | ||
185 | 185 | @Callable(i) | |
186 | 186 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
187 | 187 | then throw("DApp is already active") | |
188 | 188 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | @Verifier(tx) | |
192 | 192 | func verify () = { | |
193 | 193 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
194 | 194 | then 1 | |
195 | 195 | else 0 | |
196 | 196 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
197 | 197 | then 1 | |
198 | 198 | else 0 | |
199 | 199 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
200 | 200 | then 1 | |
201 | 201 | else 0 | |
202 | 202 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
203 | 203 | } | |
204 | 204 |
github/deemru/w8io/169f3d6 47.34 ms ◑