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