tx · 9B7X6xuq4JbPov4SZkhnfAhNiDJyeABY3GaZxJpdT8kh
3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH: -0.01400000 Waves
2022.04.08 11:44 [1999365] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves
{
"type": 13,
"id": "9B7X6xuq4JbPov4SZkhnfAhNiDJyeABY3GaZxJpdT8kh",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1649407530722,
"version": 2,
"chainId": 84,
"sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH",
"senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm",
"proofs": [
"P28gP56qFWD8fqxio6vzYkKHj96XPWjKDgaerg16PzwS1RRyveCAWidyeYDGw1Nnpqncy4VWCYCSa71VE231Mvx"
],
"script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAt0b3RhbElzc3VlZAQAAAAHJG1hdGNoMAkAA+wAAAABBQAAAAJMUAMJAAABAAAAAgUAAAAHJG1hdGN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AAAAB2J1cm5pbmcJAARMAAAAAgUAAAAIdHJhbnNmZXIFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5hplshQ==",
"height": 1999365,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 9Tjy8L4EeS1CuVwxnmqz39VhdjA8LAcCXaE255FtmUAs
Next: FHaL2fzkoj2hxfjqxuKfyS7k3mhsfdTDZLDYFVx9eiGc
Diff:
Old | New | | Differences |
---|
16 | 16 | | else if (c) |
---|
17 | 17 | | then throw("smart contract is on lock") |
---|
18 | 18 | | else { |
---|
19 | | - | let g = assetBalance(this, a) |
---|
20 | | - | let h = Reissue(b, g, true) |
---|
21 | | - | let i = ScriptTransfer(d.caller, g, b) |
---|
22 | | - | [h, i] |
---|
| 19 | + | let g = { |
---|
| 20 | + | let h = assetInfo(b) |
---|
| 21 | + | if ($isInstanceOf(h, "Asset")) |
---|
| 22 | + | then { |
---|
| 23 | + | let i = h |
---|
| 24 | + | i.quantity |
---|
| 25 | + | } |
---|
| 26 | + | else throw("Can't find asset") |
---|
| 27 | + | } |
---|
| 28 | + | let j = Reissue(b, g, true) |
---|
| 29 | + | let k = ScriptTransfer(d.caller, g, b) |
---|
| 30 | + | [j, k] |
---|
23 | 31 | | } |
---|
24 | 32 | | } |
---|
25 | 33 | | |
---|
26 | 34 | | |
---|
27 | 35 | | |
---|
28 | 36 | | @Callable(d) |
---|
29 | | - | func withdraw (j) = { |
---|
30 | | - | let k = d.payments[0] |
---|
31 | | - | let l = d.payments[0].assetId |
---|
32 | | - | if ((l != b)) |
---|
| 37 | + | func withdraw (l) = { |
---|
| 38 | + | let m = d.payments[0] |
---|
| 39 | + | let n = d.payments[0].assetId |
---|
| 40 | + | if ((n != b)) |
---|
33 | 41 | | then throw("Attach the correct LP token") |
---|
34 | 42 | | else { |
---|
35 | | - | let m = (k.amount - j) |
---|
36 | | - | if ((0 > j)) |
---|
| 43 | + | let o = (m.amount - l) |
---|
| 44 | + | if ((0 > l)) |
---|
37 | 45 | | then throw("Can't withdraw negative amount") |
---|
38 | | - | else if ((0 > m)) |
---|
| 46 | + | else if ((0 > o)) |
---|
39 | 47 | | then throw("Not enough balance") |
---|
40 | 48 | | else { |
---|
41 | | - | let n = Burn(b, j) |
---|
42 | | - | let i = ScriptTransfer(d.caller, m, a) |
---|
43 | | - | [n, i] |
---|
| 49 | + | let p = Burn(b, l) |
---|
| 50 | + | let k = ScriptTransfer(d.caller, o, a) |
---|
| 51 | + | [p, k] |
---|
44 | 52 | | } |
---|
45 | 53 | | } |
---|
46 | 54 | | } |
---|
47 | 55 | | |
---|
48 | 56 | | |
---|
49 | | - | @Verifier(o) |
---|
50 | | - | func p () = sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey) |
---|
| 57 | + | @Verifier(q) |
---|
| 58 | + | func r () = sigVerify(q.bodyBytes, q.proofs[0], q.senderPublicKey) |
---|
51 | 59 | | |
---|
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 | | - | let g = assetBalance(this, a) |
---|
20 | | - | let h = Reissue(b, g, true) |
---|
21 | | - | let i = ScriptTransfer(d.caller, g, b) |
---|
22 | | - | [h, i] |
---|
| 19 | + | let g = { |
---|
| 20 | + | let h = assetInfo(b) |
---|
| 21 | + | if ($isInstanceOf(h, "Asset")) |
---|
| 22 | + | then { |
---|
| 23 | + | let i = h |
---|
| 24 | + | i.quantity |
---|
| 25 | + | } |
---|
| 26 | + | else throw("Can't find asset") |
---|
| 27 | + | } |
---|
| 28 | + | let j = Reissue(b, g, true) |
---|
| 29 | + | let k = ScriptTransfer(d.caller, g, b) |
---|
| 30 | + | [j, k] |
---|
23 | 31 | | } |
---|
24 | 32 | | } |
---|
25 | 33 | | |
---|
26 | 34 | | |
---|
27 | 35 | | |
---|
28 | 36 | | @Callable(d) |
---|
29 | | - | func withdraw (j) = { |
---|
30 | | - | let k = d.payments[0] |
---|
31 | | - | let l = d.payments[0].assetId |
---|
32 | | - | if ((l != b)) |
---|
| 37 | + | func withdraw (l) = { |
---|
| 38 | + | let m = d.payments[0] |
---|
| 39 | + | let n = d.payments[0].assetId |
---|
| 40 | + | if ((n != b)) |
---|
33 | 41 | | then throw("Attach the correct LP token") |
---|
34 | 42 | | else { |
---|
35 | | - | let m = (k.amount - j) |
---|
36 | | - | if ((0 > j)) |
---|
| 43 | + | let o = (m.amount - l) |
---|
| 44 | + | if ((0 > l)) |
---|
37 | 45 | | then throw("Can't withdraw negative amount") |
---|
38 | | - | else if ((0 > m)) |
---|
| 46 | + | else if ((0 > o)) |
---|
39 | 47 | | then throw("Not enough balance") |
---|
40 | 48 | | else { |
---|
41 | | - | let n = Burn(b, j) |
---|
42 | | - | let i = ScriptTransfer(d.caller, m, a) |
---|
43 | | - | [n, i] |
---|
| 49 | + | let p = Burn(b, l) |
---|
| 50 | + | let k = ScriptTransfer(d.caller, o, a) |
---|
| 51 | + | [p, k] |
---|
44 | 52 | | } |
---|
45 | 53 | | } |
---|
46 | 54 | | } |
---|
47 | 55 | | |
---|
48 | 56 | | |
---|
49 | | - | @Verifier(o) |
---|
50 | | - | func p () = sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey) |
---|
| 57 | + | @Verifier(q) |
---|
| 58 | + | func r () = sigVerify(q.bodyBytes, q.proofs[0], q.senderPublicKey) |
---|
51 | 59 | | |
---|