tx · BPgpKkmK5i76Y4ero1as8B1qttZzC7m5gcpE5avTH4rM
3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH: -0.01400000 Waves
2022.04.08 15:12 [1999579] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves
{
"type": 13,
"id": "BPgpKkmK5i76Y4ero1as8B1qttZzC7m5gcpE5avTH4rM",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1649419975291,
"version": 2,
"chainId": 84,
"sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH",
"senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm",
"proofs": [
"5mVsQvqf9TYATPvYzh1HPrB3mf5CqGAA2K3SptRub9trq7M1Frwy1MB1Bxnb8mGacSx7arSW8YYkqn1hQRKNCiea"
],
"script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAkBAAAADEludGV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AAAACHRyYW5zZmVyBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleZpEcfk=",
"height": 1999579,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: i2LHhxia2wjJGhr2pGU92YHF1oucRM4eZAG84mZ2Fqo
Next: 3savGe47d3U7XwXgguvU2yBXuU7uu9ajtiMh5xsuCubC
Diff:
Old | New | | Differences |
---|
17 | 17 | | then throw("smart contract is on lock") |
---|
18 | 18 | | else { |
---|
19 | 19 | | let g = assetBalance(this, a) |
---|
20 | | - | let h = { |
---|
21 | | - | let i = assetInfo(b) |
---|
22 | | - | if ($isInstanceOf(i, "Asset")) |
---|
23 | | - | then { |
---|
24 | | - | let j = i |
---|
25 | | - | j.quantity |
---|
26 | | - | } |
---|
27 | | - | else throw("Can't find asset") |
---|
28 | | - | } |
---|
29 | | - | let k = Reissue(b, f, true) |
---|
30 | | - | let l = ScriptTransfer(d.caller, f, b) |
---|
31 | | - | [k, l] |
---|
| 20 | + | let h = IntegerEntry("6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU", 100) |
---|
| 21 | + | let i = Reissue(b, f, true) |
---|
| 22 | + | let j = ScriptTransfer(d.caller, f, b) |
---|
| 23 | + | [i, j] |
---|
32 | 24 | | } |
---|
33 | 25 | | } |
---|
34 | 26 | | |
---|
35 | 27 | | |
---|
36 | 28 | | |
---|
37 | 29 | | @Callable(d) |
---|
38 | | - | func withdraw (m) = { |
---|
39 | | - | let n = d.payments[0] |
---|
40 | | - | let o = d.payments[0].assetId |
---|
41 | | - | if ((o != b)) |
---|
| 30 | + | func withdraw (k) = { |
---|
| 31 | + | let l = d.payments[0] |
---|
| 32 | + | let m = d.payments[0].assetId |
---|
| 33 | + | if ((m != b)) |
---|
42 | 34 | | then throw("Attach the correct LP token") |
---|
43 | 35 | | else { |
---|
44 | | - | let p = (n.amount - m) |
---|
45 | | - | if ((0 > m)) |
---|
| 36 | + | let n = (l.amount - k) |
---|
| 37 | + | if ((0 > k)) |
---|
46 | 38 | | then throw("Can't withdraw negative amount") |
---|
47 | | - | else if ((0 > p)) |
---|
| 39 | + | else if ((0 > n)) |
---|
48 | 40 | | then throw("Not enough balance") |
---|
49 | 41 | | else { |
---|
50 | | - | let q = Burn(b, m) |
---|
51 | | - | let l = ScriptTransfer(d.caller, p, a) |
---|
52 | | - | [q, l] |
---|
| 42 | + | let o = Burn(b, k) |
---|
| 43 | + | let j = ScriptTransfer(d.caller, n, a) |
---|
| 44 | + | [o, j] |
---|
53 | 45 | | } |
---|
54 | 46 | | } |
---|
55 | 47 | | } |
---|
56 | 48 | | |
---|
57 | 49 | | |
---|
58 | | - | @Verifier(r) |
---|
59 | | - | func s () = sigVerify(r.bodyBytes, r.proofs[0], r.senderPublicKey) |
---|
| 50 | + | @Verifier(p) |
---|
| 51 | + | func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey) |
---|
60 | 52 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh' |
---|
5 | 5 | | |
---|
6 | 6 | | let b = base58'6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU' |
---|
7 | 7 | | |
---|
8 | 8 | | let c = false |
---|
9 | 9 | | |
---|
10 | 10 | | @Callable(d) |
---|
11 | 11 | | func stake () = { |
---|
12 | 12 | | let e = value(d.payments[0]) |
---|
13 | 13 | | let f = e.amount |
---|
14 | 14 | | if ((e.assetId != a)) |
---|
15 | 15 | | then throw("attach testNSBT tokens only") |
---|
16 | 16 | | else if (c) |
---|
17 | 17 | | then throw("smart contract is on lock") |
---|
18 | 18 | | else { |
---|
19 | 19 | | let g = assetBalance(this, a) |
---|
20 | | - | let h = { |
---|
21 | | - | let i = assetInfo(b) |
---|
22 | | - | if ($isInstanceOf(i, "Asset")) |
---|
23 | | - | then { |
---|
24 | | - | let j = i |
---|
25 | | - | j.quantity |
---|
26 | | - | } |
---|
27 | | - | else throw("Can't find asset") |
---|
28 | | - | } |
---|
29 | | - | let k = Reissue(b, f, true) |
---|
30 | | - | let l = ScriptTransfer(d.caller, f, b) |
---|
31 | | - | [k, l] |
---|
| 20 | + | let h = IntegerEntry("6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU", 100) |
---|
| 21 | + | let i = Reissue(b, f, true) |
---|
| 22 | + | let j = ScriptTransfer(d.caller, f, b) |
---|
| 23 | + | [i, j] |
---|
32 | 24 | | } |
---|
33 | 25 | | } |
---|
34 | 26 | | |
---|
35 | 27 | | |
---|
36 | 28 | | |
---|
37 | 29 | | @Callable(d) |
---|
38 | | - | func withdraw (m) = { |
---|
39 | | - | let n = d.payments[0] |
---|
40 | | - | let o = d.payments[0].assetId |
---|
41 | | - | if ((o != b)) |
---|
| 30 | + | func withdraw (k) = { |
---|
| 31 | + | let l = d.payments[0] |
---|
| 32 | + | let m = d.payments[0].assetId |
---|
| 33 | + | if ((m != b)) |
---|
42 | 34 | | then throw("Attach the correct LP token") |
---|
43 | 35 | | else { |
---|
44 | | - | let p = (n.amount - m) |
---|
45 | | - | if ((0 > m)) |
---|
| 36 | + | let n = (l.amount - k) |
---|
| 37 | + | if ((0 > k)) |
---|
46 | 38 | | then throw("Can't withdraw negative amount") |
---|
47 | | - | else if ((0 > p)) |
---|
| 39 | + | else if ((0 > n)) |
---|
48 | 40 | | then throw("Not enough balance") |
---|
49 | 41 | | else { |
---|
50 | | - | let q = Burn(b, m) |
---|
51 | | - | let l = ScriptTransfer(d.caller, p, a) |
---|
52 | | - | [q, l] |
---|
| 42 | + | let o = Burn(b, k) |
---|
| 43 | + | let j = ScriptTransfer(d.caller, n, a) |
---|
| 44 | + | [o, j] |
---|
53 | 45 | | } |
---|
54 | 46 | | } |
---|
55 | 47 | | } |
---|
56 | 48 | | |
---|
57 | 49 | | |
---|
58 | | - | @Verifier(r) |
---|
59 | | - | func s () = sigVerify(r.bodyBytes, r.proofs[0], r.senderPublicKey) |
---|
| 50 | + | @Verifier(p) |
---|
| 51 | + | func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey) |
---|
60 | 52 | | |
---|