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