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