Skip to content

Commit 6c9a1d7

Browse files
committed
cli: print function hashes task
1 parent 7f811fb commit 6c9a1d7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tasks/contracts/functions.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'
44
import '@nomiclabs/hardhat-ethers'
55

66
import { loadEnv } from '../../cli/env'
7+
import { cliOpts } from '../../cli/defaults'
78

8-
task('contracts:functions', 'Print function hashes for contracts').setAction(
9-
async (taskArgs, hre: HardhatRuntimeEnvironment) => {
9+
task('contracts:functions', 'Print function hashes for contracts')
10+
.addParam('addressBook', cliOpts.addressBook.description, cliOpts.addressBook.default)
11+
.setAction(async (taskArgs, hre: HardhatRuntimeEnvironment) => {
1012
const accounts = await hre.ethers.getSigners()
1113
const env = await loadEnv(taskArgs, accounts[0] as unknown as Wallet)
1214

@@ -17,5 +19,4 @@ task('contracts:functions', 'Print function hashes for contracts').setAction(
1719
console.log(fnSig, '->', hre.ethers.utils.id(fnSig).slice(0, 10))
1820
}
1921
}
20-
},
21-
)
22+
})

tasks/gre.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Contract, providers, Signer } from 'ethers'
1+
import { Contract } from 'ethers'
22
import { HardhatRuntimeEnvironment } from 'hardhat/types'
33
import { extendEnvironment } from 'hardhat/config'
44
import { lazyObject } from 'hardhat/plugins'

0 commit comments

Comments
 (0)