Skip to content

Commit

Permalink
move cancel script from tasks to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Dec 1, 2023
1 parent fc7d243 commit 9cbfa08
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 17 deletions.
36 changes: 36 additions & 0 deletions contracts/cli/cancelRound.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Cancel the current round
*
* Sample usage:
* HARDHAT_NETWORK=localhost yarn ts-node cli/cancelRound.ts <ClrFund address>
*/
import { ethers, network } from 'hardhat'
import { program } from 'commander'

program
.description('Cancel the current round')
.argument('clrfund', 'The ClrFund contract address')
.parse()

async function main(args: any) {
const [deployer] = await ethers.getSigners()
console.log('deployer', deployer.address)
console.log('network', network.name)

const clrfundContract = await ethers.getContractAt(
'ClrFund',
args[0],
deployer
)

const cancelTx = await clrfundContract.cancelCurrentRound()
await cancelTx.wait()
console.log('Cancel transaction hash: ', cancelTx.hash)
}

main(program.args)
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})
17 changes: 0 additions & 17 deletions contracts/tasks/cancelRound.ts

This file was deleted.

0 comments on commit 9cbfa08

Please sign in to comment.