tx · GzGaACPWBRoSQKG12xpRQoACv3FwnVurupSwnH7bhMxR

3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH:  -0.04000000 Waves

2022.04.11 12:29 [2003750] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves

{ "type": 13, "id": "GzGaACPWBRoSQKG12xpRQoACv3FwnVurupSwnH7bhMxR", "fee": 4000000, "feeAssetId": null, "timestamp": 1649669432869, "version": 2, "chainId": 84, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "5VQTBHrqmcBJ8RnLh37oK4NRot7n6AH5upWzUuhsfqeQG3cFFe4bLQTQRUaGWqBw52Xbd6K1EmCe3QgWWij51hzy" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAQAAAAHJG1hdGNoMAkAA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b3VudAUAAAACSUQJAARMAAAAAgUAAAAHYnVybmluZwkABEwAAAACBQAAAAh0cmFuc2ZlcgUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmCRYmV", "height": 2003750, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5vBEr9z1cVoKURowEEEcPqpxB4CScrZVaJvuCZYmyMb1 Next: ECgz6fY4eSvFxiAfJws3aGFpwh5pHJBMuWNNWJHAQemd Diff:
OldNewDifferences
1010 @Callable(i)
1111 func stake () = {
1212 let pmt = value(i.payments[0])
13- let pmtAmount = ((18 * pmt.amount) / 10)
13+ let pmtAmount = pmt.amount
1414 if ((pmt.assetId != ID))
1515 then throw("attach testNSBT tokens only")
1616 else if (isStopped)
2323 case _ =>
2424 throw("Can't find asset")
2525 }
26- let singleLPinValue = (inTreasury / totalIssued)
27- let LPIssue = Reissue(LP, singleLPinValue, true)
28- let transfer = ScriptTransfer(i.caller, singleLPinValue, LP)
26+ let LPIssue = Reissue(LP, pmtAmount, true)
27+ let transfer = ScriptTransfer(i.caller, pmtAmount, LP)
2928 [LPIssue, transfer]
3029 }
3130 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ID = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh'
55
66 let LP = base58'6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU'
77
88 let isStopped = false
99
1010 @Callable(i)
1111 func stake () = {
1212 let pmt = value(i.payments[0])
13- let pmtAmount = ((18 * pmt.amount) / 10)
13+ let pmtAmount = pmt.amount
1414 if ((pmt.assetId != ID))
1515 then throw("attach testNSBT tokens only")
1616 else if (isStopped)
1717 then throw("smart contract is on lock")
1818 else {
1919 let inTreasury = assetBalance(this, ID)
2020 let totalIssued = match assetInfo(LP) {
2121 case asset: Asset =>
2222 asset.quantity
2323 case _ =>
2424 throw("Can't find asset")
2525 }
26- let singleLPinValue = (inTreasury / totalIssued)
27- let LPIssue = Reissue(LP, singleLPinValue, true)
28- let transfer = ScriptTransfer(i.caller, singleLPinValue, LP)
26+ let LPIssue = Reissue(LP, pmtAmount, true)
27+ let transfer = ScriptTransfer(i.caller, pmtAmount, LP)
2928 [LPIssue, transfer]
3029 }
3130 }
3231
3332
3433
3534 @Callable(i)
3635 func withdraw (amount) = {
3736 let attached = i.payments[0]
3837 let paymentID = i.payments[0].assetId
3938 if ((paymentID != LP))
4039 then throw("Attach the correct LP token")
4140 else {
4241 let newAmount = (attached.amount - amount)
4342 if ((0 > amount))
4443 then throw("Can't withdraw negative amount")
4544 else if ((0 > newAmount))
4645 then throw("Not enough balance")
4746 else {
4847 let burning = Burn(LP, amount)
4948 let transfer = ScriptTransfer(i.caller, newAmount, ID)
5049 [burning, transfer]
5150 }
5251 }
5352 }
5453
5554
5655 @Verifier(tx)
5756 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
5857

github/deemru/w8io/169f3d6 
204.97 ms