tx · 7HCRuE2DP5vSFikVuguGGsiFJ1XK6ZYprrtsTTQe5BtK

3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH:  -0.04000000 Waves

2022.04.18 10:00 [2013670] smart account 3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH > SELF 0.00000000 Waves

{ "type": 13, "id": "7HCRuE2DP5vSFikVuguGGsiFJ1XK6ZYprrtsTTQe5BtK", "fee": 4000000, "feeAssetId": null, "timestamp": 1650265287455, "version": 2, "chainId": 84, "sender": "3Mv7nXq2V2Dnn9oSkB5feRt6RxtqnPiAXNH", "senderPublicKey": "HJ4JLtArYaaiBiWho6gzLRbKUVM6ZVTaKmci6sgFQtEm", "proofs": [ "35s6xF7AHswp7Ghp7KsPQKFQFAsJFoUyVEDneWAemuhJnCtxFCNq8yxaSJPPeMWFJ5vWhavh9HVmcHDuqXoRXu6d" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAADAAAAAAJJRAEAAAAg/xBHdpoc7iAAQfoZXdECvjjJUsHBvTbctJWSuRHjmWIAAAAAAkxQAQAAACBUgJin8ZP4V+99JlgBkqGEJd4kKpy7bL9Mn0vxHVzLPwAAAAAJaXNTdG9wcGVkBwAAAAIAAAABaQEAAAAFc3Rha2UAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACXBtdEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAAklECQAAAgAAAAECAAAAG2F0dGFjaCB0ZXN0TlNCVCB0b2tlbnMgb25seQMFAAAACWlzU3RvcHBlZAkAAAIAAAABAgAAABlzbWFydCBjb250cmFjdCBpcyBvbiBsb2NrBAAAAAppblRyZWFzdXJ5CQAD8AAAAAIFAAAABHRoaXMFAAAAAklEBAAAAAt0b3RhbElzc3VlZAQAAAAHJG1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AAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQQAAAAHYnVybmluZwkBAAAABEJ1cm4AAAACBQAAAAJMUAUAAAAGYW1vdW50BAAAAAh0cmFuc2ZlcgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAluZXdBbW91bnQFAAAAAklECQAETAAAAAIFAAAAB2J1cm5pbmcJAARMAAAAAgUAAAAIdHJhbnNmZXIFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5fHwypQ==", "height": 2013670, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6UfGU89WwsCryPsbYcBcbf5XSm44VCgppWXiQfx6q7EN Next: 57Q27YXxqoJ7a2NsEPnEoiYx9yiigVAtAcFPy6fuZjWw Diff:
OldNewDifferences
2626 }
2727 else throw("Can't find asset")
2828 }
29- let k = fraction(h, 100000000, g)
30- let l = fraction(f, k, 100000000)
31- let m = Reissue(b, l, true)
32- let n = ScriptTransfer(d.caller, l, b)
33-[m, n]
29+ let k = (g - f)
30+ let l = fraction(h, 100000000, k)
31+ let m = fraction(f, l, 100000000)
32+ let n = Reissue(b, m, true)
33+ let o = ScriptTransfer(d.caller, m, b)
34+[n, o]
3435 }
3536 }
3637
3738
3839
3940 @Callable(d)
40-func withdraw (o) = {
41- let p = d.payments[0]
42- let q = d.payments[0].assetId
43- if ((q != b))
41+func withdraw (p) = {
42+ let q = d.payments[0]
43+ let r = d.payments[0].assetId
44+ if ((r != b))
4445 then throw("Attach the correct LP token")
4546 else {
46- let r = (p.amount - o)
47- if ((0 > o))
47+ let s = (q.amount - p)
48+ if ((0 > p))
4849 then throw("Can't withdraw negative amount")
49- else if ((0 > r))
50+ else if ((0 > s))
5051 then throw("Not enough balance")
5152 else {
52- let s = Burn(b, o)
53- let n = ScriptTransfer(d.caller, r, a)
54-[s, n]
53+ let t = Burn(b, p)
54+ let o = ScriptTransfer(d.caller, s, a)
55+[t, o]
5556 }
5657 }
5758 }
5859
5960
60-@Verifier(t)
61-func u () = sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey)
61+@Verifier(u)
62+func v () = sigVerify(u.bodyBytes, u.proofs[0], u.senderPublicKey)
6263
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh'
55
66 let b = base58'6gryiTrJoLkNzBtZLVBuCyCvnxPY77TVUS2ouYYjjVTU'
77
88 let c = false
99
1010 @Callable(d)
1111 func stake () = {
1212 let e = value(d.payments[0])
1313 let f = e.amount
1414 if ((e.assetId != a))
1515 then throw("attach testNSBT tokens only")
1616 else if (c)
1717 then throw("smart contract is on lock")
1818 else {
1919 let g = assetBalance(this, a)
2020 let h = {
2121 let i = assetInfo(b)
2222 if ($isInstanceOf(i, "Asset"))
2323 then {
2424 let j = i
2525 j.quantity
2626 }
2727 else throw("Can't find asset")
2828 }
29- let k = fraction(h, 100000000, g)
30- let l = fraction(f, k, 100000000)
31- let m = Reissue(b, l, true)
32- let n = ScriptTransfer(d.caller, l, b)
33-[m, n]
29+ let k = (g - f)
30+ let l = fraction(h, 100000000, k)
31+ let m = fraction(f, l, 100000000)
32+ let n = Reissue(b, m, true)
33+ let o = ScriptTransfer(d.caller, m, b)
34+[n, o]
3435 }
3536 }
3637
3738
3839
3940 @Callable(d)
40-func withdraw (o) = {
41- let p = d.payments[0]
42- let q = d.payments[0].assetId
43- if ((q != b))
41+func withdraw (p) = {
42+ let q = d.payments[0]
43+ let r = d.payments[0].assetId
44+ if ((r != b))
4445 then throw("Attach the correct LP token")
4546 else {
46- let r = (p.amount - o)
47- if ((0 > o))
47+ let s = (q.amount - p)
48+ if ((0 > p))
4849 then throw("Can't withdraw negative amount")
49- else if ((0 > r))
50+ else if ((0 > s))
5051 then throw("Not enough balance")
5152 else {
52- let s = Burn(b, o)
53- let n = ScriptTransfer(d.caller, r, a)
54-[s, n]
53+ let t = Burn(b, p)
54+ let o = ScriptTransfer(d.caller, s, a)
55+[t, o]
5556 }
5657 }
5758 }
5859
5960
60-@Verifier(t)
61-func u () = sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey)
61+@Verifier(u)
62+func v () = sigVerify(u.bodyBytes, u.proofs[0], u.senderPublicKey)
6263

github/deemru/w8io/169f3d6 
43.29 ms