diff --git a/packages/currency/src/chains/evm/data/core.ts b/packages/currency/src/chains/evm/data/core.ts new file mode 100644 index 0000000000..d148ecf595 --- /dev/null +++ b/packages/currency/src/chains/evm/data/core.ts @@ -0,0 +1 @@ +export const chainId = 1116; diff --git a/packages/currency/src/chains/evm/index.ts b/packages/currency/src/chains/evm/index.ts index 5d88250495..de90682169 100644 --- a/packages/currency/src/chains/evm/index.ts +++ b/packages/currency/src/chains/evm/index.ts @@ -8,6 +8,7 @@ import * as AvalancheDefinition from './data/avalanche'; import * as BscDefinition from './data/bsc'; import * as BscTestDefinition from './data/bsctest'; import * as CeloDefinition from './data/celo'; +import * as CoreDefinition from './data/core'; import * as FantomDefinition from './data/fantom'; import * as FuseDefinition from './data/fuse'; import * as GoerliDefinition from './data/goerli'; @@ -37,6 +38,7 @@ export const chains: Record = { bsc: BscDefinition, bsctest: BscTestDefinition, celo: CeloDefinition, + core: CoreDefinition, fantom: FantomDefinition, fuse: FuseDefinition, goerli: GoerliDefinition, diff --git a/packages/currency/src/native.ts b/packages/currency/src/native.ts index 40f6d40adf..356ee338b7 100644 --- a/packages/currency/src/native.ts +++ b/packages/currency/src/native.ts @@ -135,6 +135,12 @@ export const nativeCurrencies: Record = { tombchain: { chainId: 6969, name: 'tombchain' }, mantle: { chainId: 5000, name: 'mantle' }, 'mantle-testnet': { chainId: 5001, name: 'mantle-testnet' }, + core: { chainId: 1116, name: 'core' }, }; /** diff --git a/packages/smart-contracts/hardhat.config.ts b/packages/smart-contracts/hardhat.config.ts index f9cf5d0ea0..0dbb31aced 100644 --- a/packages/smart-contracts/hardhat.config.ts +++ b/packages/smart-contracts/hardhat.config.ts @@ -1,6 +1,6 @@ import '@typechain/hardhat'; import '@nomiclabs/hardhat-waffle'; -import '@nomiclabs/hardhat-etherscan'; +import '@nomicfoundation/hardhat-verify'; import '@nomiclabs/hardhat-ethers'; import { subtask, task } from 'hardhat/config'; import { config } from 'dotenv'; @@ -156,6 +156,11 @@ export default { chainId: 5001, accounts, }, + core: { + url: url('core'), + chainId: 1116, + accounts, + }, }, etherscan: { apiKey: { @@ -180,6 +185,8 @@ export default { optimism: process.env.OPTIMISM_API_KEY, // moonbeam moonbeam: process.env.MOONBEAM_API_KEY, + // core + core: process.env.CORE_API_KEY, // other networks don't need an API key, but you still need // to specify one; any string placeholder will work sokol: 'api-key', @@ -213,6 +220,14 @@ export default { browserURL: 'https://explorer.testnet.mantle.xyz/', }, }, + { + network: 'core', + chainId: 1116, + urls: { + apiURL: 'https://openapi.coredao.org/api', + browserURL: 'https://scan.coredao.org/', + }, + }, ], }, tenderly: { diff --git a/packages/smart-contracts/package.json b/packages/smart-contracts/package.json index c544bba8cc..71a2ea387f 100644 --- a/packages/smart-contracts/package.json +++ b/packages/smart-contracts/package.json @@ -54,8 +54,8 @@ "tslib": "2.5.0" }, "devDependencies": { + "@nomicfoundation/hardhat-verify": "2.0.0", "@nomiclabs/hardhat-ethers": "2.0.2", - "@nomiclabs/hardhat-etherscan": "3.1.7", "@nomiclabs/hardhat-waffle": "2.0.1", "@nomiclabs/hardhat-web3": "2.0.0", "@openzeppelin/contracts": "4.4.2", diff --git a/packages/smart-contracts/scripts-create2/compute-one-address.ts b/packages/smart-contracts/scripts-create2/compute-one-address.ts index 565c987a98..ef09414394 100644 --- a/packages/smart-contracts/scripts-create2/compute-one-address.ts +++ b/packages/smart-contracts/scripts-create2/compute-one-address.ts @@ -56,6 +56,7 @@ export const computeCreate2DeploymentAddressesFromList = async ( case 'EthereumProxy': case 'EthereumFeeProxy': case 'EthConversionProxy': + case 'ERC20Proxy': case 'ERC20FeeProxy': case 'Erc20ConversionProxy': case 'ERC20EscrowToPay': diff --git a/packages/smart-contracts/scripts-create2/verify.ts b/packages/smart-contracts/scripts-create2/verify.ts index b128b711f9..8f521766e2 100644 --- a/packages/smart-contracts/scripts-create2/verify.ts +++ b/packages/smart-contracts/scripts-create2/verify.ts @@ -31,6 +31,7 @@ export async function VerifyCreate2FromList(hre: HardhatRuntimeEnvironmentExtend }); }; + console.log(hre.config); let address: string; for (const contract of create2ContractDeploymentList) { try { @@ -52,6 +53,12 @@ export async function VerifyCreate2FromList(hre: HardhatRuntimeEnvironmentExtend EvmChains.assertChainSupported(network); const constructorArgs = getConstructorArgs(contract, network); address = await computeCreate2DeploymentAddress({ contract, constructorArgs }, hre); + + console.log({ + network, + address, + constructorArgs, + }); await verifyOne(address, { contract, constructorArgs }, hre); break; } diff --git a/packages/smart-contracts/scripts/utils.ts b/packages/smart-contracts/scripts/utils.ts index 608293195a..4654c748be 100644 --- a/packages/smart-contracts/scripts/utils.ts +++ b/packages/smart-contracts/scripts/utils.ts @@ -27,6 +27,7 @@ export const uniswapV2RouterAddresses: Record = { // No swap v2 found optimism: '0x0000000000000000000000000000000000000000', moonbeam: '0x0000000000000000000000000000000000000000', + core: '0x0000000000000000000000000000000000000000', }; /** diff --git a/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts b/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts index 9b0653e0a3..d41c96aa89 100644 --- a/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts @@ -143,6 +143,10 @@ export const erc20FeeProxyArtifact = new ContractArtifact( address: '0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE', creationBlockNumber: 16210087, }, + core: { + address: '0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE', + creationBlockNumber: 8317450, + }, }, }, near: { diff --git a/packages/smart-contracts/src/lib/artifacts/ERC20Proxy/index.ts b/packages/smart-contracts/src/lib/artifacts/ERC20Proxy/index.ts index 160cf664ab..5b561b1d5c 100644 --- a/packages/smart-contracts/src/lib/artifacts/ERC20Proxy/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/ERC20Proxy/index.ts @@ -29,6 +29,10 @@ export const erc20ProxyArtifact = new ContractArtifact( address: '0x88Ecc15fDC2985A7926171B938BB2Cd808A5ba40', creationBlockNumber: 16210085, }, + core: { + address: '0x88Ecc15fDC2985A7926171B938BB2Cd808A5ba40', + creationBlockNumber: 8317448, + }, }, }, }, diff --git a/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts b/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts index 71c693fb66..8bf3d3bc35 100644 --- a/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/EthereumFeeProxy/index.ts @@ -130,6 +130,10 @@ export const ethereumFeeProxyArtifact = new ContractArtifact( address: '0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687', creationBlockNumber: 16210081, }, + core: { + address: '0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687', + creationBlockNumber: 8317446, + }, }, }, }, diff --git a/packages/smart-contracts/src/lib/artifacts/EthereumProxy/index.ts b/packages/smart-contracts/src/lib/artifacts/EthereumProxy/index.ts index 9e31bd6db6..30f87be5c1 100644 --- a/packages/smart-contracts/src/lib/artifacts/EthereumProxy/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/EthereumProxy/index.ts @@ -192,6 +192,10 @@ export const ethereumProxyArtifact = new ContractArtifact( address: '0x171Ee0881407d4c0C11eA1a2FB7D5b4cdED71e6e', creationBlockNumber: 16210080, }, + core: { + address: '0x171Ee0881407d4c0C11eA1a2FB7D5b4cdED71e6e', + creationBlockNumber: 8317443, + }, }, }, }, diff --git a/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts b/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts index e2a0fd2af4..2c8d2822f9 100644 --- a/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts +++ b/packages/smart-contracts/src/lib/artifacts/RequestDeployer/index.ts @@ -81,6 +81,10 @@ export const requestDeployer = new ContractArtifact( address: '0xE99Ab70a5FAE59551544FA326fA048f7B95A24B2', creationBlockNumber: 16208647, }, + core: { + address: '0xE99Ab70a5FAE59551544FA326fA048f7B95A24B2', + creationBlockNumber: 8314795, + }, }, }, }, diff --git a/packages/types/src/currency-types.ts b/packages/types/src/currency-types.ts index af22547aed..1502d6f159 100644 --- a/packages/types/src/currency-types.ts +++ b/packages/types/src/currency-types.ts @@ -9,6 +9,7 @@ export type EvmChainName = | 'bsc' | 'bsctest' | 'celo' + | 'core' | 'fantom' | 'fuse' | 'goerli' diff --git a/packages/utils/src/providers.ts b/packages/utils/src/providers.ts index e98d733965..1ced8e0858 100644 --- a/packages/utils/src/providers.ts +++ b/packages/utils/src/providers.ts @@ -48,6 +48,7 @@ const networkRpcs: Record = { tombchain: 'https://rpc.tombchain.com/', mantle: 'https://rpc.mantle.xyz/', 'mantle-testnet': 'https://rpc.testnet.mantle.xyz/', + core: 'https://rpc.coredao.org/', }; /** diff --git a/yarn.lock b/yarn.lock index 6a035aead1..1c624b2b3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3877,6 +3877,21 @@ mcl-wasm "^0.7.1" rustbn.js "~0.2.0" +"@nomicfoundation/hardhat-verify@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.0.tgz#aa5b26827b67e3b82dae595167b32979c527fc39" + integrity sha512-DlzeYWcPtcD82AD1wSsmjPjrbuESSKlY5XMvUYnr5YMQc81yGUc++U3M7ghHo0JSnZEUhXq+hDc8/HkpOZ6h8A== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^8.1.0" + chalk "^2.4.2" + debug "^4.1.1" + lodash.clonedeep "^4.5.0" + semver "^6.3.0" + table "^6.8.0" + undici "^5.14.0" + "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.0.tgz#83a7367342bd053a76d04bbcf4f373fef07cf760" @@ -3948,22 +3963,6 @@ resolved "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz" integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg== -"@nomiclabs/hardhat-etherscan@3.1.7": - version "3.1.7" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz#72e3d5bd5d0ceb695e097a7f6f5ff6fcbf062b9a" - integrity sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ== - dependencies: - "@ethersproject/abi" "^5.1.2" - "@ethersproject/address" "^5.0.2" - cbor "^8.1.0" - chalk "^2.4.2" - debug "^4.1.1" - fs-extra "^7.0.1" - lodash "^4.17.11" - semver "^6.3.0" - table "^6.8.0" - undici "^5.14.0" - "@nomiclabs/hardhat-waffle@2.0.1": version "2.0.1" resolved "https://registry.npmjs.org/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz"