tx · 4Y4pbNTA7S9ZkiRQ5uYDpajopGB6kXz49JJ3TzEEo5R9 3N8PT8X9HywhobWuWCSw5PiNwmz1g4DXvZq: -0.01400000 Waves 2022.08.30 14:25 [2207120] smart account 3N8PT8X9HywhobWuWCSw5PiNwmz1g4DXvZq > SELF 0.00000000 Waves
{ "type": 13, "id": "4Y4pbNTA7S9ZkiRQ5uYDpajopGB6kXz49JJ3TzEEo5R9", "fee": 1400000, "feeAssetId": null, "timestamp": 1661858736778, "version": 2, "chainId": 84, "sender": "3N8PT8X9HywhobWuWCSw5PiNwmz1g4DXvZq", "senderPublicKey": "9X4in3RBnBhhjBJ9M4BNQCJMCk1twJGb3H8i95tvQT3s", "proofs": [ "3nFn9FXDFkcBDrkDdQQethzNiAi872ZegDZJPEhEe62bd1HBUhnizDHHXCJptKbUJXaneVbFz3ammtsJQ7aFkvSq" ], "script": "base64:AAIFAAAAAAAAAD4IAhIDCgEIEgMKAQgSCAoGCAEEAQEBEgMKAQQSABIAEgASAwoBCBIGCgQICAEBEgMKAQgSAwoBCBIECgIICAAAACQAAAAAC2tleU1BY2NQS2V5AgAAAAltYXN0ZXJfcGsAAAAADWtleUJhY2t1cFBLZXkCAAAAB2JhY2tfcGsAAAAACHdhcnNQS2V5AgAAAAd3YXJzX3BrAQAAAAZnZXRTdHIAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAAAAAA5tQWNjUEtleVN0cmluZwkBAAAABmdldFN0cgAAAAEFAAAAC2tleU1BY2NQS2V5AAAAABBiYWNrdXBQS2V5U3RyaW5nCQEAAAAGZ2V0U3RyAAAAAQUAAAANa2V5QmFja3VwUEtleQEAAAAMZ2V0QmFja3VwS2V5AAAAAAMJAAAAAAAAAgUAAAAQYmFja3VwUEtleVN0cmluZwIAAAAACAUAAAAE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MAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkBAAAADGdldEJhY2t1cEtleQAAAAAEAAAAEGFsbG93ZWRDb250cmFjdHMJAQAAAAdnZXRTdHJBAAAAAgUAAAAIbUFjY0FkZHICAAAAEWFsbG93ZWRfY29udHJhY3RzBAAAABRhbGxvd2VkQ29udHJhY3RzTGlzdAkABLUAAAACBQAAABBhbGxvd2VkQ29udHJhY3RzAgAAAAE7BAAAAApkYXBwVG9DYWxsCQAEJQAAAAEJAAQkAAAAAQgFAAAAA2ludgAAAARkQXBwCQEAAAACIT0AAAACCQAETwAAAAIFAAAAFGFsbG93ZWRDb250cmFjdHNMaXN0BQAAAApkYXBwVG9DYWxsBQAAAAR1bml0AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAACc3MFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAhtQWNjUEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXTWFzc1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAm10BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAIbUFjY1BLZXkHXIF7Pw==", "height": 2207120, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let keyMAccPKey = "master_pk" | |
5 | + | ||
6 | + | let keyBackupPKey = "back_pk" | |
7 | + | ||
8 | + | let warsPKey = "wars_pk" | |
9 | + | ||
10 | + | func getStr (key) = match getString(this, key) { | |
11 | + | case b: String => | |
12 | + | b | |
13 | + | case _ => | |
14 | + | "" | |
15 | + | } | |
16 | + | ||
17 | + | ||
18 | + | let mAccPKeyString = getStr(keyMAccPKey) | |
19 | + | ||
20 | + | let backupPKeyString = getStr(keyBackupPKey) | |
21 | + | ||
22 | + | func getBackupKey () = if ((backupPKeyString == "")) | |
23 | + | then this.bytes | |
24 | + | else fromBase58String(backupPKeyString) | |
25 | + | ||
26 | + | ||
27 | + | let mAccPKey = fromBase58String(mAccPKeyString) | |
28 | + | ||
29 | + | let mAccAddr = addressFromPublicKey(mAccPKey) | |
30 | + | ||
31 | + | let feePercent = getIntegerValue(mAccAddr, (("f_" + toString(this)) + "_fee")) | |
32 | + | ||
33 | + | let stakingAddress = addressFromStringValue(valueOrErrorMessage(getString(mAccAddr, (("f_" + toString(this)) + "_stake_address")), (("f_" + toString(this)) + "_stake_address not defined"))) | |
34 | + | ||
35 | + | let wAccPKey = fromBase58String(valueOrErrorMessage(getString(mAccAddr, warsPKey), (warsPKey + " not defined"))) | |
36 | + | ||
37 | + | let kTotalLiquidity = "total_liquidity" | |
38 | + | ||
39 | + | let kInitialized = "INITIALIZED" | |
40 | + | ||
41 | + | let kLiquidityThreshold = "LIQUIDITY_THRESHOLD" | |
42 | + | ||
43 | + | let kTotalFarmingReward = "total_farming_reward" | |
44 | + | ||
45 | + | let kShareAssetId = "SHARE_ASSET_ID" | |
46 | + | ||
47 | + | let kIncubatorDapp = "INCUBATOR_DAPP" | |
48 | + | ||
49 | + | let kBreederDapp = "BREEDER_DAPP" | |
50 | + | ||
51 | + | let kFarmingDapp = "FARMING_DAPP" | |
52 | + | ||
53 | + | let kMarketProxyDapp = "MARKETPLACE_PROXY_DAPP" | |
54 | + | ||
55 | + | let kAuctionDapp = "AUCTION_DAPP" | |
56 | + | ||
57 | + | let kLocked = "LOCKED" | |
58 | + | ||
59 | + | let kCeoCollectedFee = "ceo_collected_fee" | |
60 | + | ||
61 | + | let kCeoCollectedFeeOverall = "ceo_fee_overall" | |
62 | + | ||
63 | + | let kLockedInvestments = "locked_investments" | |
64 | + | ||
65 | + | let keyTotalCompound = "total_compound" | |
66 | + | ||
67 | + | let keyGlobalStaked = "global_staked" | |
68 | + | ||
69 | + | func getInt (key) = match getInteger(this, key) { | |
70 | + | case b: Int => | |
71 | + | b | |
72 | + | case _ => | |
73 | + | 0 | |
74 | + | } | |
75 | + | ||
76 | + | ||
77 | + | func getBool (key) = match getBoolean(this, key) { | |
78 | + | case b: Boolean => | |
79 | + | b | |
80 | + | case _ => | |
81 | + | unit | |
82 | + | } | |
83 | + | ||
84 | + | ||
85 | + | func getStrA (a,k) = match getString(a, k) { | |
86 | + | case b: String => | |
87 | + | b | |
88 | + | case _ => | |
89 | + | "" | |
90 | + | } | |
91 | + | ||
92 | + | ||
93 | + | func getIntA (address,key) = match getInteger(address, key) { | |
94 | + | case b: Int => | |
95 | + | b | |
96 | + | case _ => | |
97 | + | 0 | |
98 | + | } | |
99 | + | ||
100 | + | ||
101 | + | func getMarketProxyAddr () = getStrA(mAccAddr, kMarketProxyDapp) | |
102 | + | ||
103 | + | ||
104 | + | func getEggId () = fromBase58String(getStringValue(mAccAddr, "EGG_ASSET_ID")) | |
105 | + | ||
106 | + | ||
107 | + | func getShareAssetId () = fromBase58String(getStr(kShareAssetId)) | |
108 | + | ||
109 | + | ||
110 | + | func asInt (value) = match value { | |
111 | + | case int: Int => | |
112 | + | int | |
113 | + | case _ => | |
114 | + | throw("wrong type, expected: Int") | |
115 | + | } | |
116 | + | ||
117 | + | ||
118 | + | @Callable(i) | |
119 | + | func initMasterKey (publicKey) = if ((i.caller != this)) | |
120 | + | then throw("You cannot do this action") | |
121 | + | else if ((mAccPKeyString != "")) | |
122 | + | then throw("Master public key already set, you can't override!") | |
123 | + | else [StringEntry(keyMAccPKey, publicKey)] | |
124 | + | ||
125 | + | ||
126 | + | ||
127 | + | @Callable(i) | |
128 | + | func initBackupKey (publicKey) = if ((i.caller != addressFromPublicKey(mAccPKey))) | |
129 | + | then throw("You cannot do this action") | |
130 | + | else [StringEntry(keyBackupPKey, publicKey)] | |
131 | + | ||
132 | + | ||
133 | + | ||
134 | + | @Callable(i) | |
135 | + | func initCollectiveFarm (name,minimumThreshold,migration,totalFarmingReward,totalLiquidity,totalFarmToken) = if ((mAccPKeyString == "")) | |
136 | + | then throw("First initiatie a master public key!") | |
137 | + | else if ((i.callerPublicKey != mAccPKey)) | |
138 | + | then throw("_1") | |
139 | + | else if ((getBool(kInitialized) != unit)) | |
140 | + | then throw("_2") | |
141 | + | else if (if ((migration == false)) | |
142 | + | then if ((i.payments[0].amount != 10000000)) | |
143 | + | then true | |
144 | + | else (i.payments[0].assetId != getEggId()) | |
145 | + | else false) | |
146 | + | then throw("_20") | |
147 | + | else { | |
148 | + | let shareTokens = if (migration) | |
149 | + | then totalFarmToken | |
150 | + | else 10000000 | |
151 | + | let shareToken = Issue(name, (("Team token for the \"" + name) + "\" collective farm"), shareTokens, 8, true) | |
152 | + | let totLiquidity = if (migration) | |
153 | + | then totalLiquidity | |
154 | + | else 10000000 | |
155 | + | let totFarmingReward = if (migration) | |
156 | + | then [IntegerEntry(kTotalFarmingReward, totalFarmingReward)] | |
157 | + | else nil | |
158 | + | ([StringEntry(kShareAssetId, toBase58String(calculateAssetId(shareToken))), BooleanEntry(kInitialized, true), IntegerEntry(kTotalLiquidity, totLiquidity), shareToken, ScriptTransfer(i.caller, shareTokens, calculateAssetId(shareToken)), BooleanEntry(kLocked, false), IntegerEntry(kLiquidityThreshold, minimumThreshold)] ++ totFarmingReward) | |
159 | + | } | |
160 | + | ||
161 | + | ||
162 | + | ||
163 | + | @Callable(i) | |
164 | + | func setLock (s) = if ((i.callerPublicKey != mAccPKey)) | |
165 | + | then throw("_21") | |
166 | + | else [BooleanEntry(kLocked, s)] | |
167 | + | ||
168 | + | ||
169 | + | ||
170 | + | @Callable(i) | |
171 | + | func lockInvestments () = if ((i.caller != this)) | |
172 | + | then throw("You cannot lock this contract") | |
173 | + | else [BooleanEntry(kLockedInvestments, true)] | |
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | @Callable(i) | |
178 | + | func unlockInvestments () = if ((i.caller != this)) | |
179 | + | then throw("You cannot lock this contract") | |
180 | + | else [BooleanEntry(kLockedInvestments, false)] | |
181 | + | ||
182 | + | ||
183 | + | ||
184 | + | @Callable(i) | |
185 | + | func provideLiquidity () = { | |
186 | + | let eggAssetId = getEggId() | |
187 | + | if (if (if ((i.callerPublicKey != wAccPKey)) | |
188 | + | then (i.callerPublicKey != mAccPKey) | |
189 | + | else false) | |
190 | + | then (getBool(kLockedInvestments) == true) | |
191 | + | else false) | |
192 | + | then throw("Contract is locked for investments by it's CEO. Please invest in another collective farm.") | |
193 | + | else if ((getBool(kLocked) == true)) | |
194 | + | then throw("_22") | |
195 | + | else if ((i.payments[0].assetId != eggAssetId)) | |
196 | + | then throw("_4") | |
197 | + | else if ((1000000 > i.payments[0].amount)) | |
198 | + | then throw("Min amount to invest is 0.01 EGG") | |
199 | + | else { | |
200 | + | let totalLiquidity = getInt(kTotalLiquidity) | |
201 | + | let shareTokensToGive = i.payments[0].amount | |
202 | + | let shareTokensId = fromBase58String(getStr(kShareAssetId)) | |
203 | + | let reissue = Reissue(getShareAssetId(), shareTokensToGive, true) | |
204 | + | let kParticipated = (("account_" + toString(i.caller)) + "_participated") | |
205 | + | let alreadyParticipated = getBool(kParticipated) | |
206 | + | $Tuple2([reissue, ScriptTransfer(i.caller, shareTokensToGive, shareTokensId), IntegerEntry(kTotalLiquidity, (totalLiquidity + value(i.payments[0].amount))), BooleanEntry(kParticipated, true)], shareTokensToGive) | |
207 | + | } | |
208 | + | } | |
209 | + | ||
210 | + | ||
211 | + | ||
212 | + | @Callable(i) | |
213 | + | func claimFarmingRewardProxy (ids) = if ((i.callerPublicKey != mAccPKey)) | |
214 | + | then throw("_23") | |
215 | + | else { | |
216 | + | let eggAssetId = getEggId() | |
217 | + | let shareAssetId = getShareAssetId() | |
218 | + | let farmingDapp = addressFromStringValue(getStrA(mAccAddr, kFarmingDapp)) | |
219 | + | func claimReward (accum,nftId) = { | |
220 | + | let invRes = invoke(farmingDapp, "claimReward", [nftId], nil) | |
221 | + | if ((invRes == invRes)) | |
222 | + | then match invRes { | |
223 | + | case int: Int => | |
224 | + | (accum + int) | |
225 | + | case _ => | |
226 | + | throw("_5") | |
227 | + | } | |
228 | + | else throw("Strict value is not equal to itself.") | |
229 | + | } | |
230 | + | ||
231 | + | let nftIds = split(ids, ";") | |
232 | + | let foldResult = { | |
233 | + | let $l = nftIds | |
234 | + | let $s = size($l) | |
235 | + | let $acc0 = 0 | |
236 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
237 | + | then $a | |
238 | + | else claimReward($a, $l[$i]) | |
239 | + | ||
240 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
241 | + | then $a | |
242 | + | else throw("List size exceeds 10") | |
243 | + | ||
244 | + | $f0_2($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) | |
245 | + | } | |
246 | + | let claimedReward = match foldResult { | |
247 | + | case int: Int => | |
248 | + | int | |
249 | + | case _ => | |
250 | + | throw("_6") | |
251 | + | } | |
252 | + | let totalFarmingReward = getInt(kTotalFarmingReward) | |
253 | + | let farmCeoFeeSize = fraction(claimedReward, feePercent, 100) | |
254 | + | let currentCeoFee = getInt(kCeoCollectedFee) | |
255 | + | let ceoFeeOverall = getInt(kCeoCollectedFeeOverall) | |
256 | + | let amountToPay = (claimedReward - farmCeoFeeSize) | |
257 | + | let topUp = invoke(stakingAddress, "topUpReward", nil, [AttachedPayment(eggAssetId, amountToPay)]) | |
258 | + | if ((topUp == topUp)) | |
259 | + | then [IntegerEntry(kTotalFarmingReward, (totalFarmingReward + amountToPay)), IntegerEntry(kCeoCollectedFee, (currentCeoFee + farmCeoFeeSize)), IntegerEntry(kCeoCollectedFeeOverall, (ceoFeeOverall + farmCeoFeeSize))] | |
260 | + | else throw("Strict value is not equal to itself.") | |
261 | + | } | |
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | @Callable(i) | |
266 | + | func claimCeoFee (address1,address2,address1Share,address2Share) = if ((0 > address1Share)) | |
267 | + | then throw("Share 1 can't be negative") | |
268 | + | else if ((0 > address2Share)) | |
269 | + | then throw("Share 2 can't be negative") | |
270 | + | else if (((address1Share + address2Share) != 100)) | |
271 | + | then throw("Sum of shares should be 100") | |
272 | + | else if ((getBool(kLocked) == true)) | |
273 | + | then throw("_22") | |
274 | + | else if ((i.caller == this)) | |
275 | + | then { | |
276 | + | let currentCeoCollectedFee = getInt(kCeoCollectedFee) | |
277 | + | let address1Reward = if ((address2 == "")) | |
278 | + | then currentCeoCollectedFee | |
279 | + | else fraction(currentCeoCollectedFee, address1Share, 100) | |
280 | + | let address2Reward = if ((address2 == "")) | |
281 | + | then 0 | |
282 | + | else fraction(currentCeoCollectedFee, address2Share, 100) | |
283 | + | let scriptTransferAddress2 = if ((address2 == "")) | |
284 | + | then nil | |
285 | + | else [ScriptTransfer(addressFromStringValue(address2), address2Reward, getEggId())] | |
286 | + | (scriptTransferAddress2 ++ [ScriptTransfer(addressFromStringValue(address1), address1Reward, getEggId()), IntegerEntry(kCeoCollectedFee, 0)]) | |
287 | + | } | |
288 | + | else throw("Only manager can call the contract") | |
289 | + | ||
290 | + | ||
291 | + | ||
292 | + | @Callable(i) | |
293 | + | func startLiquidation (auctionId) = throw("_7") | |
294 | + | ||
295 | + | ||
296 | + | ||
297 | + | @Callable(i) | |
298 | + | func voteForLiquidation (auctionId) = throw("_7") | |
299 | + | ||
300 | + | ||
301 | + | ||
302 | + | @Callable(i) | |
303 | + | func callUnstakeProxy (function,assetId) = if ((getBool(kLocked) == true)) | |
304 | + | then throw("Contract is locked now") | |
305 | + | else if (if ((function != "unstakeNFT")) | |
306 | + | then (function != "unstakeJackpot") | |
307 | + | else false) | |
308 | + | then throw("Bad function name") | |
309 | + | else if ((i.caller != this)) | |
310 | + | then throw("Can be called only by the account") | |
311 | + | else { | |
312 | + | let eggAssetId = getEggId() | |
313 | + | let shareAssetId = getShareAssetId() | |
314 | + | let farmingDappAddress = addressFromStringValue(getStrA(mAccAddr, "FARMING_DAPP")) | |
315 | + | let unstakedReward = invoke(farmingDappAddress, function, [assetId], nil) | |
316 | + | if ((unstakedReward == unstakedReward)) | |
317 | + | then { | |
318 | + | let reward = match unstakedReward { | |
319 | + | case int: Int => | |
320 | + | int | |
321 | + | case _ => | |
322 | + | throw("Error during unstaking") | |
323 | + | } | |
324 | + | let currentCeoFee = getInt(kCeoCollectedFee) | |
325 | + | let ceoFeeOverall = getInt(kCeoCollectedFeeOverall) | |
326 | + | let farmCeoFeeSize = fraction(reward, feePercent, 100) | |
327 | + | let amountToPay = (reward - farmCeoFeeSize) | |
328 | + | let topUp = invoke(stakingAddress, "topUpReward", nil, [AttachedPayment(eggAssetId, amountToPay)]) | |
329 | + | if ((topUp == topUp)) | |
330 | + | then [IntegerEntry(kCeoCollectedFee, (currentCeoFee + farmCeoFeeSize)), IntegerEntry(kCeoCollectedFeeOverall, (ceoFeeOverall + farmCeoFeeSize))] | |
331 | + | else throw("Strict value is not equal to itself.") | |
332 | + | } | |
333 | + | else throw("Strict value is not equal to itself.") | |
334 | + | } | |
335 | + | ||
336 | + | ||
337 | + | @Verifier(tx) | |
338 | + | func verify () = { | |
339 | + | let checkStarted = (getInt(kTotalLiquidity) >= getInt(kLiquidityThreshold)) | |
340 | + | match tx { | |
341 | + | case inv: InvokeScriptTransaction => | |
342 | + | let acceptedCallsStaking = ["stakeFarmTokens", "claimReward", "withdrawFarmTokens"] | |
343 | + | let acceptedCallsThis = ["callUnstakeProxy", "claimCeoFee", "lockInvestments", "unlockInvestments"] | |
344 | + | if (if ((inv.function == "unstakeNFT")) | |
345 | + | then true | |
346 | + | else (inv.function == "unstakeJackpot")) | |
347 | + | then throw("You cannot call these functions directly") | |
348 | + | else if (if (if ((addressFromRecipient(inv.dApp) == this)) | |
349 | + | then (inv.function == "initMasterKey") | |
350 | + | else false) | |
351 | + | then (mAccPKeyString == "") | |
352 | + | else false) | |
353 | + | then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
354 | + | then true | |
355 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey()) | |
356 | + | else if (if ((sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) == false)) | |
357 | + | then (sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey()) == false) | |
358 | + | else false) | |
359 | + | then throw("_100") | |
360 | + | else if ((checkStarted == false)) | |
361 | + | then throw("_14") | |
362 | + | else if ((getBool(kLocked) == true)) | |
363 | + | then throw("_22") | |
364 | + | else if (if ((inv.fee > 900000)) | |
365 | + | then true | |
366 | + | else (inv.feeAssetId != unit)) | |
367 | + | then throw("_15") | |
368 | + | else if ((size(inv.payments) > 2)) | |
369 | + | then throw("_17") | |
370 | + | else if (if ((addressFromRecipient(inv.dApp) == this)) | |
371 | + | then containsElement(acceptedCallsThis, inv.function) | |
372 | + | else false) | |
373 | + | then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
374 | + | then true | |
375 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey()) | |
376 | + | else if (if ((addressFromRecipient(inv.dApp) == addressFromStringValue(getMarketProxyAddr()))) | |
377 | + | then (inv.function == "callMarketplaceProxy") | |
378 | + | else false) | |
379 | + | then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
380 | + | then true | |
381 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey()) | |
382 | + | else if (if ((addressFromRecipient(inv.dApp) == stakingAddress)) | |
383 | + | then containsElement(acceptedCallsStaking, inv.function) | |
384 | + | else false) | |
385 | + | then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
386 | + | then true | |
387 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey()) | |
388 | + | else { | |
389 | + | let allowedContracts = getStrA(mAccAddr, "allowed_contracts") | |
390 | + | let allowedContractsList = split(allowedContracts, ";") | |
391 | + | let dappToCall = toString(addressFromRecipient(inv.dApp)) | |
392 | + | (indexOf(allowedContractsList, dappToCall) != unit) | |
393 | + | } | |
394 | + | case ss: SetScriptTransaction => | |
395 | + | sigVerify(tx.bodyBytes, tx.proofs[0], mAccPKey) | |
396 | + | case mt: MassTransferTransaction => | |
397 | + | sigVerify(tx.bodyBytes, tx.proofs[0], mAccPKey) | |
398 | + | case _ => | |
399 | + | false | |
400 | + | } | |
401 | + | } | |
402 | + |
github/deemru/w8io/026f985 25.24 ms ◑