tx · 7vRZFFtWufGGN4PH7sg4nbh7s7i2vBYHHXsiLBbMRbt2 3MqJAScB6GGDcFxwV79KYp6Ub17DBexCDYR: -0.01200000 Waves 2023.01.24 13:55 [2418951] smart account 3MqJAScB6GGDcFxwV79KYp6Ub17DBexCDYR > SELF 0.00000000 Waves
{ "type": 13, "id": "7vRZFFtWufGGN4PH7sg4nbh7s7i2vBYHHXsiLBbMRbt2", "fee": 1200000, "feeAssetId": null, "timestamp": 1674557737238, "version": 2, "chainId": 84, "sender": "3MqJAScB6GGDcFxwV79KYp6Ub17DBexCDYR", "senderPublicKey": "7vAsM1uosf2qCT6sCBdJwhPkkfhBXbJ2Be6DZtdq6Tej", "proofs": [ "5H4Sf8gsF6wYFsy5mW9s7fLd2NMQPSRJ14xBdtp3WH1dr6UypdD2a67eaVJhBBzGzFPSE3C84RcoJ97Hr5M1vyVG", "5cpgLVcLK4rAEuYKFhm5jtprUh45d9gHJfPRTHyQYXdN55ZuyAuoifhqSSk435YwzZ3S6yyEFP34sNQA1n2dcG6p" ], "script": "base64:BgIUCAISABIFCgMICAESAwoBCBIAEgAlAAdrQWN0aXZlAgZhY3RpdmUAC2tBY3RpdmVHbG9iAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQAWa0xhc3RQb29sVG9rZW5JbnRlcmVzdAITX3Bvb2xfbGFzdF9pbnRlcmVzdAARa1VzZXJMYXN0SW50ZXJlc3QCE191c2VyX2xhc3RfaW50ZXJlc3QAE2tVc2VyQ2xhaW1BdmFpbGFibGUCGF91c2VyX2F2YWlsYWJsZV90b19jbGFpbQAWa1VzZXJTaGFyZVRva2Vuc0xvY2tlZAIUX3NoYXJlX3Rva2Vuc19sb2NrZWQAEmtTaGFyZVRva2Vuc0xvY2tlZAIaX3RvdGFsX3NoYXJlX3Rva2Vuc19sb2NrZWQAC2tPcmFjbGVQb29sAgVwb29sXwANa1Bvb2xBc3NldElkcwIJYXNzZXRfaWR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jdGl2ZQMJAQEhAQkBD2NvbnRhaW5zRWxlbWVudAIJAMwIAgUMYWRtaW5QdWJLZXkxCQDMCAIFDGFkbWluUHViS2V5MgkAzAgCBQxhZG1pblB1YktleTMFA25pbAgFAWkPY2FsbGVyUHVibGljS2V5CQACAQIhT25seSBhZG1pbiBjYW4gY2FsbCB0aGlzIGZ1bmN0aW9uCQDMCAIJAQxCb29sZWFuRW50cnkCBQdrQWN0aXZlBgkAzAgCCQELRGVsZXRlRW50cnkBBQZrQ2F1c2UFA25pbAECdHgBBnZlcmlmeQAEEmFkbWluUHViS2V5MVNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFDGFkbWluUHViS2V5MgABAAAEEmFkbWluUHViS2V5M1NpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAm2dC9o=", "height": 2418951, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3GepcLtUp89Jmuj9jtTo3ypTRMrBo6wtbqNGGBfN5HpH Next: E8SWHdc1qXKLtiS8G6ZxXQ1VQmMbKGqZtc4RP72yVUpF 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 kActiveGlob = "active_all_contracts" | |
7 | 7 | ||
8 | 8 | let kCause = "shutdown_cause" | |
9 | 9 | ||
10 | 10 | let kLastPoolTokenInterest = "_pool_last_interest" | |
11 | 11 | ||
12 | 12 | let kUserLastInterest = "_user_last_interest" | |
13 | 13 | ||
14 | 14 | let kUserClaimAvailable = "_user_available_to_claim" | |
15 | 15 | ||
16 | 16 | let kUserShareTokensLocked = "_share_tokens_locked" | |
17 | 17 | ||
18 | 18 | let kShareTokensLocked = "_total_share_tokens_locked" | |
19 | 19 | ||
20 | 20 | let kOraclePool = "pool_" | |
21 | 21 | ||
22 | 22 | let kPoolAssetIds = "asset_ids" | |
23 | 23 | ||
24 | 24 | let kAdminPubKey1 = "admin_pub_1" | |
25 | 25 | ||
26 | 26 | let kAdminPubKey2 = "admin_pub_2" | |
27 | 27 | ||
28 | 28 | let kAdminPubKey3 = "admin_pub_3" | |
29 | 29 | ||
30 | 30 | let kFarmingAddr = "farming_address" | |
31 | 31 | ||
32 | 32 | let kMoneyBoxAddress = "money_box_address" | |
33 | 33 | ||
34 | 34 | let scaleValue = 100000000 | |
35 | 35 | ||
36 | 36 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
37 | 37 | ||
38 | 38 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
39 | 39 | case string: String => | |
40 | 40 | fromBase58String(string) | |
41 | 41 | case nothing => | |
42 | 42 | throw((key + "is empty")) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
47 | 47 | ||
48 | 48 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
49 | 49 | ||
50 | 50 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
51 | 51 | ||
52 | 52 | let farmingAddr = Address(getBase58FromOracle(kFarmingAddr)) | |
53 | 53 | ||
54 | 54 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
55 | 55 | ||
56 | 56 | let active = valueOrElse(getBoolean(this, kActive), true) | |
57 | 57 | ||
58 | 58 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
59 | 59 | ||
60 | 60 | func isActive () = if (if (active) | |
61 | 61 | then activeGlob | |
62 | 62 | else false) | |
63 | 63 | then unit | |
64 | 64 | else throw("DApp is inactive at this moment") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func isPoolCall (caller) = if (isDefined(getString(oracle, (kOraclePool + toString(caller))))) | |
68 | 68 | then unit | |
69 | 69 | else throw("Only pool can call this function") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func isFarmingCall (caller) = if ((caller == farmingAddr)) | |
73 | 73 | then unit | |
74 | 74 | else throw("Only farming can call this function") | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func getUserShareTokensLocked (pool,userAddress) = valueOrElse(getInteger(farmingAddr, (((pool + "_") + userAddress) + kUserShareTokensLocked)), 0) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func getTotalShareTokensLocked (pool) = valueOrElse(getInteger(farmingAddr, (pool + kShareTokensLocked)), 0) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getUserLastInterest (user,pool,assetId) = valueOrElse(getInteger(this, (((((user + "_") + pool) + "_") + assetId) + kUserLastInterest)), 0) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func getPoolTokenLastInterest (pool,assetId) = valueOrElse(getInteger(this, (((pool + "_") + assetId) + kLastPoolTokenInterest)), 0) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func getUserClaimAvailable (user,pool,assetId) = valueOrElse(getInteger(this, (((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable)), 0) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getStrAssetId (assetId) = match assetId { | |
96 | 96 | case id: ByteVector => | |
97 | 97 | toBase58String(id) | |
98 | 98 | case waves: Unit => | |
99 | 99 | "WAVES" | |
100 | 100 | case _ => | |
101 | 101 | throw("Match error") | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func calcClaimAmount (pool,assetId,user) = { | |
106 | 106 | let lastInterest = getPoolTokenLastInterest(pool, assetId) | |
107 | 107 | let userLastInterest = getUserLastInterest(user, pool, assetId) | |
108 | 108 | let userShareTokensLocked = getUserShareTokensLocked(pool, user) | |
109 | 109 | let userClaimAvailable = getUserClaimAvailable(user, pool, assetId) | |
110 | 110 | let newUserClaimAvailable = fraction(userShareTokensLocked, (lastInterest - userLastInterest), scaleValue) | |
111 | 111 | $Tuple2((userClaimAvailable + newUserClaimAvailable), lastInterest) | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func calcClaimAmountEvaluate (pool,user) = { | |
116 | 116 | let poolAddr = Address(fromBase58String(pool)) | |
117 | 117 | let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",") | |
118 | 118 | func calcClaimAmounts (acc,assetId) = { | |
119 | 119 | let $t035663636 = calcClaimAmount(pool, assetId, user) | |
120 | 120 | let claimAmount = $t035663636._1 | |
121 | 121 | let lastInterest = $t035663636._2 | |
122 | 122 | (acc :+ [claimAmount]) | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | let claimAmounts = { | |
126 | 126 | let $l = assetIds | |
127 | 127 | let $s = size($l) | |
128 | 128 | let $acc0 = nil | |
129 | 129 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
130 | 130 | then $a | |
131 | 131 | else calcClaimAmounts($a, $l[$i]) | |
132 | 132 | ||
133 | 133 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
134 | 134 | then $a | |
135 | 135 | else throw("List size exceeds 15") | |
136 | 136 | ||
137 | 137 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
138 | 138 | } | |
139 | 139 | $Tuple2(assetIds, claimAmounts) | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | @Callable(i) | |
144 | 144 | func airDrop () = valueOrElse(isActive(), valueOrElse(isPoolCall(i.caller), { | |
145 | 145 | let $t038493924 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
146 | 146 | let pmtAmount = $t038493924._1 | |
147 | 147 | let pmtAssetId = $t038493924._2 | |
148 | 148 | let pool = toString(i.caller) | |
149 | 149 | let totalShareTokensLocked = getTotalShareTokensLocked(pool) | |
150 | 150 | if ((totalShareTokensLocked == 0)) | |
151 | 151 | then [ScriptTransfer(moneyBoxAddress, pmtAmount, pmtAssetId)] | |
152 | 152 | else { | |
153 | 153 | let lastInterest = getPoolTokenLastInterest(pool, getStrAssetId(pmtAssetId)) | |
154 | 154 | let interestNew = (lastInterest + (if ((pmtAmount > 0)) | |
155 | 155 | then fraction(pmtAmount, scaleValue, totalShareTokensLocked) | |
156 | 156 | else 0)) | |
157 | 157 | [IntegerEntry((((pool + "_") + getStrAssetId(pmtAssetId)) + kLastPoolTokenInterest), interestNew)] | |
158 | 158 | } | |
159 | 159 | })) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | ||
163 | 163 | @Callable(i) | |
164 | 164 | func updateUserInterest (user,pool,newUserShareTokensLocked) = valueOrElse(isActive(), valueOrElse(isFarmingCall(i.caller), { | |
165 | 165 | let poolAddr = Address(fromBase58String(pool)) | |
166 | 166 | let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",") | |
167 | 167 | func calcNewUserInterestAndClaimAmountEtries (acc,assetId) = { | |
168 | 168 | let $t048734943 = calcClaimAmount(pool, assetId, user) | |
169 | 169 | let claimAmount = $t048734943._1 | |
170 | 170 | let lastInterest = $t048734943._2 | |
171 | 171 | (acc ++ [IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable), claimAmount), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserLastInterest), lastInterest)]) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | let $l = assetIds | |
175 | 175 | let $s = size($l) | |
176 | 176 | let $acc0 = nil | |
177 | 177 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
178 | 178 | then $a | |
179 | 179 | else calcNewUserInterestAndClaimAmountEtries($a, $l[$i]) | |
180 | 180 | ||
181 | 181 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
182 | 182 | then $a | |
183 | 183 | else throw("List size exceeds 15") | |
184 | 184 | ||
185 | 185 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
186 | 186 | })) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | ||
190 | 190 | @Callable(i) | |
191 | 191 | func claim (pool) = valueOrElse(isActive(), { | |
192 | 192 | let poolAddr = Address(fromBase58String(pool)) | |
193 | 193 | let user = toString(i.caller) | |
194 | 194 | let assetIds = split(valueOrErrorMessage(getString(poolAddr, kPoolAssetIds), "Can't find pool assets"), ",") | |
195 | 195 | func calcClaimAmountEntries (acc,assetId) = { | |
196 | 196 | let $t055975621 = acc | |
197 | 197 | let entries = $t055975621._1 | |
198 | 198 | let sum = $t055975621._2 | |
199 | 199 | let $t056285698 = calcClaimAmount(pool, assetId, user) | |
200 | 200 | let claimAmount = $t056285698._1 | |
201 | 201 | let lastInterest = $t056285698._2 | |
202 | 202 | $Tuple2((entries ++ [ScriptTransfer(i.caller, claimAmount, fromBase58String(assetId)), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserClaimAvailable), 0), IntegerEntry((((((user + "_") + pool) + "_") + assetId) + kUserLastInterest), lastInterest)]), (sum + claimAmount)) | |
203 | 203 | } | |
204 | 204 | ||
205 | 205 | let $t060046087 = { | |
206 | 206 | let $l = assetIds | |
207 | 207 | let $s = size($l) | |
208 | 208 | let $acc0 = $Tuple2(nil, 0) | |
209 | 209 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
210 | 210 | then $a | |
211 | 211 | else calcClaimAmountEntries($a, $l[$i]) | |
212 | 212 | ||
213 | 213 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
214 | 214 | then $a | |
215 | 215 | else throw("List size exceeds 15") | |
216 | 216 | ||
217 | 217 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
218 | 218 | } | |
219 | 219 | let claimEntries = $t060046087._1 | |
220 | 220 | let sumTokens = $t060046087._2 | |
221 | 221 | if ((sumTokens == 0)) | |
222 | 222 | then throw("You have no tokens for claim") | |
223 | 223 | else claimEntries | |
224 | 224 | }) | |
225 | 225 | ||
226 | 226 | ||
227 | 227 | ||
228 | 228 | @Callable(i) | |
229 | 229 | func shutdown () = if (!(active)) | |
230 | 230 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
231 | 231 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
232 | 232 | then throw("Only admin can call this function") | |
233 | 233 | else suspend("Paused by admin") | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | ||
237 | 237 | @Callable(i) | |
238 | 238 | func activate () = if (active) | |
239 | 239 | then throw("DApp is already active") | |
240 | 240 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
241 | 241 | then throw("Only admin can call this function") | |
242 | 242 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)] | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | @Verifier(tx) | |
246 | 246 | func verify () = { | |
247 | 247 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
248 | 248 | then 1 | |
249 | 249 | else 0 | |
250 | 250 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
251 | 251 | then 1 | |
252 | 252 | else 0 | |
253 | 253 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
254 | 254 | then 1 | |
255 | 255 | else 0 | |
256 | 256 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
257 | 257 | } | |
258 | 258 |
github/deemru/w8io/169f3d6 41.34 ms ◑