tx · 9NnHueLGEi62d3ggwunUKwNLujFro7PbZXVTLqLSZzRE 3MwBGvHwMsCkfpjNczpKyPwjZn8kguZc1aT: -0.04000000 Waves 2022.05.19 12:21 [2058371] smart account 3MwBGvHwMsCkfpjNczpKyPwjZn8kguZc1aT > SELF 0.00000000 Waves
{ "type": 13, "id": "9NnHueLGEi62d3ggwunUKwNLujFro7PbZXVTLqLSZzRE", "fee": 4000000, "feeAssetId": null, "timestamp": 1652952070566, "version": 2, "chainId": 84, "sender": "3MwBGvHwMsCkfpjNczpKyPwjZn8kguZc1aT", "senderPublicKey": "HR6KqHHmjzGx8fdbFkG9LMHCiNx2t8ExYHP5fWMomCJu", "proofs": [ "4DoL1m8u6W5jHiSarZDUwyBxpzSrXBDXm849TiAmAULtWtLS2cTn96QdwBWZxf8sXoxRzJieoB83mC3npcntbQDz" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAFAAAAAAV0b2tlbgEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAABWxwVENJAQAAACAaMxpM7J2AkwQeyUXAgj0RTdaP0uNhJJ62DJZuUfMG8AAAAAAJaXNTdG9wcGVkBwAAAAAJa2V5U3Rha2VkAgAAAAlTVEFLRURfTFAAAAAAC2tleUNvbXBvdW5kAgAAAA1Gcm9tX0NvbXBvdW5kAAAAAgAAAAFpAQAAAAVzdGFrZQAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJcG10QW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAFdG9rZW4JAAACAAAAAQIAAAAdYXR0YWNoIFVTRFRVU0ROTFAgdG9rZW5zIG9ubHkDBQAAAAlpc1N0b3BwZWQJAAACAAAAAQIAAAAZc21hcnQgY29udHJhY3QgaXMgb24gbG9jawQAAAAIdGtTdGFr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lU3RhdGUJAARMAAAAAgUAAAACdGMFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAigQwGA==", "height": 2058371, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4W9v1aAwno6c7kkZTit8tQjP9RXckV8hADLjFr4s4fiX Next: GLQGCerPZxBeq6T51izriESQFkkfBux6QFDu22QfovYb Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | let k = IntegerEntry(d, (i + f.payments[0].amount)) | |
26 | 26 | if ((k == k)) | |
27 | 27 | then { | |
28 | - | let l = { | |
29 | - | let m = assetInfo(b) | |
30 | - | if ($isInstanceOf(m, "Asset")) | |
31 | - | then { | |
32 | - | let n = m | |
33 | - | n.quantity | |
34 | - | } | |
35 | - | else throw("Can't find asset") | |
36 | - | } | |
37 | - | let o = (i + assetBalance(this, a)) | |
38 | - | let p = fraction(l, 100000000, o) | |
39 | - | let q = fraction(h, p, 100000000) | |
40 | - | let r = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [g]) | |
41 | - | if ((r == r)) | |
28 | + | let l = (i - j) | |
29 | + | let m = fraction(l, 100000000, i) | |
30 | + | let n = fraction(h, m, 100000000) | |
31 | + | let o = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [g]) | |
32 | + | if ((o == o)) | |
42 | 33 | then { | |
43 | - | let | |
44 | - | let | |
45 | - | [ | |
34 | + | let p = Reissue(b, n, true) | |
35 | + | let q = ScriptTransfer(f.caller, n, b) | |
36 | + | [p, q, k] | |
46 | 37 | } | |
47 | 38 | else throw("Strict value is not equal to itself.") | |
48 | 39 | } | |
54 | 45 | ||
55 | 46 | @Callable(f) | |
56 | 47 | func compound () = { | |
57 | - | let | |
58 | - | let | |
59 | - | if (( | |
48 | + | let r = value(f.payments[0]) | |
49 | + | let s = r.amount | |
50 | + | if ((r.assetId != a)) | |
60 | 51 | then throw("attach USDTUSDNLP tokens only") | |
61 | 52 | else { | |
62 | 53 | let j = valueOrElse(getInteger(this, e), 0) | |
63 | - | let | |
64 | - | let | |
65 | - | if (( | |
54 | + | let t = valueOrElse(getInteger(this, d), 0) | |
55 | + | let u = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [r]) | |
56 | + | if ((u == u)) | |
66 | 57 | then { | |
67 | - | let k = IntegerEntry(d, ( | |
68 | - | let | |
69 | - | [k, | |
58 | + | let k = IntegerEntry(d, (t + s)) | |
59 | + | let v = IntegerEntry(e, (j + s)) | |
60 | + | [k, v] | |
70 | 61 | } | |
71 | 62 | else throw("Strict value is not equal to itself.") | |
72 | 63 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' | |
5 | 5 | ||
6 | 6 | let b = base58'2mGo9byNgTSxPC4J8wXkGkdjhB3Tk3gjGYiiHsyCrnHd' | |
7 | 7 | ||
8 | 8 | let c = false | |
9 | 9 | ||
10 | 10 | let d = "STAKED_LP" | |
11 | 11 | ||
12 | 12 | let e = "From_Compound" | |
13 | 13 | ||
14 | 14 | @Callable(f) | |
15 | 15 | func stake () = { | |
16 | 16 | let g = value(f.payments[0]) | |
17 | 17 | let h = g.amount | |
18 | 18 | if ((g.assetId != a)) | |
19 | 19 | then throw("attach USDTUSDNLP tokens only") | |
20 | 20 | else if (c) | |
21 | 21 | then throw("smart contract is on lock") | |
22 | 22 | else { | |
23 | 23 | let i = valueOrElse(getInteger(this, d), 0) | |
24 | 24 | let j = valueOrElse(getInteger(this, e), 0) | |
25 | 25 | let k = IntegerEntry(d, (i + f.payments[0].amount)) | |
26 | 26 | if ((k == k)) | |
27 | 27 | then { | |
28 | - | let l = { | |
29 | - | let m = assetInfo(b) | |
30 | - | if ($isInstanceOf(m, "Asset")) | |
31 | - | then { | |
32 | - | let n = m | |
33 | - | n.quantity | |
34 | - | } | |
35 | - | else throw("Can't find asset") | |
36 | - | } | |
37 | - | let o = (i + assetBalance(this, a)) | |
38 | - | let p = fraction(l, 100000000, o) | |
39 | - | let q = fraction(h, p, 100000000) | |
40 | - | let r = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [g]) | |
41 | - | if ((r == r)) | |
28 | + | let l = (i - j) | |
29 | + | let m = fraction(l, 100000000, i) | |
30 | + | let n = fraction(h, m, 100000000) | |
31 | + | let o = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [g]) | |
32 | + | if ((o == o)) | |
42 | 33 | then { | |
43 | - | let | |
44 | - | let | |
45 | - | [ | |
34 | + | let p = Reissue(b, n, true) | |
35 | + | let q = ScriptTransfer(f.caller, n, b) | |
36 | + | [p, q, k] | |
46 | 37 | } | |
47 | 38 | else throw("Strict value is not equal to itself.") | |
48 | 39 | } | |
49 | 40 | else throw("Strict value is not equal to itself.") | |
50 | 41 | } | |
51 | 42 | } | |
52 | 43 | ||
53 | 44 | ||
54 | 45 | ||
55 | 46 | @Callable(f) | |
56 | 47 | func compound () = { | |
57 | - | let | |
58 | - | let | |
59 | - | if (( | |
48 | + | let r = value(f.payments[0]) | |
49 | + | let s = r.amount | |
50 | + | if ((r.assetId != a)) | |
60 | 51 | then throw("attach USDTUSDNLP tokens only") | |
61 | 52 | else { | |
62 | 53 | let j = valueOrElse(getInteger(this, e), 0) | |
63 | - | let | |
64 | - | let | |
65 | - | if (( | |
54 | + | let t = valueOrElse(getInteger(this, d), 0) | |
55 | + | let u = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [r]) | |
56 | + | if ((u == u)) | |
66 | 57 | then { | |
67 | - | let k = IntegerEntry(d, ( | |
68 | - | let | |
69 | - | [k, | |
58 | + | let k = IntegerEntry(d, (t + s)) | |
59 | + | let v = IntegerEntry(e, (j + s)) | |
60 | + | [k, v] | |
70 | 61 | } | |
71 | 62 | else throw("Strict value is not equal to itself.") | |
72 | 63 | } | |
73 | 64 | } | |
74 | 65 | ||
75 | 66 |
github/deemru/w8io/169f3d6 37.84 ms ◑