1 | | - | {-# STDLIB_VERSION 5 #-} |
---|
2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let a = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' |
---|
5 | | - | |
---|
6 | | - | let b = base58'zMoz8KokhTvMU6GosBdAHrWfg8aCWSpP1nBigwwi63D' |
---|
7 | | - | |
---|
8 | | - | let c = base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz' |
---|
9 | | - | |
---|
10 | | - | let d = false |
---|
11 | | - | |
---|
12 | | - | let e = "STAKED_LP" |
---|
13 | | - | |
---|
14 | | - | let f = "From_Compound" |
---|
15 | | - | |
---|
16 | | - | @Callable(g) |
---|
17 | | - | func stake () = { |
---|
18 | | - | let h = value(g.payments[0]) |
---|
19 | | - | let i = h.amount |
---|
20 | | - | if ((h.assetId != a)) |
---|
21 | | - | then throw("attach USDTUSDNLP tokens only") |
---|
22 | | - | else if (d) |
---|
23 | | - | then throw("smart contract is on lock") |
---|
24 | | - | else { |
---|
25 | | - | let j = valueOrElse(getInteger(this, e), 0) |
---|
26 | | - | if ((j == j)) |
---|
27 | | - | then { |
---|
28 | | - | let k = IntegerEntry(e, (j + g.payments[0].amount)) |
---|
29 | | - | if ((k == k)) |
---|
30 | | - | then if ((k == k)) |
---|
31 | | - | then { |
---|
32 | | - | let l = { |
---|
33 | | - | let m = assetInfo(b) |
---|
34 | | - | if ($isInstanceOf(m, "Asset")) |
---|
35 | | - | then { |
---|
36 | | - | let n = m |
---|
37 | | - | n.quantity |
---|
38 | | - | } |
---|
39 | | - | else throw("Can't find asset") |
---|
40 | | - | } |
---|
41 | | - | let o = (((j + assetBalance(this, a)) + i) - i) |
---|
42 | | - | let p = fraction(l, 100000000, o) |
---|
43 | | - | let q = fraction(i, p, 100000000) |
---|
44 | | - | let r = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [h]) |
---|
45 | | - | if ((r == r)) |
---|
46 | | - | then { |
---|
47 | | - | let s = Reissue(b, q, true) |
---|
48 | | - | let t = ScriptTransfer(g.caller, q, b) |
---|
49 | | - | [s, t] |
---|
50 | | - | } |
---|
51 | | - | else throw("Strict value is not equal to itself.") |
---|
52 | | - | } |
---|
53 | | - | else throw("Strict value is not equal to itself.") |
---|
54 | | - | else throw("Strict value is not equal to itself.") |
---|
55 | | - | } |
---|
56 | | - | else throw("Strict value is not equal to itself.") |
---|
57 | | - | } |
---|
58 | | - | } |
---|
59 | | - | |
---|
60 | | - | |
---|
61 | | - | |
---|
62 | | - | @Callable(g) |
---|
63 | | - | func compound () = { |
---|
64 | | - | let u = value(g.payments[0]) |
---|
65 | | - | let v = u.amount |
---|
66 | | - | if ((u.assetId != a)) |
---|
67 | | - | then throw("attach USDTUSDNLP tokens only") |
---|
68 | | - | else { |
---|
69 | | - | let w = valueOrElse(getInteger(this, f), 0) |
---|
70 | | - | let x = valueOrElse(getInteger(this, e), 0) |
---|
71 | | - | let k = IntegerEntry(e, (x + g.payments[0].amount)) |
---|
72 | | - | if ((k == k)) |
---|
73 | | - | then { |
---|
74 | | - | let y = IntegerEntry(f, (w + v)) |
---|
75 | | - | if ((y == y)) |
---|
76 | | - | then [k, y] |
---|
77 | | - | else throw("Strict value is not equal to itself.") |
---|
78 | | - | } |
---|
79 | | - | else throw("Strict value is not equal to itself.") |
---|
80 | | - | } |
---|
81 | | - | } |
---|
82 | | - | |
---|
83 | | - | |
---|
| 1 | + | # no script |
---|