tx · Do5tjP2ciyXujzJR1wyq823LGAVXFeecniMbpaAw9nYY

3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH:  -0.04000000 Waves

2022.04.11 13:04 [2003784] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves

{ "type": 13, "id": "Do5tjP2ciyXujzJR1wyq823LGAVXFeecniMbpaAw9nYY", "fee": 4000000, "feeAssetId": null, "timestamp": 1649671499539, "version": 2, "chainId": 84, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "3hhd5hRcM75aqon4HrwV34B3CQwMNHotpeMp6c5eQreK34R3ETafF1NtwZByoiPaiULt6V7kZtnuHDrZBXD9tfKc" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAQAAAAHJG1hdGNoMAkAA+wAAA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AAABEJ1cm4AAAACBQAAAAJMUAUAAAAGYW1vdW50BAAAAAh0cmFuc2ZlcgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAluZXdBbW91bnQFAAAAAklECQAETAAAAAIFAAAAB2J1cm5pbmcJAARMAAAAAgUAAAAIdHJhbnNmZXIFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5tVq5lg==", "height": 2003784, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G6BxkktP6atWpQtd4icsVYUJCjCubEvopUuyoA8EjPru Next: GdmE14s3JsyKMJMyUrkmjz9zZmHEsT8PFAZNK4beRrWU Diff:
OldNewDifferences
2323 case _ =>
2424 throw("Can't find asset")
2525 }
26- let singleLPinValue = (inTreasury / totalIssued)
26+ let singleLPinValue = ((inTreasury / totalIssued) * 10000)
2727 let LPIssue = Reissue(LP, singleLPinValue, true)
2828 let transfer = ScriptTransfer(i.caller, singleLPinValue, LP)
2929 [LPIssue, transfer]
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])
1313 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)
26+ let singleLPinValue = ((inTreasury / totalIssued) * 10000)
2727 let LPIssue = Reissue(LP, singleLPinValue, true)
2828 let transfer = ScriptTransfer(i.caller, singleLPinValue, LP)
2929 [LPIssue, transfer]
3030 }
3131 }
3232
3333
3434
3535 @Callable(i)
3636 func withdraw (amount) = {
3737 let attached = i.payments[0]
3838 let paymentID = i.payments[0].assetId
3939 if ((paymentID != LP))
4040 then throw("Attach the correct LP token")
4141 else {
4242 let newAmount = (attached.amount - amount)
4343 if ((0 > amount))
4444 then throw("Can't withdraw negative amount")
4545 else if ((0 > newAmount))
4646 then throw("Not enough balance")
4747 else {
4848 let burning = Burn(LP, amount)
4949 let transfer = ScriptTransfer(i.caller, newAmount, ID)
5050 [burning, transfer]
5151 }
5252 }
5353 }
5454
5555
5656 @Verifier(tx)
5757 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
5858

github/deemru/w8io/026f985 
49.38 ms