Skip to content

hardhat-deploy-config: add getter#5316

Closed
tynes wants to merge 1 commit intodevelopfrom
feat/deploy-config-getter
Closed

hardhat-deploy-config: add getter#5316
tynes wants to merge 1 commit intodevelopfrom
feat/deploy-config-getter

Conversation

@tynes
Copy link
Contributor

@tynes tynes commented Mar 31, 2023

Description

Add a getter to the hre.deployConfig object
that gives access to alternative network's deploy
configs. This is useful because multiple networks
can be linked and share config. In particular when L2 networks are used with L1 networks, the entire
deploy config has be be shared with both networks
so it results in a copy paste.

Add a getter to the `hre.deployConfig` object
that gives access to alternative network's deploy
configs. This is useful because multiple networks
can be linked and share config. In particular when
L2 networks are used with L1 networks, the entire
deploy config has be be shared with both networks
so it results in a copy paste.
@tynes tynes requested a review from a team as a code owner March 31, 2023 15:43
@tynes tynes requested a review from maurelian March 31, 2023 15:43
@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2023

🦋 Changeset detected

Latest commit: a82d337

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/hardhat-deploy-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Mar 31, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit a82d337
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/6426ffa91023330008c7479b

@tynes tynes requested a review from smartcontracts March 31, 2023 15:45
@tynes
Copy link
Contributor Author

tynes commented Mar 31, 2023

This PR would let us get rid of the copy/paste of the entire deploy config in #5314

@maurelian
Copy link
Contributor

Curious how you went about testing this? I tried with npx hardhat deploy but got


Error: ERROR processing /Users/maurelian/Projects/O/mono/packages/contracts-bedrock/deploy/000-ProxyAdmin.ts:
Error: error while loading deploy config for network: hardhat, TSError: ⨯ Unable to compile TypeScript:
deploy-config/hardhat.ts:4:33 - error TS1360: Type '{ finalSystemOwner: string; portalGuardian: string; controller: string; l1StartingBlockTag: string; l1ChainID: number; l2ChainID: number; l2BlockTime: number; maxSequencerDrift: number; sequencerWindowSize: number; ... 13 more ...; numDeployConfirmations: number; }' does not satisfy the expected type 'DeployConfig'.
  Type '{ finalSystemOwner: string; portalGuardian: string; controller: string; l1StartingBlockTag: string; l1ChainID: number; l2ChainID: number; l2BlockTime: number; maxSequencerDrift: number; sequencerWindowSize: number; ... 13 more ...; numDeployConfirmations: number; }' is missing the following properties from type 'RequiredDeployConfig': governanceTokenSymbol, governanceTokenName, governanceTokenOwner

4 export default config satisfies DeployConfig
                                  ~~~~~~~~~~~~

@tynes
Copy link
Contributor Author

tynes commented Mar 31, 2023

Curious how you went about testing this? I tried with npx hardhat deploy but got


Error: ERROR processing /Users/maurelian/Projects/O/mono/packages/contracts-bedrock/deploy/000-ProxyAdmin.ts:
Error: error while loading deploy config for network: hardhat, TSError: ⨯ Unable to compile TypeScript:
deploy-config/hardhat.ts:4:33 - error TS1360: Type '{ finalSystemOwner: string; portalGuardian: string; controller: string; l1StartingBlockTag: string; l1ChainID: number; l2ChainID: number; l2BlockTime: number; maxSequencerDrift: number; sequencerWindowSize: number; ... 13 more ...; numDeployConfirmations: number; }' does not satisfy the expected type 'DeployConfig'.
  Type '{ finalSystemOwner: string; portalGuardian: string; controller: string; l1StartingBlockTag: string; l1ChainID: number; l2ChainID: number; l2BlockTime: number; maxSequencerDrift: number; sequencerWindowSize: number; ... 13 more ...; numDeployConfirmations: number; }' is missing the following properties from type 'RequiredDeployConfig': governanceTokenSymbol, governanceTokenName, governanceTokenOwner

4 export default config satisfies DeployConfig
                                  ~~~~~~~~~~~~

Did you build the package? I didn't have any issues running it after building

@tynes tynes closed this Apr 3, 2023
@tynes tynes deleted the feat/deploy-config-getter branch April 3, 2023 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants