-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvenus
executable file
·54 lines (52 loc) · 1.37 KB
/
venus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env node
function configureNetwork({ network, block }) {
process.env.HARDHAT_NETWORK = network;
if (block !== "latest" && network !== "hardhat") {
throw new Error("Forking is only supported for hardhat network");
}
process.env.SIM_BLOCK_NUMBER = block;
}
require("yargs/yargs")(process.argv.slice(2))
.command(
"get-reserves <outputFile>",
"Get the reserves snapshot",
(yargs) => {
yargs.positional('outputFile', {
describe: 'Either .csv or .json file to write the output to',
type: 'string',
default: 'reserves.csv'
})
},
(argv) => {
configureNetwork(argv);
const { getReserves } = require("./src/commands/getReserves");
getReserves(argv.outputFile)
}
)
.command(
"get-treasury-vtokens <outputFile>",
"Get the reserves snapshot",
(yargs) => {
yargs.positional('outputFile', {
describe: 'Either .csv or .json file to write the output to',
type: 'string',
default: 'treasuryVTokens.csv'
})
},
(argv) => {
configureNetwork(argv);
const { getTreasuryVTokens } = require("./src/commands/getTreasuryVTokens");
getTreasuryVTokens(argv.outputFile)
}
)
.option("n", {
alias: "network",
default: "hardhat"
})
.option("b", {
alias: "block",
default: "latest"
})
.demandCommand()
.help()
.argv