diff --git a/.changeset/thick-feet-jump.md b/.changeset/thick-feet-jump.md new file mode 100644 index 000000000..9b6e40a3f --- /dev/null +++ b/.changeset/thick-feet-jump.md @@ -0,0 +1,6 @@ +--- +'@chugsplash/core': patch +'@chugsplash/plugins': patch +--- + +Moves predeploy deployment from core to plugins diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 2e4991a37..5531b29d2 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -2,4 +2,3 @@ export * from './actions' export * from './config' export * from './languages' export * from './utils' -export * from './predeploys' diff --git a/packages/plugins/package.json b/packages/plugins/package.json index cf34e2950..8f99aacea 100644 --- a/packages/plugins/package.json +++ b/packages/plugins/package.json @@ -33,15 +33,21 @@ "@eth-optimism/core-utils": "^0.9.1", "@ethereumjs/common": "^3.0.1", "@ethereumjs/vm": "^6.2.0", - "@nomiclabs/hardhat-ethers": "^2.2.1", "cli-progress": "^3.11.2", "dotenv": "^16.0.3", "ethers": "^5.6.9", - "hardhat": "^2.10.0", "ipfs-http-client": "56.0.3", "ipfs-only-hash": "^4.0.0", "node-fetch": "^2.6.7", "ora": "^5.4.1", "semver": "^7.3.7" + }, + "devDependencies": { + "@nomiclabs/hardhat-ethers": "^2.2.1", + "hardhat": "^2.10.0" + }, + "peerDependencies": { + "hardhat": "^2", + "@nomiclabs/hardhat-ethers": "^2" } } diff --git a/packages/core/src/predeploys.ts b/packages/plugins/src/hardhat/predeploys.ts similarity index 79% rename from packages/core/src/predeploys.ts rename to packages/plugins/src/hardhat/predeploys.ts index 9087d4c81..d07f2603f 100644 --- a/packages/core/src/predeploys.ts +++ b/packages/plugins/src/hardhat/predeploys.ts @@ -1,5 +1,5 @@ import { Contract, ethers, Signer } from 'ethers' -import 'hardhat-deploy' +import { HardhatRuntimeEnvironment } from 'hardhat/types' import { OWNER_BOND_AMOUNT, EXECUTOR_BOND_AMOUNT, @@ -7,10 +7,6 @@ import { EXECUTOR_PAYMENT_PERCENTAGE, CHUGSPLASH_REGISTRY_PROXY_ADDRESS, PROXY_UPDATER_ADDRESS, - ProxyUpdaterABI, - ProxyUpdaterArtifact, - ChugSplashRegistryABI, - ChugSplashRegistryArtifact, ChugSplashManagerABI, ChugSplashManagerArtifact, DefaultAdapterABI, @@ -19,11 +15,10 @@ import { ChugSplashBootLoaderArtifact, DEFAULT_ADAPTER_ADDRESS, } from '@chugsplash/contracts' - -import { getChugSplashRegistry } from './utils' +import { getChugSplashRegistry } from '@chugsplash/core' export const deployChugSplashPredeploys = async ( - hre, + hre: HardhatRuntimeEnvironment, deployer: ethers.Signer ) => { const chugsplashOwnerAddress = '0x1A3DAA6F487A480c1aD312b90FD0244871940b66' @@ -132,49 +127,6 @@ export const deployChugSplashManagerImplementation = async ( return address } -export const deployProxyUpdater = async (hre, deployerAddress: string) => { - const { deploy } = await hre.deployments.deterministic('ProxyUpdater', { - salt: hre.ethers.utils.solidityKeccak256(['string'], ['ProxyUpdater']), - from: deployerAddress, - contract: { - abi: ProxyUpdaterABI, - bytecode: ProxyUpdaterArtifact.bytecode, - }, - args: [], - log: true, - }) - await deploy() -} - -export const deployChugSplashRegistry = async ( - hre, - deployerAddress: string -) => { - const ProxyUpdater = await hre.deployments.get('ProxyUpdater') - - const { deploy } = await hre.deployments.deterministic('ChugSplashRegistry', { - salt: hre.ethers.utils.solidityKeccak256( - ['string'], - ['ChugSplashRegistry'] - ), - from: deployerAddress, - contract: { - abi: ChugSplashRegistryABI, - bytecode: ChugSplashRegistryArtifact.bytecode, - }, - args: [ - ProxyUpdater.address, - OWNER_BOND_AMOUNT, - EXECUTOR_BOND_AMOUNT, - EXECUTION_LOCK_TIME, - EXECUTOR_PAYMENT_PERCENTAGE, - ], - log: true, - }) - - await deploy() -} - export const deployDefaultAdapter = async (hre, deployerAddress: string) => { const { deploy } = await hre.deployments.deterministic('DefaultAdapter', { salt: hre.ethers.utils.solidityKeccak256(['string'], ['DefaultAdapter']), diff --git a/packages/plugins/src/hardhat/tasks.ts b/packages/plugins/src/hardhat/tasks.ts index 95250befa..4f58fc0e3 100644 --- a/packages/plugins/src/hardhat/tasks.ts +++ b/packages/plugins/src/hardhat/tasks.ts @@ -1,7 +1,6 @@ import * as path from 'path' import * as fs from 'fs' -import '@nomiclabs/hardhat-ethers' import { ethers } from 'ethers' import { subtask, task, types } from 'hardhat/config' import { SolcBuild } from 'hardhat/types' @@ -26,9 +25,7 @@ import { ChugSplashBundleStatus, loadChugSplashConfig, writeSnapshotId, - deployChugSplashPredeploys, registerChugSplashProject, - chugsplashContractsAreDeployedAndInitialized, getChugSplashRegistry, parseContractReferences, } from '@chugsplash/core' @@ -44,6 +41,10 @@ import { getStorageLayout, } from './artifacts' import { deployContracts } from './deployments' +import { + chugsplashContractsAreDeployedAndInitialized, + deployChugSplashPredeploys, +} from './predeploys' // Load environment variables from .env dotenv.config()