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