-
Notifications
You must be signed in to change notification settings - Fork 1
/
parkRigs.ts
35 lines (30 loc) · 1003 Bytes
/
parkRigs.ts
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
import { ethers, network, rigsDeployment } from "hardhat";
import { TablelandRigs } from "../typechain-types";
async function main() {
console.log(`\nParking rigs on '${network.name}'...`);
// Get owner account
const [account] = await ethers.getSigners();
if (account.provider === undefined) {
throw Error("missing provider");
}
// Get contract address
if (rigsDeployment.contractAddress === "") {
throw Error(`no contractAddress entry for '${network.name}'`);
}
console.log(`Using address '${rigsDeployment.contractAddress}'`);
// Park rigs
const rigs = (await ethers.getContractFactory("TablelandRigs")).attach(
rigsDeployment.contractAddress
) as TablelandRigs;
const tx = await rigs.parkRigAsAdmin([
/* rigs IDs to park here */
]);
const receipt = await tx.wait();
console.log(`parked rigs with txn '${receipt.transactionHash}'`);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});