diff --git a/hardhat.config.ts b/hardhat.config.ts index c682e9ff..1147be70 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -110,6 +110,14 @@ export default { ...sharedNetworkConfig, url: `https://linea-goerli.infura.io/v3/${INFURA_KEY}`, }, + core: { + ...sharedNetworkConfig, + url: "https://rpc.coredao.org", + }, + coreTestnet: { + ...sharedNetworkConfig, + url: "https://rpc.test.btcs.network", + }, }, namedAccounts: { deployer: 0, @@ -119,5 +127,23 @@ export default { }, etherscan: { apiKey: ETHERSCAN_API_KEY, + customChains: [ + { + network: "coreTestnet", + chainId: 1115, + urls: { + apiURL: "https://api.test.btcs.network/api", + browserURL: "https://scan.test.btcs.network/", + }, + }, + { + network: "core", + chainId: 1116, + urls: { + apiURL: "https://openapi.coredao.org/api", + browserURL: "https://scan.coredao.org/", + }, + }, + ], }, }; diff --git a/sdk/contracts.ts b/sdk/contracts.ts index 5a429112..49e75c9b 100644 --- a/sdk/contracts.ts +++ b/sdk/contracts.ts @@ -53,6 +53,8 @@ export enum SupportedNetworks { HardhatNetwork = 31337, LineaGoerli = 59140, Sepolia = 11155111, + CoreTestnet = 1115, + Core = 1116, } // const canonicalMasterCopyAddress = (contract: KnownContracts) => { @@ -215,6 +217,18 @@ export const ContractVersions: Record< }, [SupportedNetworks.LineaGoerli]: CanonicalAddresses, [SupportedNetworks.Sepolia]: CanonicalAddresses, + [SupportedNetworks.CoreTestnet]: { + ...CanonicalAddresses, + [KnownContracts.OPTIMISTIC_GOVERNOR]: { + "1.2.0": "0xD43463Fadd73373bE260b67F5825274F4403dAF0", + }, + }, + [SupportedNetworks.Core]: { + ...CanonicalAddresses, + [KnownContracts.OPTIMISTIC_GOVERNOR]: { + "1.2.0": "0x596Fd6A5A185c67aBD1c845b39f593fBA9C233aa", + }, + }, }; /** Addresses of the head versions of all contracts */ diff --git a/sdk/factory/mastercopyDeployer.ts b/sdk/factory/mastercopyDeployer.ts index 3ebef99a..e27634ff 100644 --- a/sdk/factory/mastercopyDeployer.ts +++ b/sdk/factory/mastercopyDeployer.ts @@ -106,7 +106,7 @@ export const deployMastercopyWithInitData = async ( const initCodeHash = keccak256(initCode); const computedTargetAddress = getCreate2Address( - await singletonFactory.address(), + await singletonFactory.getAddress(), salt, initCodeHash ); diff --git a/sdk/factory/singletonFactory.ts b/sdk/factory/singletonFactory.ts index 4531356d..e3e6bb86 100644 --- a/sdk/factory/singletonFactory.ts +++ b/sdk/factory/singletonFactory.ts @@ -33,10 +33,12 @@ export const getSingletonFactory = async ( "Singleton factory is not deployed on this chain. Deploying singleton factory..." ); // fund the singleton factory deployer account - await signer.sendTransaction({ - to: singletonDeployer, - value: parseEther("0.0247"), - }); + await ( + await signer.sendTransaction({ + to: singletonDeployer, + value: parseEther("0.0247"), + }) + ).wait(); // deploy the singleton factory await ( diff --git a/tasks/deploy-replay.ts b/tasks/deploy-replay.ts index 772026fe..d5b6ea41 100644 --- a/tasks/deploy-replay.ts +++ b/tasks/deploy-replay.ts @@ -17,7 +17,7 @@ export const deploy = async (_: unknown, hre: HardhatRuntimeEnvironment) => { console.log(`\n\x1B[4m\x1B[1m${hre.network.name}\x1B[0m`); const [deployer] = await hre.ethers.getSigners(); - const signer = hre.ethers.provider.getSigner(deployer.address); + const signer = await hre.ethers.provider.getSigner(deployer.address); for (let index = 0; index < contracts.length; index++) { const initData: InitData | undefined = MasterCopyInitData[contracts[index]]; diff --git a/tasks/singleton-deployment.ts b/tasks/singleton-deployment.ts index 5e28fde0..46697789 100644 --- a/tasks/singleton-deployment.ts +++ b/tasks/singleton-deployment.ts @@ -16,7 +16,7 @@ export const deploy = async (_: unknown, hre: HardhatRuntimeEnvironment) => { } const [deployer] = await hre.ethers.getSigners(); - await deployModuleFactory(hre.ethers.provider.getSigner(deployer.address)); + await deployModuleFactory(await hre.ethers.provider.getSigner(deployer.address)); }; task(