tx · uaa5B71ZLk9Bp1uGkgCABVTehp3zTAi8G7VEWW4CfDM

3Mq4LDNtBNSJicpMR5TxG89n1D9mMavMAj7:  -0.04000000 Waves

2022.04.15 16:00 [2009700] smart account 3Mq4LDNtBNSJicpMR5TxG89n1D9mMavMAj7 > SELF 0.00000000 Waves

{ "type": 13, "id": "uaa5B71ZLk9Bp1uGkgCABVTehp3zTAi8G7VEWW4CfDM", "fee": 4000000, "feeAssetId": null, "timestamp": 1650027651106, "version": 2, "chainId": 84, "sender": "3Mq4LDNtBNSJicpMR5TxG89n1D9mMavMAj7", "senderPublicKey": "FJZaKJq3aMAC6bg2qfp2qgfv31a2jNRDaYaCR9TY5HP3", "proofs": [ "5hPALv3s9k7BJ48zoMNnZnTjbusjNJua1MqzLymvkt7o3MVhVBHrwcz1WXzAZgK6bv4XSgdkq4QkWN59V7boVdRF" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAgx9nxFhF/Vet+hUeMSuI6u+gulwcg4JEAkzyDXj2OTUcAAAAAAkxQAQAAACAadIp7bdSyK0gbz1W2AjU0nxj3S33gDXc8ar9GU2PFIwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAQAAAAHJG1hdGNoMAkAA+wAAA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XZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQQAAAAHYnVybmluZwkBAAAABEJ1cm4AAAACBQAAAAJMUAUAAAAGYW1vdW50BAAAAAh0cmFuc2ZlcgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAluZXdBbW91bnQFAAAAAklECQAETAAAAAIFAAAAB2J1cm5pbmcJAARMAAAAAgUAAAAIdHJhbnNmZXIFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V55uI8+g==", "height": 2009700, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 75w1197Pc7fX3iQHDABWyhKxgXxAqyZqUBrBeaAr5RTj Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let ID = base58'ET8t5TozeUrUQfMzLzVeHTVo2vmiEeu2apj3AN6zwzsG'
5+
6+let LP = base58'2nGfqMHdunJuX8jYzruMKz1e1vMNrhJtWMjHizRhB8Fk'
7+
8+let isStopped = false
9+
10+@Callable(i)
11+func stake () = {
12+ let pmt = value(i.payments[0])
13+ let pmtAmount = pmt.amount
14+ if ((pmt.assetId != ID))
15+ then throw("attach testNSBT tokens only")
16+ else if (isStopped)
17+ then throw("smart contract is on lock")
18+ else {
19+ let inTreasury = assetBalance(this, ID)
20+ let totalIssued = match assetInfo(LP) {
21+ case asset: Asset =>
22+ asset.quantity
23+ case _ =>
24+ throw("Can't find asset")
25+ }
26+ let singleLPinValue = (((totalIssued * 100000000) / (inTreasury * 100000000)) * pmtAmount)
27+ let amountToIssue = (singleLPinValue / 100000000)
28+ let LPIssue = Reissue(LP, amountToIssue, true)
29+ let transfer = ScriptTransfer(i.caller, amountToIssue, LP)
30+[LPIssue, transfer]
31+ }
32+ }
33+
34+
35+
36+@Callable(i)
37+func withdraw (amount) = {
38+ let attached = i.payments[0]
39+ let paymentID = i.payments[0].assetId
40+ if ((paymentID != LP))
41+ then throw("Attach the correct LP token")
42+ else {
43+ let newAmount = (attached.amount - amount)
44+ if ((0 > amount))
45+ then throw("Can't withdraw negative amount")
46+ else if ((0 > newAmount))
47+ then throw("Not enough balance")
48+ else {
49+ let burning = Burn(LP, amount)
50+ let transfer = ScriptTransfer(i.caller, newAmount, ID)
51+[burning, transfer]
52+ }
53+ }
54+ }
55+
56+
57+@Verifier(tx)
58+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
59+

github/deemru/w8io/169f3d6 
33.49 ms