4 | | - | let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' |
---|
5 | | - | |
---|
6 | | - | let USDC = base58'6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ' |
---|
7 | | - | |
---|
8 | | - | let meAddress = Address(base58'3P339sQ6rBBSUxAJheEvpEm77htQCsJBnzy') |
---|
9 | | - | |
---|
10 | | - | let adminAddress = Address(base58'3PKG6HpECVsPpGHoQyyE66wdEKfZLpbHxpn') |
---|
11 | | - | |
---|
12 | | - | let viresMainAddress = Address(base58'3PAZv9tgK1PX7dKR7b4kchq5qdpUS3G5sYT') |
---|
13 | | - | |
---|
14 | | - | let viresUsdcAddress = Address(base58'3PGCkrHBxFMi7tz1xqnxgBpeNvn5E4M4g8S') |
---|
15 | | - | |
---|
16 | | - | let viresVestingUsdnMainAddress = Address(base58'3PCbvPVQfSvVu88ip8Fm5YjwJhjEYk1Txhk') |
---|
17 | | - | |
---|
18 | | - | @Callable(i) |
---|
19 | | - | func test () = if ((i.caller != adminAddress)) |
---|
20 | | - | then throw("only admin can do") |
---|
21 | | - | else { |
---|
22 | | - | let invokeImportUsdcLp = invoke(viresMainAddress, "replenishWithAtoken", nil, i.payments) |
---|
23 | | - | if ((invokeImportUsdcLp == invokeImportUsdcLp)) |
---|
24 | | - | then { |
---|
25 | | - | let invokeToVesting = invoke(viresVestingUsdnMainAddress, "convertToUSDN", nil, nil) |
---|
26 | | - | if ((invokeToVesting == invokeToVesting)) |
---|
27 | | - | then [IntegerEntry("zz", 0)] |
---|
28 | | - | else throw("Strict value is not equal to itself. - 3") |
---|
29 | | - | } |
---|
30 | | - | else throw("Strict value is not equal to itself. - 2") |
---|
31 | | - | } |
---|
32 | | - | |
---|
36 | | - | func usdn_100_with_import () = if ((i.caller != adminAddress)) |
---|
37 | | - | then throw("only admin can do") |
---|
38 | | - | else { |
---|
39 | | - | let invokeImportUsdcLp = invoke(viresMainAddress, "replenishWithAtoken", nil, i.payments) |
---|
40 | | - | if ((invokeImportUsdcLp == invokeImportUsdcLp)) |
---|
41 | | - | then { |
---|
42 | | - | let invokeToVesting = invoke(viresVestingUsdnMainAddress, "convertToUSDN", nil, nil) |
---|
43 | | - | if ((invokeToVesting == invokeToVesting)) |
---|
44 | | - | then { |
---|
45 | | - | let inv = invoke(viresVestingUsdnMainAddress, "withdrawVestedAllUSDN", [false, true], nil) |
---|
46 | | - | if ((inv == inv)) |
---|
47 | | - | then { |
---|
48 | | - | let usdnAmountAfterWithdraw = assetBalance(this, USDN) |
---|
49 | | - | if ((usdnAmountAfterWithdraw == usdnAmountAfterWithdraw)) |
---|
50 | | - | then [ScriptTransfer(meAddress, usdnAmountAfterWithdraw, USDN)] |
---|
51 | | - | else throw("Strict value is not equal to itself. - 5") |
---|
52 | | - | } |
---|
53 | | - | else throw("Strict value is not equal to itself. - 4") |
---|
54 | | - | } |
---|
55 | | - | else throw("Strict value is not equal to itself. - 3") |
---|
56 | | - | } |
---|
57 | | - | else throw("Strict value is not equal to itself. - 2") |
---|
58 | | - | } |
---|
59 | | - | |
---|
60 | | - | |
---|
61 | | - | |
---|
62 | | - | @Callable(i) |
---|
63 | | - | func usdc_100_with_import () = if ((i.caller != adminAddress)) |
---|
64 | | - | then throw("only admin can do") |
---|
65 | | - | else { |
---|
66 | | - | let scBalance = assetBalance(viresUsdcAddress, USDC) |
---|
67 | | - | if ((100000000 > scBalance)) |
---|
68 | | - | then throw("no usdc in pool") |
---|
69 | | - | else { |
---|
70 | | - | let invokeImportUsdcLp = invoke(viresMainAddress, "replenishWithAtoken", nil, i.payments) |
---|
71 | | - | if ((invokeImportUsdcLp == invokeImportUsdcLp)) |
---|
72 | | - | then { |
---|
73 | | - | let inv = invoke(viresMainAddress, "withdraw", [toBase58String(USDC), -1], nil) |
---|
74 | | - | if ((inv == inv)) |
---|
75 | | - | then { |
---|
76 | | - | let usdcAmountAfterWithdraw = assetBalance(this, USDC) |
---|
77 | | - | if ((usdcAmountAfterWithdraw == usdcAmountAfterWithdraw)) |
---|
78 | | - | then [ScriptTransfer(meAddress, usdcAmountAfterWithdraw, USDC)] |
---|
79 | | - | else throw("Strict value is not equal to itself. - 7") |
---|
80 | | - | } |
---|
81 | | - | else throw("Strict value is not equal to itself. - 8") |
---|
82 | | - | } |
---|
83 | | - | else throw("Strict value is not equal to itself. - 6") |
---|
84 | | - | } |
---|
85 | | - | } |
---|
86 | | - | |
---|
87 | | - | |
---|
88 | | - | |
---|
89 | | - | @Callable(i) |
---|
90 | | - | func dddd_with_import () = if ((i.caller != adminAddress)) |
---|
91 | | - | then throw("only admin can do") |
---|
92 | | - | else { |
---|
93 | | - | let scBalance = assetBalance(viresUsdcAddress, USDC) |
---|
94 | | - | if ((100000000 > scBalance)) |
---|
95 | | - | then { |
---|
96 | | - | let invokeImportUsdcLp = invoke(viresMainAddress, "replenishWithAtoken", nil, i.payments) |
---|
97 | | - | if ((invokeImportUsdcLp == invokeImportUsdcLp)) |
---|
98 | | - | then { |
---|
99 | | - | let invokeToVesting = invoke(viresVestingUsdnMainAddress, "convertToUSDN", nil, nil) |
---|
100 | | - | if ((invokeToVesting == invokeToVesting)) |
---|
101 | | - | then { |
---|
102 | | - | let inv = invoke(viresVestingUsdnMainAddress, "withdrawVestedAllUSDN", [false, true], nil) |
---|
103 | | - | if ((inv == inv)) |
---|
104 | | - | then { |
---|
105 | | - | let usdnAmountAfterWithdraw = assetBalance(this, USDN) |
---|
106 | | - | if ((usdnAmountAfterWithdraw == usdnAmountAfterWithdraw)) |
---|
107 | | - | then [ScriptTransfer(meAddress, usdnAmountAfterWithdraw, USDN)] |
---|
108 | | - | else throw("Strict value is not equal to itself. - 5") |
---|
109 | | - | } |
---|
110 | | - | else throw("Strict value is not equal to itself. - 4") |
---|
111 | | - | } |
---|
112 | | - | else throw("Strict value is not equal to itself. - 3") |
---|
113 | | - | } |
---|
114 | | - | else throw("Strict value is not equal to itself. - 2") |
---|
115 | | - | } |
---|
116 | | - | else { |
---|
117 | | - | let invokeImportUsdcLp = invoke(viresMainAddress, "replenishWithAtoken", nil, i.payments) |
---|
118 | | - | if ((invokeImportUsdcLp == invokeImportUsdcLp)) |
---|
119 | | - | then { |
---|
120 | | - | let inv = invoke(viresMainAddress, "withdraw", [toBase58String(USDC), -1], nil) |
---|
121 | | - | if ((inv == inv)) |
---|
122 | | - | then { |
---|
123 | | - | let usdcAmountAfterWithdraw = assetBalance(this, USDC) |
---|
124 | | - | if ((usdcAmountAfterWithdraw == usdcAmountAfterWithdraw)) |
---|
125 | | - | then [ScriptTransfer(meAddress, usdcAmountAfterWithdraw, USDC)] |
---|
126 | | - | else throw("Strict value is not equal to itself. - 7") |
---|
127 | | - | } |
---|
128 | | - | else throw("Strict value is not equal to itself. - 8") |
---|
129 | | - | } |
---|
130 | | - | else throw("Strict value is not equal to itself. - 6") |
---|
131 | | - | } |
---|
132 | | - | } |
---|
| 7 | + | func test (num) = $Tuple2([IntegerEntry("key2", 42)], unit) |
---|