tx · ECgz6fY4eSvFxiAfJws3aGFpwh5pHJBMuWNNWJHAQemd 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH: -0.04000000 Waves 2022.04.11 12:33 [2003755] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves
{ "type": 13, "id": "ECgz6fY4eSvFxiAfJws3aGFpwh5pHJBMuWNNWJHAQemd", "fee": 4000000, "feeAssetId": null, "timestamp": 1649669616265, "version": 2, "chainId": 84, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "31NgWSbwp5H9ZPFfU2jWeAF2vJNK3FrAXyEySSh2q1usqEhsPHzc58vkqxpVMAXBuWyyyPbQGsE2m3V9SZ7sWWPM" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAQAAAAHJG1hdG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sbGVyBQAAAAluZXdBbW91bnQFAAAAAklECQAETAAAAAIFAAAAB2J1cm5pbmcJAARMAAAAAgUAAAAIdHJhbnNmZXIFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5vjvwuw==", "height": 2003755, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GzGaACPWBRoSQKG12xpRQoACv3FwnVurupSwnH7bhMxR Next: 7wbJRr4aGZK7bmNzdRChm1bKoJpK37V9gmGFMFuqNfa8 Diff:
Old | New | Differences | |
---|---|---|---|
23 | 23 | case _ => | |
24 | 24 | throw("Can't find asset") | |
25 | 25 | } | |
26 | - | let LPIssue = Reissue(LP, | |
26 | + | let LPIssue = Reissue(LP, inTreasury, true) | |
27 | 27 | let transfer = ScriptTransfer(i.caller, pmtAmount, LP) | |
28 | 28 | [LPIssue, transfer] | |
29 | 29 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ID = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh' | |
5 | 5 | ||
6 | 6 | let LP = base58'6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU' | |
7 | 7 | ||
8 | 8 | let isStopped = false | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func stake () = { | |
12 | 12 | let pmt = value(i.payments[0]) | |
13 | 13 | let pmtAmount = pmt.amount | |
14 | 14 | if ((pmt.assetId != ID)) | |
15 | 15 | then throw("attach testNSBT tokens only") | |
16 | 16 | else if (isStopped) | |
17 | 17 | then throw("smart contract is on lock") | |
18 | 18 | else { | |
19 | 19 | let inTreasury = assetBalance(this, ID) | |
20 | 20 | let totalIssued = match assetInfo(LP) { | |
21 | 21 | case asset: Asset => | |
22 | 22 | asset.quantity | |
23 | 23 | case _ => | |
24 | 24 | throw("Can't find asset") | |
25 | 25 | } | |
26 | - | let LPIssue = Reissue(LP, | |
26 | + | let LPIssue = Reissue(LP, inTreasury, true) | |
27 | 27 | let transfer = ScriptTransfer(i.caller, pmtAmount, LP) | |
28 | 28 | [LPIssue, transfer] | |
29 | 29 | } | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(i) | |
35 | 35 | func withdraw (amount) = { | |
36 | 36 | let attached = i.payments[0] | |
37 | 37 | let paymentID = i.payments[0].assetId | |
38 | 38 | if ((paymentID != LP)) | |
39 | 39 | then throw("Attach the correct LP token") | |
40 | 40 | else { | |
41 | 41 | let newAmount = (attached.amount - amount) | |
42 | 42 | if ((0 > amount)) | |
43 | 43 | then throw("Can't withdraw negative amount") | |
44 | 44 | else if ((0 > newAmount)) | |
45 | 45 | then throw("Not enough balance") | |
46 | 46 | else { | |
47 | 47 | let burning = Burn(LP, amount) | |
48 | 48 | let transfer = ScriptTransfer(i.caller, newAmount, ID) | |
49 | 49 | [burning, transfer] | |
50 | 50 | } | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | @Verifier(tx) | |
56 | 56 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
57 | 57 |
github/deemru/w8io/169f3d6 39.83 ms ◑