From 54ebef63885edb2f7a6af486cf28437cf287917d Mon Sep 17 00:00:00 2001 From: Igor Sobolev Date: Thu, 12 Oct 2023 16:18:40 +0100 Subject: [PATCH] Deploy to Celo chain --- hardhat.config.ts | 56 +++++++++++++++++++++++++++---------------- package.json | 6 ++--- scripts/deployment.js | 3 +++ 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 31469dfa..151777ea 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -24,7 +24,7 @@ const config: HardhatUserConfig = { }, }, // zksolc: { - // version: "latest", // Uses latest available in https://github.com/matter-labs/zksolc-bin/ + // version: 'latest', // Uses latest available in https://github.com/matter-labs/zksolc-bin/ // settings: {}, // }, networks: { @@ -56,11 +56,14 @@ const config: HardhatUserConfig = { url: 'http://localhost:24012/rpc', timeout: 400000, }, - mainnet: { - url: 'https://cloudflare-eth.com', + arbitrumOne: { + url: 'https://arb1.arbitrum.io/rpc', }, - xdai: { - url: 'https://rpc.gnosischain.com', + aurora: { + url: 'https://mainnet.aurora.dev', + }, + avalanche: { + url: 'https://api.avax.network/ext/bc/C/rpc', }, base: { url: 'https://mainnet.base.org', @@ -68,38 +71,49 @@ const config: HardhatUserConfig = { bsc: { url: 'https://bsc-dataseed.binance.org', }, - avalanche: { - url: 'https://api.avax.network/ext/bc/C/rpc', + celo: { + url: 'https://1rpc.io/celo', + }, + gnosis: { + url: 'https://rpc.gnosischain.com', + }, + mainnet: { + url: 'https://cloudflare-eth.com', + }, + opera: { + url: 'https://rpc.ftm.tools', }, optimisticEthereum: { url: 'https://mainnet.optimism.io', }, - arbitrumOne: { - url: 'https://arb1.arbitrum.io/rpc', - }, polygon: { url: 'https://polygon-rpc.com', }, - aurora: { - url: 'https://mainnet.aurora.dev', - }, - fantom: { - url: 'https://rpc.ftm.tools', - }, }, etherscan: { apiKey: { - mainnet: process.env.ETHEREUM_API_KEY ? process.env.ETHEREUM_API_KEY.toString() : '', - polygon: process.env.POLYGON_API_KEY ? process.env.POLYGON_API_KEY.toString() : '', - optimisticEthereum: process.env.OPTIMISM_API_KEY ? process.env.OPTIMISM_API_KEY.toString() : '', arbitrumOne: process.env.ARBITRUM_API_KEY ? process.env.ARBITRUM_API_KEY.toString() : '', + aurora: 'no', + avalanche: process.env.AVALANCHE_API_KEY ? process.env.AVALANCHE_API_KEY.toString() : '', base: process.env.BASE_API_KEY ? process.env.BASE_API_KEY.toString() : '', bsc: process.env.BSC_API_KEY ? process.env.BSC_API_KEY.toString() : '', - aurora: 'no', + celo: process.env.CELO_API_KEY ? process.env.CELO_API_KEY.toString() : '', gnosis: process.env.GNOSIS_API_KEY ? process.env.GNOSIS_API_KEY.toString() : '', - avalanche: process.env.AVALANCHE_API_KEY ? process.env.AVALANCHE_API_KEY.toString() : '', + mainnet: process.env.ETHEREUM_API_KEY ? process.env.ETHEREUM_API_KEY.toString() : '', opera: process.env.FANTOM_API_KEY ? process.env.FANTOM_API_KEY.toString() : '', + optimisticEthereum: process.env.OPTIMISM_API_KEY ? process.env.OPTIMISM_API_KEY.toString() : '', + polygon: process.env.POLYGON_API_KEY ? process.env.POLYGON_API_KEY.toString() : '', }, + customChains: [ + { + network: 'celo', + chainId: 42220, + urls: { + apiURL: 'https://api.celoscan.io/api', + browserURL: 'https://celoscan.io/' + }, + }, + ], }, docgen: { path: './docs', diff --git a/package.json b/package.json index a7a4cef4..77596718 100755 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "deploy:router:truffle-dashboard": "npx hardhat run scripts/1_deploy_router.js --network truffle-dashboard", "deploy:sc:truffle-dashboard": "npx hardhat run scripts/2_deploy_simple_caller.js --network truffle-dashboard", "initialize:router:truffle-dashboard": "npx hardhat run scripts/3_setup_router_fee.js --network truffle-dashboard", - "verify": "npx hardhat run scripts/4_verify.js", + "verify": "npx hardhat run scripts/4_verify.js --network", "docs:serve": "npx @techdocs/cli serve:mkdocs -p 3333" }, "lint-staged": { @@ -55,7 +55,7 @@ "eslint-plugin-import": "2.28.0", "ethers": "5.7.2", "ganache": "7.0.3", - "hardhat": "2.17.1", + "hardhat": "2.18.1", "hardhat-docgen": "1.3.0", "hardhat-gas-reporter": "1.0.9", "hardhat-tracer": "2.5.1", @@ -73,4 +73,4 @@ "ts-node": "10.9.1", "typescript": "5.1.6" } -} \ No newline at end of file +} diff --git a/scripts/deployment.js b/scripts/deployment.js index aec91f9a..0f7e85af 100644 --- a/scripts/deployment.js +++ b/scripts/deployment.js @@ -8,6 +8,7 @@ const deploymentAddresses = { 324: '0xe4C82643A4F9Fd288322cc6fBd7C48AB068B38D3', 8453: '0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F', 42161: '0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F', + 42220: '0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F', 43114: '0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F', 1313161554: '0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F', }, @@ -20,6 +21,7 @@ const deploymentAddresses = { 324: '0xB18Bb3d1775f9a1AdFF9Bc14CcCe1510A55148D9', 8453: '0xC629Bf86f02ef13E8F1f5F75adE8a8165587998F', 42161: '0xC629Bf86f02ef13E8F1f5F75adE8a8165587998F', + 42220: '0xC629Bf86f02ef13E8F1f5F75adE8a8165587998F', 43114: '0xC629Bf86f02ef13E8F1f5F75adE8a8165587998F', 1313161554: '0xC629Bf86f02ef13E8F1f5F75adE8a8165587998F', }, @@ -32,6 +34,7 @@ const deploymentAddresses = { 324: '0x5d4C06f4d54bD901b4377241DAB6447b8E19d75c', 8453: '0x7d20Ab6D8aF50d87A5E8DeF46e48F4d7dC2Ea5c7', 42161: '0x4a183b7ED67B9E14b3f45Abfb2Cf44ed22c29E54', + 42220: '0x7d20ab6d8af50d87a5e8def46e48f4d7dc2ea5c7', 43114: '0x7d20Ab6D8aF50d87A5E8DeF46e48F4d7dC2Ea5c7', 1313161554: '0x4a183b7ED67B9E14b3f45Abfb2Cf44ed22c29E54', },