tx · 3zcd8NjGwKzmxEWLmTCviH5FDTRENUyY5m2QcEzsJuSc

3N3p776xGyGW4r5qRhn5DpoxXknhMNW19AC:  -0.01400000 Waves

2022.09.01 14:57 [2210037] smart account 3N3p776xGyGW4r5qRhn5DpoxXknhMNW19AC > SELF 0.00000000 Waves

{ "type": 13, "id": "3zcd8NjGwKzmxEWLmTCviH5FDTRENUyY5m2QcEzsJuSc", "fee": 1400000, "feeAssetId": null, "timestamp": 1662033503778, "version": 2, "chainId": 84, "sender": "3N3p776xGyGW4r5qRhn5DpoxXknhMNW19AC", "senderPublicKey": "BW4Zgo6F96wYFS48DJrkLw58VnhBifbbRhEEc5swESG1", "proofs": [ "4rH2u78ZaxZWD6hzp4hdaZEwzaFcHWQGq6PmtyvXgbkDZ9DQjgdAdBgnMkbXvfcwZ15dZZ2zC135oNEboUAaKGd1" ], "script": "base64:AAIFAAAAAAAAADQIAhIDCgEIEgMKAQgSCAoGCAEEAQEBEgMKAQQSABIAEgASAwoBCBIGCgQICAEBEgQKAggIAAAAJAAAAAALa2V5TUFjY1BLZXkCAAAACW1hc3Rlcl9wawAAAAANa2V5QmFja3VwUEtleQIAAAAHYmFja19wawAAAAAId2Fyc1BLZXkCAAAAB3dhcnNfcGsBAAAABmdldFN0cgAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAAAAAADm1BY2NQS2V5U3RyaW5nCQEAAAAGZ2V0U3RyAAAAAQUAAAALa2V5TUFjY1BLZXkAAAAAEGJhY2t1cFBLZXlTdHJpbmcJAQAAAAZnZXRTdHIAAAABBQAAAA1rZXlCYWNrdXBQS2V5AQAAAAxnZXRCYWNrdXBLZXkAAAAAAwkAAAAAAAACBQAAABBiYWNrdXBQS2V5U3RyaW5nAgAAAAAIBQAAAAR0aGlzAAAABW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AIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAJAQAAAAxnZXRCYWNrdXBLZXkAAAAABAAAABBhbGxvd2VkQ29udHJhY3RzCQEAAAAHZ2V0U3RyQQAAAAIFAAAACG1BY2NBZGRyAgAAABFhbGxvd2VkX2NvbnRyYWN0cwQAAAAUYWxsb3dlZENvbnRyYWN0c0xpc3QJAAS1AAAAAgUAAAAQYWxsb3dlZENvbnRyYWN0cwIAAAABOwQAAAAKZGFwcFRvQ2FsbAkABCUAAAABCQAEJAAAAAEIBQAAAANpbnYAAAAEZEFwcAkBAAAAAiE9AAAAAgkABE8AAAACBQAAABRhbGxvd2VkQ29udHJhY3RzTGlzdAUAAAAKZGFwcFRvQ2FsbAUAAAAEdW5pdAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAnNzBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAIbUFjY1BLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF01hc3NUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAJtdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAACG1BY2NQS2V5B9lxDVg=", "height": 2210037, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
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 callUnstakeProxy (function,assetId) = if ((getBool(kLocked) == true))
294+ then throw("Contract is locked now")
295+ else if (if ((function != "unstakeNFT"))
296+ then (function != "unstakeJackpot")
297+ else false)
298+ then throw("Bad function name")
299+ else if ((i.caller != this))
300+ then throw("Can be called only by the account")
301+ else {
302+ let eggAssetId = getEggId()
303+ let shareAssetId = getShareAssetId()
304+ let farmingDappAddress = addressFromStringValue(getStrA(mAccAddr, "FARMING_DAPP"))
305+ let unstakedReward = invoke(farmingDappAddress, function, [assetId], nil)
306+ if ((unstakedReward == unstakedReward))
307+ then {
308+ let reward = match unstakedReward {
309+ case int: Int =>
310+ int
311+ case _ =>
312+ throw("Error during unstaking")
313+ }
314+ let currentCeoFee = getInt(kCeoCollectedFee)
315+ let ceoFeeOverall = getInt(kCeoCollectedFeeOverall)
316+ let farmCeoFeeSize = fraction(reward, feePercent, 100)
317+ let amountToPay = (reward - farmCeoFeeSize)
318+ let topUp = invoke(stakingAddress, "topUpReward", nil, [AttachedPayment(eggAssetId, amountToPay)])
319+ if ((topUp == topUp))
320+ then [IntegerEntry(kCeoCollectedFee, (currentCeoFee + farmCeoFeeSize)), IntegerEntry(kCeoCollectedFeeOverall, (ceoFeeOverall + farmCeoFeeSize))]
321+ else throw("Strict value is not equal to itself.")
322+ }
323+ else throw("Strict value is not equal to itself.")
324+ }
325+
326+
327+@Verifier(tx)
328+func verify () = {
329+ let checkStarted = (getInt(kTotalLiquidity) >= getInt(kLiquidityThreshold))
330+ match tx {
331+ case inv: InvokeScriptTransaction =>
332+ let acceptedCallsStaking = ["stakeFarmTokens", "claimReward", "withdrawFarmTokens"]
333+ let acceptedCallsThis = ["callUnstakeProxy", "claimCeoFee", "lockInvestments", "unlockInvestments"]
334+ if (if ((inv.function == "unstakeNFT"))
335+ then true
336+ else (inv.function == "unstakeJackpot"))
337+ then throw("You cannot call these functions directly")
338+ else if (if (if ((addressFromRecipient(inv.dApp) == this))
339+ then (inv.function == "initMasterKey")
340+ else false)
341+ then (mAccPKeyString == "")
342+ else false)
343+ then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
344+ then true
345+ else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey())
346+ else if (if ((sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) == false))
347+ then (sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey()) == false)
348+ else false)
349+ then throw("_100")
350+ else if ((checkStarted == false))
351+ then throw("_14")
352+ else if ((getBool(kLocked) == true))
353+ then throw("_22")
354+ else if (if ((inv.fee > 900000))
355+ then true
356+ else (inv.feeAssetId != unit))
357+ then throw("_15")
358+ else if ((size(inv.payments) > 2))
359+ then throw("_17")
360+ else if (if ((addressFromRecipient(inv.dApp) == this))
361+ then containsElement(acceptedCallsThis, inv.function)
362+ else false)
363+ then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
364+ then true
365+ else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey())
366+ else if (if ((addressFromRecipient(inv.dApp) == addressFromStringValue(getMarketProxyAddr())))
367+ then (inv.function == "callMarketplaceProxy")
368+ else false)
369+ then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
370+ then true
371+ else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey())
372+ else if (if ((addressFromRecipient(inv.dApp) == stakingAddress))
373+ then containsElement(acceptedCallsStaking, inv.function)
374+ else false)
375+ then if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
376+ then true
377+ else sigVerify(tx.bodyBytes, tx.proofs[0], getBackupKey())
378+ else {
379+ let allowedContracts = getStrA(mAccAddr, "allowed_contracts")
380+ let allowedContractsList = split(allowedContracts, ";")
381+ let dappToCall = toString(addressFromRecipient(inv.dApp))
382+ (indexOf(allowedContractsList, dappToCall) != unit)
383+ }
384+ case ss: SetScriptTransaction =>
385+ sigVerify(tx.bodyBytes, tx.proofs[0], mAccPKey)
386+ case mt: MassTransferTransaction =>
387+ sigVerify(tx.bodyBytes, tx.proofs[0], mAccPKey)
388+ case _ =>
389+ false
390+ }
391+ }
392+

github/deemru/w8io/026f985 
34.44 ms