Skip to content

Commit

Permalink
fix(pg): fix minor bugs when importing OpenZeppelin storage layout
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-goldman committed Apr 9, 2023
1 parent ba246c5 commit 011f0f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-beans-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chugsplash/plugins': patch
---

Fix minor bugs when importing OpenZeppelin storage layout
7 changes: 5 additions & 2 deletions packages/plugins/src/hardhat/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
getEIP1967ProxyImplementationAddress,
BuildInfo,
ParsedContractConfig,
toOpenZeppelinContractKind,
} from '@chugsplash/core'
import {
Manifest,
Expand Down Expand Up @@ -109,13 +110,15 @@ export const importOpenZeppelinStorageLayout = async (
kind === 'oz-access-control-uups'
) {
const proxy = parsedContractConfig.proxy
const isProxyDeployed = await hre.ethers.provider.getCode(proxy)
const isProxyDeployed = (await hre.ethers.provider.getCode(proxy)) !== '0x'
if (isProxyDeployed) {
const manifest = await Manifest.forNetwork(hre.network.provider)
const deployData = await getDeployData(
hre,
await hre.ethers.getContractFactory(parsedContractConfig.contract),
withValidationDefaults({})
withValidationDefaults({
kind: toOpenZeppelinContractKind(kind),
})
)
const storageLayout = await getStorageLayoutForAddress(
manifest,
Expand Down

0 comments on commit 011f0f6

Please sign in to comment.