tx · 3savGe47d3U7XwXgguvU2yBXuU7uu9ajtiMh5xsuCubC
3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH: -0.01400000 Waves
2022.04.08 15:20 [1999586] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves
{
"type": 13,
"id": "3savGe47d3U7XwXgguvU2yBXuU7uu9ajtiMh5xsuCubC",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1649420403917,
"version": 2,
"chainId": 84,
"sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH",
"senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm",
"proofs": [
"ysVb6bEfY6pifLUcdxBn8tfxqiBoKWnApeAX3B8WN8VzoyzLm5ExcVFTiULTFc9eCdVQ4KmTyq3G1E53NfnZaGp"
],
"script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAkBAAAADEludG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AAIFAAAAAkxQBQAAAAZhbW91bnQEAAAACHRyYW5zZmVyCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACW5ld0Ftb3VudAUAAAACSUQJAARMAAAAAgUAAAAHYnVybmluZwkABEwAAAACBQAAAAh0cmFuc2ZlcgUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXn2ezQh",
"height": 1999586,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: BPgpKkmK5i76Y4ero1as8B1qttZzC7m5gcpE5avTH4rM
Next: FkCE3w9EFDeKs93QUvyTxqF59wqxxnKPDL9EXfkaZ9vS
Diff:
Old | New | | Differences |
---|
18 | 18 | | else { |
---|
19 | 19 | | let g = assetBalance(this, a) |
---|
20 | 20 | | let h = IntegerEntry("6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU", 100) |
---|
21 | | - | let i = Reissue(b, f, true) |
---|
22 | | - | let j = ScriptTransfer(d.caller, f, b) |
---|
23 | | - | [i, j] |
---|
| 21 | + | let i = (h.value / g) |
---|
| 22 | + | let j = (f * i) |
---|
| 23 | + | let k = Reissue(b, j, true) |
---|
| 24 | + | let l = ScriptTransfer(d.caller, f, b) |
---|
| 25 | + | [k, l] |
---|
24 | 26 | | } |
---|
25 | 27 | | } |
---|
26 | 28 | | |
---|
27 | 29 | | |
---|
28 | 30 | | |
---|
29 | 31 | | @Callable(d) |
---|
30 | | - | func withdraw (k) = { |
---|
31 | | - | let l = d.payments[0] |
---|
32 | | - | let m = d.payments[0].assetId |
---|
33 | | - | if ((m != b)) |
---|
| 32 | + | func withdraw (m) = { |
---|
| 33 | + | let n = d.payments[0] |
---|
| 34 | + | let o = d.payments[0].assetId |
---|
| 35 | + | if ((o != b)) |
---|
34 | 36 | | then throw("Attach the correct LP token") |
---|
35 | 37 | | else { |
---|
36 | | - | let n = (l.amount - k) |
---|
37 | | - | if ((0 > k)) |
---|
| 38 | + | let p = (n.amount - m) |
---|
| 39 | + | if ((0 > m)) |
---|
38 | 40 | | then throw("Can't withdraw negative amount") |
---|
39 | | - | else if ((0 > n)) |
---|
| 41 | + | else if ((0 > p)) |
---|
40 | 42 | | then throw("Not enough balance") |
---|
41 | 43 | | else { |
---|
42 | | - | let o = Burn(b, k) |
---|
43 | | - | let j = ScriptTransfer(d.caller, n, a) |
---|
44 | | - | [o, j] |
---|
| 44 | + | let q = Burn(b, m) |
---|
| 45 | + | let l = ScriptTransfer(d.caller, p, a) |
---|
| 46 | + | [q, l] |
---|
45 | 47 | | } |
---|
46 | 48 | | } |
---|
47 | 49 | | } |
---|
48 | 50 | | |
---|
49 | 51 | | |
---|
50 | | - | @Verifier(p) |
---|
51 | | - | func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey) |
---|
| 52 | + | @Verifier(r) |
---|
| 53 | + | func s () = sigVerify(r.bodyBytes, r.proofs[0], r.senderPublicKey) |
---|
52 | 54 | | |
---|
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 | 20 | | let h = IntegerEntry("6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU", 100) |
---|
21 | | - | let i = Reissue(b, f, true) |
---|
22 | | - | let j = ScriptTransfer(d.caller, f, b) |
---|
23 | | - | [i, j] |
---|
| 21 | + | let i = (h.value / g) |
---|
| 22 | + | let j = (f * i) |
---|
| 23 | + | let k = Reissue(b, j, true) |
---|
| 24 | + | let l = ScriptTransfer(d.caller, f, b) |
---|
| 25 | + | [k, l] |
---|
24 | 26 | | } |
---|
25 | 27 | | } |
---|
26 | 28 | | |
---|
27 | 29 | | |
---|
28 | 30 | | |
---|
29 | 31 | | @Callable(d) |
---|
30 | | - | func withdraw (k) = { |
---|
31 | | - | let l = d.payments[0] |
---|
32 | | - | let m = d.payments[0].assetId |
---|
33 | | - | if ((m != b)) |
---|
| 32 | + | func withdraw (m) = { |
---|
| 33 | + | let n = d.payments[0] |
---|
| 34 | + | let o = d.payments[0].assetId |
---|
| 35 | + | if ((o != b)) |
---|
34 | 36 | | then throw("Attach the correct LP token") |
---|
35 | 37 | | else { |
---|
36 | | - | let n = (l.amount - k) |
---|
37 | | - | if ((0 > k)) |
---|
| 38 | + | let p = (n.amount - m) |
---|
| 39 | + | if ((0 > m)) |
---|
38 | 40 | | then throw("Can't withdraw negative amount") |
---|
39 | | - | else if ((0 > n)) |
---|
| 41 | + | else if ((0 > p)) |
---|
40 | 42 | | then throw("Not enough balance") |
---|
41 | 43 | | else { |
---|
42 | | - | let o = Burn(b, k) |
---|
43 | | - | let j = ScriptTransfer(d.caller, n, a) |
---|
44 | | - | [o, j] |
---|
| 44 | + | let q = Burn(b, m) |
---|
| 45 | + | let l = ScriptTransfer(d.caller, p, a) |
---|
| 46 | + | [q, l] |
---|
45 | 47 | | } |
---|
46 | 48 | | } |
---|
47 | 49 | | } |
---|
48 | 50 | | |
---|
49 | 51 | | |
---|
50 | | - | @Verifier(p) |
---|
51 | | - | func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey) |
---|
| 52 | + | @Verifier(r) |
---|
| 53 | + | func s () = sigVerify(r.bodyBytes, r.proofs[0], r.senderPublicKey) |
---|
52 | 54 | | |
---|