Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: duplicate addresses #145

Merged
merged 7 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions data/addresses.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@
"chain_name": "eth_mainnet",
"type": "uniswapV2Factory"
},
{
"address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
"category": "messaging",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "uniswapV2Factory"
},
{
"address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
"category": "messaging",
Expand Down Expand Up @@ -153,13 +146,6 @@
"chain_name": "zeta_mainnet",
"type": "uniswapV2Factory"
},
{
"address": "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c",
"category": "messaging",
"chain_id": 7000,
"chain_name": "zeta_mainnet",
"type": "uniswapV2Factory"
},
{
"address": "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe",
"category": "omnichain",
Expand Down
49 changes: 0 additions & 49 deletions data/addresses.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@
"chain_name": "zeta_testnet",
"type": "uniswapV2Factory"
},
{
"address": "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c",
"category": "messaging",
"chain_id": 7001,
"chain_name": "zeta_testnet",
"type": "uniswapV2Factory"
},
{
"address": "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe",
"category": "omnichain",
Expand Down Expand Up @@ -256,41 +249,6 @@
"chain_name": "btc_testnet",
"type": "tss"
},
{
"address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1",
"category": "messaging",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "connector"
},
{
"address": "0x0000a7db254145767262c6a81a7ee1650684258e",
"category": "omnichain",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "erc20Custody"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "messaging",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "pauser"
},
{
"address": "0x8531a5aB847ff5B22D855633C25ED1DA3255247e",
"category": "omnichain",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "tss"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "omnichain",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "tssUpdater"
},
{
"address": "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",
"category": "messaging",
Expand Down Expand Up @@ -326,13 +284,6 @@
"chain_name": "mumbai_testnet",
"type": "weth9"
},
{
"address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f",
"category": "messaging",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "zetaToken"
},
{
"address": "0x7e792f3736751e168864106AdbAC50152641A927",
"category": "messaging",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,16 @@
"license": "MIT",
"main": "./dist/lib/index.js",
"name": "@zetachain/protocol-contracts",
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to double check if this change is needed since its not mentioned in description?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try to remove it,

yarn

! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72.

For some reason even on older node versions Corepack decides to set the package manager explicitly. I've changed this to yarn@1.22.21: 4454170

"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "yarn compile && npx del-cli dist abi && npx tsc || true && npx del-cli './dist/typechain-types/**/*.js' && npx cpx './data/**/*' dist/data && npx cpx './artifacts/contracts/**/*' ./abi && npx del-cli './abi/**/*.dbg.json'",
"compile": "npx hardhat compile --force",
"generate": "yarn compile && ./scripts/generate_go.sh || true && ./scripts/generate_addresses.sh && yarn lint:fix",
"docs": "forge doc",
"generate": "yarn compile && ./scripts/generate_go.sh || true && ./scripts/generate_addresses.sh && yarn lint:fix",
"lint": "npx eslint . --ext .js,.ts",
"lint:fix": "npx eslint . --ext .js,.ts,.json --fix",
"prepublishOnly": "yarn build",
Expand All @@ -81,4 +82,4 @@
},
"types": "./dist/lib/index.d.ts",
"version": "0.0.8"
}
}
7 changes: 0 additions & 7 deletions tasks/addresses.mainnet.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
[
{
"address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt look like a duplicate in this file, just to double check, or is it handled by this:

addresses.push({
          address: factoryAddress,
          category: "messaging",
          chain_id: router.chain_id,
          chain_name: router.chain_name,
          type: "uniswapV2Factory",
        });

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In main we have two identical entries:

{
"address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
"category": "messaging",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "uniswapV2Factory"
},
{
"address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
"category": "messaging",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "uniswapV2Factory"
},

This PR leaves just one:

{
"address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
"category": "messaging",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "uniswapV2Factory"
},

This is handled by the script, so I've removed the entry from tasks/addresses.ts to avoid having duplicate entries.

"category": "messaging",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "uniswapV2Factory"
},
{
"address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
"category": "messaging",
Expand Down
16 changes: 8 additions & 8 deletions tasks/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ const fetchFactoryV2 = async (addresses: any, hre: HardhatRuntimeEnvironment, ne
chain_name: router.chain_name,
type: "weth9",
});
}

addresses.push({
address: factoryAddress,
category: "messaging",
chain_id: router.chain_id,
chain_name: router.chain_name,
type: "uniswapV2Factory",
});
addresses.push({
address: factoryAddress,
category: "messaging",
chain_id: router.chain_id,
chain_name: router.chain_name,
type: "uniswapV2Factory",
});
}
} catch (error) {
console.error(`Error fetching factory and WETH for router v2 ${router.address}:`, error);
}
Expand Down
Loading