tx · 4CqBAu93LiicP54PWBApoXKzeTqZAJPGFTvgqYXn2LhR

3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so:  -0.04000000 Waves

2022.05.20 12:38 [2059826] smart account 3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so > SELF 0.00000000 Waves

{ "type": 13, "id": "4CqBAu93LiicP54PWBApoXKzeTqZAJPGFTvgqYXn2LhR", "fee": 4000000, "feeAssetId": null, "timestamp": 1653039505062, "version": 2, "chainId": 84, "sender": "3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so", "senderPublicKey": "EpvN8tsbEWeeqZSLaEVCda8PZfKa1JAF3ZFp7hRq1gWj", "proofs": [ "5FnpuYKpgitwM3i9Sfvpdydzyo676gePFHEib9j24yKC3hau5Rzne4KmGJSBAPE2gFTuJKeBwTzHscBhXEwCeMYt" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAGAAAAAAV0b2tlbgEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAABWxwVENJAQAAACBYukfmA8VHrjQiYf9ySqYH4A864xu2rNSaNwUvI60S5AAAAAAJaXNTdG9wcGVkBwAAAAAJa2V5U3Rha2VkAgAAAAlTVEFLRURfTFAAAAAAC2tleUNvbXBvdW5kAgAAAA1Gcm9tX0NvbXBvdW5kAAAAAARkZWZWAAAAAAAF9eEAAAAAAgAAAAFpAQAAAAVzdGFrZQAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJcG10QW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAFdG9rZW4JAAACAAAAAQIAAAAdYXR0YWNoIFVTRFRVU0ROTFAgdG9rZW5zIG9ubHkDBQAAAAlpc1N0b3BwZWQJAAACAAAAAQIAAAAZc21hcnQgY29udHJhY3QgaXMgb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wb3VuZAUAAAADbmlsAwkAAAAAAAACBQAAAAZzdGFrZUMFAAAABnN0YWtlQwQAAAALdXBkYXRlU3RhdGUJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAlrZXlTdGFrZWQJAABkAAAAAgUAAAALdG90YWxTdGFrZWQFAAAAAmNhBAAAAAJ0YwkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAC2tleUNvbXBvdW5kCQAAZAAAAAIFAAAADGZyb21Db21wb3VuZAUAAAACY2EJAARMAAAAAgUAAAALdXBkYXRlU3RhdGUJAARMAAAAAgUAAAACdGMFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleazrtt8=", "height": 2059826, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8RChVL79K2UVaZyMd41NALgzb1LWj8rXk6o4qTPpoYys Next: 72e7XoE1DBBECxAtu1MrvSEY2185xMLSfHHiCFuEpqPx Diff:
OldNewDifferences
2424 else {
2525 let tkStaked = valueOrElse(getInteger(this, keyStaked), 0)
2626 let fromCompound = valueOrElse(getInteger(this, keyCompound), 0)
27- let updateState = IntegerEntry(keyStaked, (((defV + tkStaked) + i.payments[0].amount) - defV))
27+ let updateState = IntegerEntry(keyStaked, ((defV + tkStaked) + i.payments[0].amount))
2828 if ((updateState == updateState))
2929 then if ((updateState == updateState))
3030 then {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let token = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS'
55
66 let lpTCI = base58'6yMdFxB7ULdLQ8mMjkLtoQvTy9WFrBKoTRK5JXnwMPAb'
77
88 let isStopped = false
99
1010 let keyStaked = "STAKED_LP"
1111
1212 let keyCompound = "From_Compound"
1313
1414 let defV = 100000000
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 fromCompound = valueOrElse(getInteger(this, keyCompound), 0)
27- let updateState = IntegerEntry(keyStaked, (((defV + tkStaked) + i.payments[0].amount) - defV))
27+ let updateState = IntegerEntry(keyStaked, ((defV + tkStaked) + i.payments[0].amount))
2828 if ((updateState == updateState))
2929 then if ((updateState == updateState))
3030 then {
3131 let totalIssued = match assetInfo(lpTCI) {
3232 case asset: Asset =>
3333 asset.quantity
3434 case _ =>
3535 throw("Can't find asset")
3636 }
3737 let forOne = fraction(totalIssued, 100000000, tkStaked)
3838 let toIssue = fraction(pmtAmount, forOne, 100000000)
3939 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
4040 if ((LPstake == LPstake))
4141 then {
4242 let LPIssue = Reissue(lpTCI, toIssue, true)
4343 let transfer = ScriptTransfer(i.caller, toIssue, lpTCI)
4444 [LPIssue, transfer, updateState]
4545 }
4646 else throw("Strict value is not equal to itself.")
4747 }
4848 else throw("Strict value is not equal to itself.")
4949 else throw("Strict value is not equal to itself.")
5050 }
5151 }
5252
5353
5454
5555 @Callable(i)
5656 func compound () = {
5757 let compound = value(i.payments[0])
5858 let ca = compound.amount
5959 if ((compound.assetId != token))
6060 then throw("attach USDTUSDNLP tokens only")
6161 else {
6262 let fromCompound = valueOrElse(getInteger(this, keyCompound), 0)
6363 let totalStaked = valueOrElse(getInteger(this, keyStaked), 0)
6464 let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound])
6565 if ((stakeC == stakeC))
6666 then {
6767 let updateState = IntegerEntry(keyStaked, (totalStaked + ca))
6868 let tc = IntegerEntry(keyCompound, (fromCompound + ca))
6969 [updateState, tc]
7070 }
7171 else throw("Strict value is not equal to itself.")
7272 }
7373 }
7474
7575
7676 @Verifier(tx)
7777 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
7878

github/deemru/w8io/026f985 
22.92 ms