tx · wn68uwQNcKNu2fnA6L4mLCikGQpDLArk3yF9FMfpzpN

3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH:  -0.04000000 Waves

2022.04.15 12:46 [2009511] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves

{ "type": 13, "id": "wn68uwQNcKNu2fnA6L4mLCikGQpDLArk3yF9FMfpzpN", "fee": 4000000, "feeAssetId": null, "timestamp": 1650015964336, "version": 2, "chainId": 84, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "4raEYDcdwdZnf1zWSZA3QdHt67KaABNNMTKc9UrSBEFiCrS7MbjYXBW9T2PSJ3aJzsiw6h6zW7wKP2L6fcziuzz6" ], "script": "base64:AAIFAAAAAAAAATEIAhIAEgMKAQEaBwoBYRICSUQaBwoBYhICTFAaDgoBYxIJaXNTdG9wcGVkGgYKAWQSAWkaCAoBZRIDcG10Gg4KAWYSCXBtdEFtb3VudBoPCgFnEgppblRyZWFzdXJ5GhAKAWgSC3RvdGFsSXNzdWVkGgwKAWkSByRtYXRjaDAaCgoBahIFYXNzZXQaFAoBaxIPc2luZ2xlTFBpblZhbHVlGhIKAWwSDWFtb3VudFRvSXNzdWUaDAoBbRIHTFBJc3N1ZRoNCgFuEgh0cmFuc2ZlchoLCgFvEgZhbW91bnQaDQoBcBIIYXR0YWNoZWQaDgoBcRIJcGF5bWVudElEGg4KAXISCW5ld0Ftb3VudBoMCgFzEgdidXJuaW5nGgcKAXQSAnR4GgsKAXUSBnZlcmlmeQAAAAMAAAAAAWEBAAAAIP8QR3aaHO4gAEH6GV3RAr44yVLBwb023LSVkrkR45liAAAAAAFiAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAABYwcAAAACAAAAAWQBAAAABXN0YWtlAAAAAAQA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AACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAFyCQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQQAAAABcwkBAAAABEJ1cm4AAAACBQAAAAFiBQAAAAFvBAAAAAFuCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABZAAAAAZjYWxsZXIFAAAAAXIFAAAAAWEJAARMAAAAAgUAAAABcwkABEwAAAACBQAAAAFuBQAAAANuaWwAAAABAAAAAXQBAAAAAXUAAAAACQAB9AAAAAMIBQAAAAF0AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAABdAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAF0AAAAD3NlbmRlclB1YmxpY0tlebRmSN8=", "height": 2009511, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 48KTb5dZVfL8idwwA5rMw38qF7TV41yDXnJQuPCgujTw Next: 631VSpNZxBTioNMk5TfKCXp4SLQr6FVi8QjwHoxaTS4k 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 }
2626 let singleLPinValue = ((inTreasury * 100000000) / 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/169f3d6 
26.97 ms