tx · GDCV9izPX1v5AkRUCBmMpYN7L1mW6qmAMhFJ7eNA5pSp

3NCCpaecUeQcHCJGnv1ZocqT3xAz2wiXFwe:  -0.05000000 Waves

2022.05.11 12:17 [2046808] smart account 3NCCpaecUeQcHCJGnv1ZocqT3xAz2wiXFwe > SELF 0.00000000 Waves

{ "type": 13, "id": "GDCV9izPX1v5AkRUCBmMpYN7L1mW6qmAMhFJ7eNA5pSp", "fee": 5000000, "feeAssetId": null, "timestamp": 1652260734371, "version": 2, "chainId": 84, "sender": "3NCCpaecUeQcHCJGnv1ZocqT3xAz2wiXFwe", "senderPublicKey": "FX5ZmtqMuiefGRPoKkAcBUEDvaHBS4FSzt8VW49mzcjM", "proofs": [ "2Upf3B9A7muQvLUaFyWYyCMMBKT3Qbm6XSQgCzjvKksorhr3aL1dpAr4m2nYA9xJEu36jtu17YY472sEYsfm7Ksx" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAwAAAAACSUQBAAAAIP8QR3aaHO4gAEH6GV3RAr44yVLBwb023LSVkrkR45liAAAAAAJMUAEAAAAgf1BDCThONgyo3aXVGaZPHbvUVh7DJtZBDkYdxqjt6R0AAAAACWlzU3RvcHBlZAcAAAABAAAAAWkBAAAABXN0YWtlAAAAAAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAAlwbXRBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50BAAAAAlrZXlTdGFrZWQCAAAACVNUQUtFRF9MUAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAACSUQJAAACAAAAAQIAAAAbYXR0YWNoIHRlc3ROU0JUIHRva2VucyBvbmx5AwUAAAAJaXNTdG9wcGVkCQAAAgAAAAECAAAAGXNtYXJ0IGNvbnRyYWN0IGlzIG9uIGxvY2sEAAAACmluVHJlYXN1cnkJAAPwAAAAAgUAAAAEdGhpcwUAAAACSUQEAAAAC3RvdGFsSXNzdWVkBAAAAAckbWF0Y2gwCQAD7AAAAAEFAAAAAkxQAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAVBc3NldAQAAAAFYXNzZXQFAAAAByRtYXRjaDAIBQAAAAVhc3NldAAAAAhxdWFudGl0eQkAAAIAAAABAgAAABBDYW4ndCBmaW5kIGFzc2V0BAAAAAh0cmVhc3VyeQkAAGUAAAACBQAAAAppblRyZWFzdXJ5BQAAAAlwbXRBbW91bnQEAAAAD3NpbmdsZUxQaW5WYWx1ZQkAAGsAAAADBQAAAAt0b3RhbElzc3VlZAAAAAAABfXhAAUAAAAIdHJlYXN1cnkEAAAADWFtb3VudFRvSXNzdWUJAABrAAAAAwUAAAAJcG10QW1vdW50BQAAAA9zaW5nbGVMUGluVmFsdWUAAAAAAAX14QAEAAAAB0xQSXNzdWUJAQAAAAdSZWlzc3VlAAAAAwUAAAACTFAFAAAADWFtb3VudFRvSXNzdWUGBAAAAAh0cmFuc2ZlcgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA1hbW91bnRUb0lzc3VlBQAAAAJMUAQAAAAGc3Rha2VkCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAACWtleVN0YWtlZAAAAAAAAAAAAAQAAAALdXBkYXRlU3RhdGUJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAlrZXlTdGFrZWQJAABkAAAAAgUAAAAGc3Rha2VkCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQJAARMAAAAAgUAAAAHTFBJc3N1ZQkABEwAAAACBQAAAAh0cmFuc2ZlcgkABEwAAAACBQAAAAt1cGRhdGVTdGF0ZQUAAAADbmlsAAAAAN8Tomg=", "height": 2046808, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5fSgVcVzPT8PRVdxvmTKrjQWMwAT39wBLKU1w1aMeXGr Next: GHMshr3656d58JDiHN3buqoj8i2b6HwbyCJTkP8akYFe Diff:
OldNewDifferences
1111 func stake () = {
1212 let e = value(d.payments[0])
1313 let f = e.amount
14+ let g = "STAKED_LP"
1415 if ((e.assetId != a))
1516 then throw("attach testNSBT tokens only")
1617 else if (c)
1718 then throw("smart contract is on lock")
1819 else {
19- let g = assetBalance(this, a)
20- let h = {
21- let i = assetInfo(b)
22- if ($isInstanceOf(i, "Asset"))
20+ let h = assetBalance(this, a)
21+ let i = {
22+ let j = assetInfo(b)
23+ if ($isInstanceOf(j, "Asset"))
2324 then {
24- let j = i
25- j.quantity
25+ let k = j
26+ k.quantity
2627 }
2728 else throw("Can't find asset")
2829 }
29- let k = ((h * 100000000) / g)
30- let l = ((f * k) / 100000000)
31- let m = Reissue(b, l, true)
32- let n = ScriptTransfer(d.caller, l, b)
33-[m, n]
30+ let l = (h - f)
31+ let m = fraction(i, 100000000, l)
32+ let n = fraction(f, m, 100000000)
33+ let o = Reissue(b, n, true)
34+ let p = ScriptTransfer(d.caller, n, b)
35+ let q = valueOrElse(getInteger(this, g), 0)
36+ let r = IntegerEntry(g, (q + d.payments[0].amount))
37+[o, p, r]
3438 }
3539 }
3640
37-
38-
39-@Callable(d)
40-func withdraw (o) = {
41- let p = d.payments[0]
42- let q = d.payments[0].assetId
43- if ((q != b))
44- then throw("Attach the correct LP token")
45- else {
46- let r = (p.amount - o)
47- if ((0 > o))
48- then throw("Can't withdraw negative amount")
49- else if ((0 > r))
50- then throw("Not enough balance")
51- else {
52- let s = Burn(b, o)
53- let n = ScriptTransfer(d.caller, r, a)
54-[s, n]
55- }
56- }
57- }
58-
59-
60-@Verifier(t)
61-func u () = sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey)
6241
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'JAfMu2seKNzTVfqi5w5Pjh4kwwPTZPCEFpc2q2vDyFeh'
55
66 let b = base58'9ZymB4TJF6oQ3HwYgYFKizAf6m64sQF896mUzcsDJ4Wx'
77
88 let c = false
99
1010 @Callable(d)
1111 func stake () = {
1212 let e = value(d.payments[0])
1313 let f = e.amount
14+ let g = "STAKED_LP"
1415 if ((e.assetId != a))
1516 then throw("attach testNSBT tokens only")
1617 else if (c)
1718 then throw("smart contract is on lock")
1819 else {
19- let g = assetBalance(this, a)
20- let h = {
21- let i = assetInfo(b)
22- if ($isInstanceOf(i, "Asset"))
20+ let h = assetBalance(this, a)
21+ let i = {
22+ let j = assetInfo(b)
23+ if ($isInstanceOf(j, "Asset"))
2324 then {
24- let j = i
25- j.quantity
25+ let k = j
26+ k.quantity
2627 }
2728 else throw("Can't find asset")
2829 }
29- let k = ((h * 100000000) / g)
30- let l = ((f * k) / 100000000)
31- let m = Reissue(b, l, true)
32- let n = ScriptTransfer(d.caller, l, b)
33-[m, n]
30+ let l = (h - f)
31+ let m = fraction(i, 100000000, l)
32+ let n = fraction(f, m, 100000000)
33+ let o = Reissue(b, n, true)
34+ let p = ScriptTransfer(d.caller, n, b)
35+ let q = valueOrElse(getInteger(this, g), 0)
36+ let r = IntegerEntry(g, (q + d.payments[0].amount))
37+[o, p, r]
3438 }
3539 }
3640
37-
38-
39-@Callable(d)
40-func withdraw (o) = {
41- let p = d.payments[0]
42- let q = d.payments[0].assetId
43- if ((q != b))
44- then throw("Attach the correct LP token")
45- else {
46- let r = (p.amount - o)
47- if ((0 > o))
48- then throw("Can't withdraw negative amount")
49- else if ((0 > r))
50- then throw("Not enough balance")
51- else {
52- let s = Burn(b, o)
53- let n = ScriptTransfer(d.caller, r, a)
54-[s, n]
55- }
56- }
57- }
58-
59-
60-@Verifier(t)
61-func u () = sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey)
6241

github/deemru/w8io/026f985 
26.23 ms