tx · 3L5aT6zqdLnP21rFdafkqwtvnrymD7e1VuEydz19yGrF

3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH:  -0.01000000 Waves

2022.05.26 09:19 [2068282] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves

{ "type": 13, "id": "3L5aT6zqdLnP21rFdafkqwtvnrymD7e1VuEydz19yGrF", "fee": 1000000, "feeAssetId": null, "timestamp": 1653545969826, "version": 1, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "57MsG6n4JjRjfKSL7fj2SS4bTBoXiZkuKbMDwYQtdutK66GTcJ462rAXwfYNrsG9SCo888cubrDWi7rTPVmtRuhy" ], "script": null, "chainId": 84, "height": 2068282, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9kEbmU3Z5Ux2swNrSYp1ghRvt2TLyo74NTqvFBLU6K61 Next: none Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let token = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS'
5-
6-let lpTCI = base58'zMoz8KokhTvMU6GosBdAHrWfg8aCWSpP1nBigwwi63D'
7-
8-let dapp = base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'
9-
10-let isStopped = false
11-
12-let keyStaked = "STAKED_LP"
13-
14-let keyCompound = "From_Compound"
15-
16-@Callable(i)
17-func stake () = {
18- let pmt = value(i.payments[0])
19- let pmtAmount = pmt.amount
20- if ((pmt.assetId != token))
21- then throw("attach USDTUSDNLP tokens only")
22- else if (isStopped)
23- then throw("smart contract is on lock")
24- else {
25- let tkStaked = valueOrElse(getInteger(this, keyStaked), 0)
26- if ((tkStaked == tkStaked))
27- then {
28- let updateState = IntegerEntry(keyStaked, (tkStaked + i.payments[0].amount))
29- if ((updateState == updateState))
30- then if ((updateState == updateState))
31- then {
32- let totalIssued = match assetInfo(lpTCI) {
33- case asset: Asset =>
34- asset.quantity
35- case _ =>
36- throw("Can't find asset")
37- }
38- let treasury = (((tkStaked + assetBalance(this, token)) + pmtAmount) - pmtAmount)
39- let forOne = fraction(totalIssued, 100000000, treasury)
40- let toIssue = fraction(pmtAmount, forOne, 100000000)
41- let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
42- if ((LPstake == LPstake))
43- then {
44- let LPIssue = Reissue(lpTCI, toIssue, true)
45- let transfer = ScriptTransfer(i.caller, toIssue, lpTCI)
46-[LPIssue, transfer]
47- }
48- else throw("Strict value is not equal to itself.")
49- }
50- else throw("Strict value is not equal to itself.")
51- else throw("Strict value is not equal to itself.")
52- }
53- else throw("Strict value is not equal to itself.")
54- }
55- }
56-
57-
58-
59-@Callable(i)
60-func compound () = {
61- let compound = value(i.payments[0])
62- let compoundAmount = compound.amount
63- if ((compound.assetId != token))
64- then throw("attach USDTUSDNLP tokens only")
65- else {
66- let fromCompound = valueOrElse(getInteger(this, keyCompound), 0)
67- let totalStaked = valueOrElse(getInteger(this, keyStaked), 0)
68- let updateState = IntegerEntry(keyStaked, (totalStaked + i.payments[0].amount))
69- if ((updateState == updateState))
70- then {
71- let totalOfCompound = IntegerEntry(keyCompound, (fromCompound + compoundAmount))
72- if ((totalOfCompound == totalOfCompound))
73- then [updateState, totalOfCompound]
74- else throw("Strict value is not equal to itself.")
75- }
76- else throw("Strict value is not equal to itself.")
77- }
78- }
79-
80-
1+# no script

github/deemru/w8io/169f3d6 
53.78 ms