tx · Hk95xLQUaPgTFdGPdg1pZnujAirfrhq19rRbgpcETUTe

3N9E2aUbiyf6wn4bSqyATFBEQFUKYy9datz:  -0.01000000 Waves

2022.05.16 12:31 [2054046] smart account 3N9E2aUbiyf6wn4bSqyATFBEQFUKYy9datz > SELF 0.00000000 Waves

{ "type": 13, "id": "Hk95xLQUaPgTFdGPdg1pZnujAirfrhq19rRbgpcETUTe", "fee": 1000000, "feeAssetId": null, "timestamp": 1652693520713, "version": 2, "chainId": 84, "sender": "3N9E2aUbiyf6wn4bSqyATFBEQFUKYy9datz", "senderPublicKey": "4RUVreqGaYfi1yVRnNWAip2edczRrUTTiiZwKnd4YD3u", "proofs": [ "4NBwDAzzGetQoBAqtbGBzd8aS7Xks2ZUe6rxngn6rCizpYgqUsgdhawuXSCBweDKxQ4vAA5wHZgT1TppdRdyCLEx" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAGAAAAAAV0b2tlbgEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAABWxwVENJAQAAACAOsaLbFoDp18KsM3EhDM01PSoVCLVgs2ksT7H2wwTB/AAAAAAEZGFwcAEAAAAaAVRZQCeTa0sp7r6xoQ7m3EC4z6SNegzrtQ8AAAAACWlzU3RvcHBlZAcAAAAACWtleVN0YWtlZAIAAAAJU1RBS0VEX0xQAAAAAAtrZXlDb21wb3VuZAIAAAANRnJvbV9Db21wb3VuZAAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABXRva2VuCQAAAgAAAAECAAAAHWF0dGFjaCBVU0RUVVNETkxQIHRva2VucyBvbmx5AwUAAAAJaXNTdG9wcGVkCQAAAgAAAAECAAA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BkYXRlU3RhdGUEAAAAD3RvdGFsT2ZDb21wb3VuZAkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAC2tleUNvbXBvdW5kCQAAZAAAAAIFAAAADGZyb21Db21wb3VuZAUAAAAOY29tcG91bmRBbW91bnQDCQAAAAAAAAIFAAAAD3RvdGFsT2ZDb21wb3VuZAUAAAAPdG90YWxPZkNvbXBvdW5kCQAETAAAAAIFAAAAC3VwZGF0ZVN0YXRlCQAETAAAAAIFAAAAD3RvdGFsT2ZDb21wb3VuZAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAA3V2+SA==", "height": 2054046, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AXwdzPFWbf7tszCotwXpZTWh8cDFvL1Q9qmkwrhbWgA4 Next: AJ2RbB2imfCgnZujSaUSrrTYhpi1Du11FEnrCWH77wyu Diff:
OldNewDifferences
5959 else {
6060 let fromCompound = valueOrElse(getInteger(this, keyCompound), 0)
6161 let totalStaked = valueOrElse(getInteger(this, keyStaked), 0)
62- let updateState = IntegerEntry(keyStaked, (totalStaked + fromCompound))
62+ let updateState = IntegerEntry(keyStaked, (totalStaked + i.payments[0].amount))
6363 if ((updateState == updateState))
6464 then {
6565 let totalOfCompound = IntegerEntry(keyCompound, (fromCompound + compoundAmount))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let token = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS'
55
66 let lpTCI = base58'zMoz8KokhTvMU6GosBdAHrWfg8aCWSpP1nBigwwi63D'
77
88 let dapp = base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'
99
1010 let isStopped = false
1111
1212 let keyStaked = "STAKED_LP"
1313
1414 let keyCompound = "From_Compound"
1515
1616 @Callable(i)
1717 func stake () = {
1818 let pmt = value(i.payments[0])
1919 let pmtAmount = pmt.amount
2020 if ((pmt.assetId != token))
2121 then throw("attach USDTUSDNLP tokens only")
2222 else if (isStopped)
2323 then throw("smart contract is on lock")
2424 else {
2525 let tkStaked = valueOrElse(getInteger(this, keyStaked), 0)
2626 let updateState = IntegerEntry(keyStaked, (tkStaked + i.payments[0].amount))
2727 if ((updateState == updateState))
2828 then {
2929 let totalIssued = match assetInfo(lpTCI) {
3030 case asset: Asset =>
3131 asset.quantity
3232 case _ =>
3333 throw("Can't find asset")
3434 }
3535 let treasury = (((tkStaked + assetBalance(this, token)) + pmtAmount) - pmtAmount)
3636 let forOne = fraction(totalIssued, 100000000, treasury)
3737 let toIssue = fraction(pmtAmount, forOne, 100000000)
3838 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
3939 if ((LPstake == LPstake))
4040 then {
4141 let LPIssue = Reissue(lpTCI, toIssue, true)
4242 let transfer = ScriptTransfer(i.caller, toIssue, lpTCI)
4343 [LPIssue, transfer, updateState]
4444 }
4545 else throw("Strict value is not equal to itself.")
4646 }
4747 else throw("Strict value is not equal to itself.")
4848 }
4949 }
5050
5151
5252
5353 @Callable(i)
5454 func compound () = {
5555 let compound = value(i.payments[0])
5656 let compoundAmount = compound.amount
5757 if ((compound.assetId != token))
5858 then throw("attach USDTUSDNLP tokens only")
5959 else {
6060 let fromCompound = valueOrElse(getInteger(this, keyCompound), 0)
6161 let totalStaked = valueOrElse(getInteger(this, keyStaked), 0)
62- let updateState = IntegerEntry(keyStaked, (totalStaked + fromCompound))
62+ let updateState = IntegerEntry(keyStaked, (totalStaked + i.payments[0].amount))
6363 if ((updateState == updateState))
6464 then {
6565 let totalOfCompound = IntegerEntry(keyCompound, (fromCompound + compoundAmount))
6666 if ((totalOfCompound == totalOfCompound))
6767 then [updateState, totalOfCompound]
6868 else throw("Strict value is not equal to itself.")
6969 }
7070 else throw("Strict value is not equal to itself.")
7171 }
7272 }
7373
7474

github/deemru/w8io/026f985 
33.27 ms