Skip to content

Commit

Permalink
feat: core dao
Browse files Browse the repository at this point in the history
  • Loading branch information
leoslr committed Oct 25, 2023
1 parent 9414820 commit 40cd6a9
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 18 deletions.
1 change: 1 addition & 0 deletions packages/currency/src/chains/evm/data/core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const chainId = 1116;
2 changes: 2 additions & 0 deletions packages/currency/src/chains/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -37,6 +38,7 @@ export const chains: Record<CurrencyTypes.EvmChainName, EvmChain> = {
bsc: BscDefinition,
bsctest: BscTestDefinition,
celo: CeloDefinition,
core: CoreDefinition,
fantom: FantomDefinition,
fuse: FuseDefinition,
goerli: GoerliDefinition,
Expand Down
6 changes: 6 additions & 0 deletions packages/currency/src/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ export const nativeCurrencies: Record<RequestLogicTypes.CURRENCY.ETH, NativeEthC
name: 'Mantle Testnet',
network: 'mantle-testnet',
},
{
symbol: 'CORE',
decimals: 18,
name: 'Core',
network: 'core',
},
],
[RequestLogicTypes.CURRENCY.BTC]: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const networks: Record<string, ethers.providers.Network> = {
tombchain: { chainId: 6969, name: 'tombchain' },
mantle: { chainId: 5000, name: 'mantle' },
'mantle-testnet': { chainId: 5001, name: 'mantle-testnet' },
core: { chainId: 1116, name: 'core' },
};

/**
Expand Down
17 changes: 16 additions & 1 deletion packages/smart-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -156,6 +156,11 @@ export default {
chainId: 5001,
accounts,
},
core: {
url: url('core'),
chainId: 1116,
accounts,
},
},
etherscan: {
apiKey: {
Expand All @@ -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',
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const computeCreate2DeploymentAddressesFromList = async (
case 'EthereumProxy':
case 'EthereumFeeProxy':
case 'EthConversionProxy':
case 'ERC20Proxy':
case 'ERC20FeeProxy':
case 'Erc20ConversionProxy':
case 'ERC20EscrowToPay':
Expand Down
7 changes: 7 additions & 0 deletions packages/smart-contracts/scripts-create2/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export async function VerifyCreate2FromList(hre: HardhatRuntimeEnvironmentExtend
});
};

console.log(hre.config);
let address: string;
for (const contract of create2ContractDeploymentList) {
try {
Expand All @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions packages/smart-contracts/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const uniswapV2RouterAddresses: Record<string, string> = {
// No swap v2 found
optimism: '0x0000000000000000000000000000000000000000',
moonbeam: '0x0000000000000000000000000000000000000000',
core: '0x0000000000000000000000000000000000000000',
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ export const erc20FeeProxyArtifact = new ContractArtifact<ERC20FeeProxy>(
address: '0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE',
creationBlockNumber: 16210087,
},
core: {
address: '0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE',
creationBlockNumber: 8317450,
},
},
},
near: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export const erc20ProxyArtifact = new ContractArtifact<ERC20Proxy>(
address: '0x88Ecc15fDC2985A7926171B938BB2Cd808A5ba40',
creationBlockNumber: 16210085,
},
core: {
address: '0x88Ecc15fDC2985A7926171B938BB2Cd808A5ba40',
creationBlockNumber: 8317448,
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ export const ethereumFeeProxyArtifact = new ContractArtifact<EthereumFeeProxy>(
address: '0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687',
creationBlockNumber: 16210081,
},
core: {
address: '0xe11BF2fDA23bF0A98365e1A4c04A87C9339e8687',
creationBlockNumber: 8317446,
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ export const ethereumProxyArtifact = new ContractArtifact<EthereumProxy>(
address: '0x171Ee0881407d4c0C11eA1a2FB7D5b4cdED71e6e',
creationBlockNumber: 16210080,
},
core: {
address: '0x171Ee0881407d4c0C11eA1a2FB7D5b4cdED71e6e',
creationBlockNumber: 8317443,
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export const requestDeployer = new ContractArtifact<RequestDeployer>(
address: '0xE99Ab70a5FAE59551544FA326fA048f7B95A24B2',
creationBlockNumber: 16208647,
},
core: {
address: '0xE99Ab70a5FAE59551544FA326fA048f7B95A24B2',
creationBlockNumber: 8314795,
},
},
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/currency-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type EvmChainName =
| 'bsc'
| 'bsctest'
| 'celo'
| 'core'
| 'fantom'
| 'fuse'
| 'goerli'
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const networkRpcs: Record<string, string> = {
tombchain: 'https://rpc.tombchain.com/',
mantle: 'https://rpc.mantle.xyz/',
'mantle-testnet': 'https://rpc.testnet.mantle.xyz/',
core: 'https://rpc.coredao.org/',
};

/**
Expand Down
31 changes: 15 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3877,6 +3877,21 @@
mcl-wasm "^0.7.1"
rustbn.js "~0.2.0"

"@nomicfoundation/[email protected]":
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/[email protected]":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.0.tgz#83a7367342bd053a76d04bbcf4f373fef07cf760"
Expand Down Expand Up @@ -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/[email protected]":
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/[email protected]":
version "2.0.1"
resolved "https://registry.npmjs.org/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz"
Expand Down

0 comments on commit 40cd6a9

Please sign in to comment.