diff --git a/hardhat.config.ts b/hardhat.config.ts index e7dbe930..ebe7bb64 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -342,7 +342,7 @@ const config: HardhatUserConfig = { }, ...liveNetworks, zeroTestnet: { - url: "https://zerion-testnet-proofs.rpc.caldera.xyz/http", + url: process.env.ZERO_SEPOLIA_RPC, zksync: true, ethNetwork: "sepolia", verifyURL: diff --git a/scripts/constants/networks.ts b/scripts/constants/networks.ts index 79105a48..f8a5fde5 100644 --- a/scripts/constants/networks.ts +++ b/scripts/constants/networks.ts @@ -61,15 +61,11 @@ export const getProviderFromChainName = (chainName: HardhatChainName) => { }; export const getZkWallet = (chainSlug: ChainSlug) => { - console.log({ chainSlug }); if (!zkStackChain.includes(chainSlug)) throw new Error(`Chain ${chainSlug} is not a zkStack chain`); if (!process.env.SOCKET_SIGNER_KEY) throw new Error("SOCKET_SIGNER_KEY not set"); - const rpc = getJsonRpcUrl(chainSlug); - console.log({ rpc }); const provider = new Provider(rpc); - console.log({ provider }); return new zkWallet(process.env.SOCKET_SIGNER_KEY, provider); }; diff --git a/scripts/deploy/deploy.ts b/scripts/deploy/deploy.ts index c98be03d..03bfdffa 100644 --- a/scripts/deploy/deploy.ts +++ b/scripts/deploy/deploy.ts @@ -13,30 +13,30 @@ import { executionManagerVersion } from "./config/config"; const main = async () => { try { - // const response = await prompts([ - // { - // name: "chainType", - // type: "select", - // message: "Select chains network type", - // choices: [ - // { - // title: "Mainnet", - // value: "mainnet", - // }, - // { - // title: "Testnet", - // value: "testnet", - // }, - // ], - // }, - // ]); + const response = await prompts([ + { + name: "chainType", + type: "select", + message: "Select chains network type", + choices: [ + { + title: "Mainnet", + value: "mainnet", + }, + { + title: "Testnet", + value: "testnet", + }, + ], + }, + ]); - // const chainOptions = - // response.chainType === "mainnet" ? MainnetIds : TestnetIds; - // let choices = chainOptions.map((chain) => ({ - // title: chain.toString(), - // value: chain, - // })); + const chainOptions = + response.chainType === "mainnet" ? MainnetIds : TestnetIds; + let choices = chainOptions.map((chain) => ({ + title: chain.toString(), + value: chain, + })); const chainsResponse = await prompts([ { @@ -56,6 +56,7 @@ const main = async () => { const chains = chainsResponse.chains; const siblings = chainsResponse.siblings; const allChains = [...chains, ...siblings]; + console.log("allChains: ", allChains); let addresses: DeploymentAddresses = await deployForChains( allChains, executionManagerVersion diff --git a/scripts/deploy/scripts/configureSwitchboards.ts b/scripts/deploy/scripts/configureSwitchboards.ts index 99accc5d..863b05ae 100644 --- a/scripts/deploy/scripts/configureSwitchboards.ts +++ b/scripts/deploy/scripts/configureSwitchboards.ts @@ -29,6 +29,7 @@ export const configureSwitchboards = async ( executionManagerVersion: CORE_CONTRACTS ) => { try { + console.log("=========== configuring switchboards ==========="); await Promise.all( chains.map(async (chain) => { if (!addresses[chain]) return; @@ -64,7 +65,7 @@ export const configureSwitchboards = async ( siblings.includes(parseInt(chain) as ChainSlug) ); - console.log(`Configuring for ${chain}`); + console.log(`Configuring switchboards for ${chain}`); for (let sibling of integrationList) { const nativeConfig = integrations[sibling][IntegrationTypes.native]; diff --git a/scripts/deploy/scripts/connect.ts b/scripts/deploy/scripts/connect.ts index 20bff40d..06c378e1 100644 --- a/scripts/deploy/scripts/connect.ts +++ b/scripts/deploy/scripts/connect.ts @@ -22,6 +22,7 @@ export const connectPlugs = async ( siblings: ChainSlug[] ) => { try { + console.log("=========== connecting plugs ==========="); await Promise.all( chains.map(async (chain) => { if (!addresses[chain]) return; @@ -49,7 +50,7 @@ export const connectPlugs = async ( } ); - console.log(`Configuring for ${chain}`); + console.log(`Connecting Counter for ${chain}`); const counter: Contract = ( await getInstance("Counter", addr["Counter"]) diff --git a/scripts/deploy/scripts/deploySocket.ts b/scripts/deploy/scripts/deploySocket.ts index 33f55e0b..dc814f87 100644 --- a/scripts/deploy/scripts/deploySocket.ts +++ b/scripts/deploy/scripts/deploySocket.ts @@ -168,6 +168,7 @@ export const deploySocket = async ( switchboardSimulator.address; // setup + console.log("starting setup : ", chainSlug); const simulatorContract = ( await getInstance("SocketSimulator", socketSimulator.address) ).connect(deployUtils.signer); diff --git a/scripts/deploy/utils/utils.ts b/scripts/deploy/utils/utils.ts index 7308ee36..be464d63 100644 --- a/scripts/deploy/utils/utils.ts +++ b/scripts/deploy/utils/utils.ts @@ -128,12 +128,13 @@ export async function deployContractWithArgs( }); const contract = await deployer.deploy(artifact, args); const address = await contract.getAddress(); - const Contract: ContractFactory = await ethers.getContractFactory( + const contractFactory: ContractFactory = await ethers.getContractFactory( contractName ); // console.log(contract); // contract.address = address; - return Contract.attach(address); + const instance = contractFactory.attach(address); + return { ...instance, address }; } else { const Contract: ContractFactory = await ethers.getContractFactory( contractName @@ -182,8 +183,11 @@ export const verify = async ( export const getInstance = async ( contractName: string, address: Address -): Promise => - (await ethers.getContractFactory(contractName)).attach(address); +): Promise => { + const artifact = await hre.artifacts.readArtifact(contractName); + const c = new Contract(address, artifact.abi); + return c; +}; export const getChainSlug = async (): Promise => { if (network.config.chainId === undefined)