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