Skip to content

Commit

Permalink
fix(ct): fix build info export bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-goldman committed Nov 10, 2022
1 parent afe99ad commit 78acb9a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-ants-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chugsplash/contracts': patch
---

Fix build info export bug
14 changes: 14 additions & 0 deletions packages/contracts/src/ifaces.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as path from 'path'
import * as fs from 'fs'

/* eslint-disable @typescript-eslint/no-var-requires */
export const ChugSplashRegistryArtifact = require('../artifacts/contracts/ChugSplashRegistry.sol/ChugSplashRegistry.json')
export const ChugSplashBootLoaderArtifact = require('../artifacts/contracts/ChugSplashBootLoader.sol/ChugSplashBootLoader.json')
Expand All @@ -7,6 +10,17 @@ export const ProxyUpdaterArtifact = require('../artifacts/contracts/ProxyUpdater
export const DefaultAdapterArtifact = require('../artifacts/contracts/adapters/DefaultAdapter.sol/DefaultAdapter.json')
export const ProxyArtifact = require('../artifacts/contracts/libraries/Proxy.sol/Proxy.json')

const buildInfoFolderPath = path.join(
'..',
'contracts',
'artifacts',
'build-info'
)
const buildInfoFilePath = fs
.readdirSync(buildInfoFolderPath)
.map((file) => path.join(buildInfoFolderPath, file))[0]
export const buildInfo = JSON.parse(fs.readFileSync(buildInfoFilePath, 'utf8'))

export const ChugSplashRegistryABI = ChugSplashRegistryArtifact.abi
export const ChugSplashBootLoaderABI = ChugSplashBootLoaderArtifact.abi
export const ChugSplashManagerProxyABI = ChugSplashManagerProxyArtifact.abi
Expand Down
3 changes: 1 addition & 2 deletions packages/executor/src/utils/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
CHUGSPLASH_MANAGER_ADDRESS,
CHUGSPLASH_REGISTRY_ADDRESS,
DEFAULT_ADAPTER_ADDRESS,
buildInfo,
} from '@chugsplash/contracts'
import * as BuildInfo from '@chugsplash/contracts/artifacts/build-info/e734239b34165c4a7085766ba5e2cde1.json'

import {
linkProxyWithImplementation,
Expand All @@ -32,7 +32,6 @@ export const initializeChugSplashContracts = async (
await deployChugSplashContracts(hre, deployer)

const { etherscanApiKey, etherscanApiEndpoints } = await getEtherscanInfo(hre)
const buildInfo = (BuildInfo as any).default

const contracts = [
{
Expand Down

0 comments on commit 78acb9a

Please sign in to comment.