Skip to content

Commit

Permalink
cli: print function hashes task
Browse files Browse the repository at this point in the history
  • Loading branch information
abarmat committed Jul 4, 2021
1 parent 7f811fb commit 6c9a1d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions tasks/contracts/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'
import '@nomiclabs/hardhat-ethers'

import { loadEnv } from '../../cli/env'
import { cliOpts } from '../../cli/defaults'

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

Expand All @@ -17,5 +19,4 @@ task('contracts:functions', 'Print function hashes for contracts').setAction(
console.log(fnSig, '->', hre.ethers.utils.id(fnSig).slice(0, 10))
}
}
},
)
})
2 changes: 1 addition & 1 deletion tasks/gre.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Contract, providers, Signer } from 'ethers'
import { Contract } from 'ethers'
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import { extendEnvironment } from 'hardhat/config'
import { lazyObject } from 'hardhat/plugins'
Expand Down

0 comments on commit 6c9a1d7

Please sign in to comment.