tx · CzCHmtJFF1GVHPnQdHZxjxA8JeUSWrFi61FEKzJYWh8G

3NCCpaecUeQcHCJGnv1ZocqT3xAz2wiXFwe:  -0.04000000 Waves

2022.04.15 13:51 [2009577] smart account 3NCCpaecUeQcHCJGnv1ZocqT3xAz2wiXFwe > SELF 0.00000000 Waves

{ "type": 13, "id": "CzCHmtJFF1GVHPnQdHZxjxA8JeUSWrFi61FEKzJYWh8G", "fee": 4000000, "feeAssetId": null, "timestamp": 1650019910125, "version": 2, "chainId": 84, "sender": "3NCCpaecUeQcHCJGnv1ZocqT3xAz2wiXFwe", "senderPublicKey": "FX5ZmtqMuiefGRPoKkAcBUEDvaHBS4FSzt8VW49mzcjM", "proofs": [ "4k5aJmfctLXHt8L5oJ54fVAKnHAP3eb6ZL3WkD6GsMBNeSTakaKD1kcc3jhv5ZYTLfcqy6uLy3L2gioJG3WSAjM8" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACB/UEMJOE42DKjdpdUZpk8du9RWHsMm1kEORh3GqO3pHQAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAQAAAAHJG1hdGNoMAk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gbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlBAAAAAdidXJuaW5nCQEAAAAEQnVybgAAAAIFAAAAAkxQBQAAAAZhbW91bnQEAAAACHRyYW5zZmVyCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACW5ld0Ftb3VudAUAAAACSUQJAARMAAAAAgUAAAAHYnVybmluZwkABEwAAAACBQAAAAh0cmFuc2ZlcgUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmDQxN/", "height": 2009577, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Gw99TTuaEASGyM3zjXuYJvXAStopKVCNBzRo9wPJNLd9 Next: ChtgsXGJUACZLGe4qwFoWm8Z1aBgAVZjhzRQ3TR13NJi Diff:
OldNewDifferences
2323 case _ =>
2424 throw("Can't find asset")
2525 }
26- let singleLPinValue = (((inTreasury * 100000000) - 10000000) / totalIssued)
26+ let singleLPinValue = (((inTreasury * 100000000) - pmtAmount) / totalIssued)
2727 let amountToIssue = ((pmtAmount * singleLPinValue) / 100000000)
2828 let LPIssue = Reissue(LP, amountToIssue, true)
2929 let transfer = ScriptTransfer(i.caller, amountToIssue, LP)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ID = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh'
55
66 let LP = base58'9ZymB4TJF6oQ3HwYgYFKizAf6m64sQF896mUzcsDJ4Wx'
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 * 100000000) - 10000000) / totalIssued)
26+ let singleLPinValue = (((inTreasury * 100000000) - pmtAmount) / totalIssued)
2727 let amountToIssue = ((pmtAmount * singleLPinValue) / 100000000)
2828 let LPIssue = Reissue(LP, amountToIssue, true)
2929 let transfer = ScriptTransfer(i.caller, amountToIssue, LP)
3030 [LPIssue, transfer]
3131 }
3232 }
3333
3434
3535
3636 @Callable(i)
3737 func withdraw (amount) = {
3838 let attached = i.payments[0]
3939 let paymentID = i.payments[0].assetId
4040 if ((paymentID != LP))
4141 then throw("Attach the correct LP token")
4242 else {
4343 let newAmount = (attached.amount - amount)
4444 if ((0 > amount))
4545 then throw("Can't withdraw negative amount")
4646 else if ((0 > newAmount))
4747 then throw("Not enough balance")
4848 else {
4949 let burning = Burn(LP, amount)
5050 let transfer = ScriptTransfer(i.caller, newAmount, ID)
5151 [burning, transfer]
5252 }
5353 }
5454 }
5555
5656
5757 @Verifier(tx)
5858 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
5959

github/deemru/w8io/026f985 
44.34 ms