Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: read config without metadata on verifyAll #912

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions packages/contracts/tasks/verify/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GRE_TASK_PARAMS } from '@graphprotocol/sdk/gre'
import fs from 'fs'
import path from 'path'
import { HardhatRuntimeEnvironment } from 'hardhat/types/runtime'
import { getContractConfig } from '@graphprotocol/sdk'
import { getContractConfig, readConfig } from '@graphprotocol/sdk'

task('sourcify', 'Verifies contract on sourcify')
.addPositionalParam('address', 'Address of the smart contract to verify', undefined, types.string)
Expand Down Expand Up @@ -94,20 +94,16 @@ task('verifyAll', 'Verifies all contracts on etherscan')
}

console.log(`> Verifying all contracts on chain ${chainName}[${chainId}]...`)
const { addressBook, graphConfig, getDeployer } = hre.graph({
const { addressBook, getDeployer } = hre.graph({
addressBook: args.addressBook,
graphConfig: args.graphConfig,
})

const graphConfig = readConfig(args.graphConfig, false)
const deployer = (await getDeployer()).address
for (const contractName of addressBook.listEntries()) {
console.log(`\n> Verifying contract ${contractName}...`)

const contractConfig = getContractConfig(
graphConfig,
addressBook,
contractName,
(await getDeployer()).address,
)
const contractConfig = getContractConfig(graphConfig, addressBook, contractName, deployer)
const contractPath = getContractPath(contractName)
const constructorParams = contractConfig.params.map((p) => p.value.toString())

Expand Down