Skip to content

Commit

Permalink
fix: Handle case of multiple deployments on a single address (Proxy)
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Jan 9, 2024
1 parent c72350e commit e86b8b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/devtools-evm-hardhat/src/omnigraph/coordinates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ export const createContractFactory = (environmentFactory = createGetHreByEid()):

// And if we only have the address, we need to go get it from deployments by address
if (address != null) {
const [deployment] = await env.deployments.getDeploymentsFromAddress(address)
assert(deployment != null, `Could not find a deployment for address '${address}'`)
const deployments = await env.deployments.getDeploymentsFromAddress(address)
assert(deployments.length > 0, `Could not find a deployment for address '${address}'`)

return omniDeploymentToContract({ eid, deployment })
const abis = deployments.flatMap((deployment) => deployment.abi)
return { eid, contract: new Contract(address, abis) }
}

assert(false, 'At least one of contractName, address must be specified for OmniPointHardhat')
Expand Down

0 comments on commit e86b8b4

Please sign in to comment.