Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env

# Node modules
node_modules/

# Dist
dist/

# Hardhat
artifacts/
cache/
cache_hardhat/
typechain/

# Etherscan
.etherscan/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
lib
!src/lib
abi
out
typechain
.vscode
artifacts
cache
cache_hardhat
29 changes: 29 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"plugins": ["prettier-plugin-solidity"],
"overrides": [
{
"files": "*.sol",
"options": {
"parser": "solidity-parse",
"tabWidth": 4,
"printWidth": 120,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"compiler": "0.8.19"
}
},
{
"files": ["*.js", "*.md"],
"options": {
"tabWidth": 2,
"printWidth": 80,
"useTabs": false,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "all"
}
}
]
}
6 changes: 4 additions & 2 deletions deployments/arbitrum.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"SocketVerifier": "0x69D9f76e4cbE81044FE16C399387b12e4DBF27B1",
"SocketVerifier": "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D",
"HopL2Verifier": "0x96424DCBe8767a5DDd8e0e40291f6240Ef78AbdB",
"AnyswapV6Verification": "0xD8cead962b7D12139EE62D38fE9BCA8E04aE7fa6",
"AnyswapV4Verification": "0xa9B203773C68b4EDc17d4bD1151f6b2bbEB36Bc8"
"AnyswapV4Verification": "0xa9B203773C68b4EDc17d4bD1151f6b2bbEB36Bc8",
"CCTPVerification": "0x7779a8e52448984E575E3563D555802aa7D3f6D5",
"AcrossV3Verification": "0xfa6deD4a4D4A976e02586B2Ab5DA151CD7927e53"
}
5 changes: 5 additions & 0 deletions deployments/avalanche.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"SocketVerifier": "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D",
"CCTPVerification": "0x8290CBb7049D3DA0692A4d43b246f7F43C7E532f",
"AcrossV3Verification": "0x8fEc265e8D9C1cA6295C6Ca7Afb80F8e1e63F9F0"
}
Comment on lines 1 to 5
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find config.ts file
find . -name "config.ts" -type f | head -20

Repository: SocketDotTech/socket-gateway-verifier

Length of output: 100


🏁 Script executed:

#!/bin/bash
# Examine the avalanche.json file
cat -n deployments/avalanche.json

Repository: SocketDotTech/socket-gateway-verifier

Length of output: 324


🏁 Script executed:

#!/bin/bash
# Search for AcrossV3Verification in config.ts
rg -n "AcrossV3Verification|avalanche" scripts/config.ts | head -50

Repository: SocketDotTech/socket-gateway-verifier

Length of output: 491


Remove AcrossV3Verification address from avalanche deployment or update config.ts.

config.ts marks AcrossV3Verification as undefined on avalanche (line 11: "across not supported on avalanche"), but avalanche.json contains a deployment address for it (line 4). This inconsistency should not exist—either remove the address from the deployment or enable support in config.ts.

🤖 Prompt for AI Agents
In deployments/avalanche.json around lines 1-5 there is an AcrossV3Verification
address while config.ts explicitly marks "across not supported on avalanche"
(line 11), creating an inconsistency; either remove the "AcrossV3Verification"
entry from avalanche.json to match config.ts, or update config.ts to enable
AcrossV3 on Avalanche and set the corresponding address there (ensure the
address in config.ts exactly matches this file and update any type/interface
expectations), then run a quick config/validation check to confirm no remaining
mismatch.

5 changes: 5 additions & 0 deletions deployments/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"SocketVerifier": "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D",
"CCTPVerification": "0x2d829685aE4C44E24F0603CF44f10C0Db8Ff65f9",
"AcrossV3Verification": "0xe38C0088EA4816674b0C6873a86f989f95DF9Be5"
}
5 changes: 5 additions & 0 deletions deployments/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"SocketVerifier": "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D",
"CCTPVerification": "0x978aF9cAD9b1808895e71BDcF5Ea420a1CAAA9b0",
"AcrossV3Verification": "0xb4057271C61d3A8aAFb30AA59E7A0A136D33aA5E"
}
6 changes: 4 additions & 2 deletions deployments/opt.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"SocketVerifier": "0x69D9f76e4cbE81044FE16C399387b12e4DBF27B1",
"SocketVerifier": "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D",
"HopL2Verifier": "0x96424DCBe8767a5DDd8e0e40291f6240Ef78AbdB",
"AnyswapV6Verification": "0xD8cead962b7D12139EE62D38fE9BCA8E04aE7fa6"
"AnyswapV6Verification": "0xD8cead962b7D12139EE62D38fE9BCA8E04aE7fa6",
"CCTPVerification": "0x0Bc5133cC65DCF8E87d7978C5FBDc3d6fAe4dE8A",
"AcrossV3Verification": "0xf960AF18928b052A597ADde084d7c955074Bb29b"
}
6 changes: 4 additions & 2 deletions deployments/polygon.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"SocketVerifier": "0x69D9f76e4cbE81044FE16C399387b12e4DBF27B1",
"SocketVerifier": "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D",
"AnyswapV6Verification": "0xC477E9A725F67C56Aa563a1e4820c79f4D666934",
"HopL2Verifier": "0x7d185d7C75305a73d2bf77BA8ac92c265cea98Db",
"AnyswapV4Verification": "0xd10dcE444c0deee08210f4781Ecc085eD6a7b6AA"
"AnyswapV4Verification": "0xd10dcE444c0deee08210f4781Ecc085eD6a7b6AA",
"CCTPVerification": "0x9E12f1A51C6f41Bdf2D8E982568E0E023b453183",
"AcrossV3Verification": "0xa7CA9C3454B2F9d1c1E19E490cfC8f0A983B6654"
}
4 changes: 4 additions & 0 deletions deployments/xdai.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"SocketVerifier": "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D",
"CCTPVerification": "0x3bA3A055F34feCb5e7D56D3E260b6303d4AF79a7"
}
Comment on lines 1 to 4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check config.ts for xdai verifier support
find . -name "config.ts" -type f | head -20

Repository: SocketDotTech/socket-gateway-verifier

Length of output: 100


🏁 Script executed:

#!/bin/bash
# Search for xdai configuration
rg -A 10 "xdai:" scripts/config.ts 2>/dev/null || rg -A 10 "xdai" . -t ts --max-count=50

Repository: SocketDotTech/socket-gateway-verifier

Length of output: 375


Remove unsupported verifier addresses from xdai.json deployment config.

The config.ts explicitly marks both AcrossV3Verification and CCTPVerification as undefined for xdai with comments stating they're not supported on that network. Yet xdai.json contains deployment addresses for both verifiers. This inconsistency between config and deployment artifacts should be resolved by either removing these addresses from xdai.json or enabling support in config.ts.

🤖 Prompt for AI Agents
In deployments/xdai.json around lines 1 to 5, the file contains addresses for
AcrossV3Verification and CCTPVerification even though config.ts marks those
verifiers as unsupported for xdai; remove the "CCTPVerification" and
"AcrossV3Verification" entries from xdai.json so the deployment artifact matches
the config, leaving only supported verifier entries (or alternatively, if you
intend to support them, update config.ts to enable these verifiers and add
tests/notes); ensure the resulting JSON is valid after removal.

24 changes: 21 additions & 3 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const getEtherscanKey = () => {
return process.env.OPTIMISM_ETHERSCAN_KEY
case 'arbitrum':
return process.env.ARBITRUM_ETHERSCAN_KEY
case 'base':
return process.env.BASE_ETHERSCAN_KEY
case 'avalanche':
return process.env.AVALANCHE_ETHERSCAN_KEY
case 'bsc':
Expand Down Expand Up @@ -96,8 +98,8 @@ const config: HardhatUserConfig = {
},
mainnet: {
url: `${ethereumRPC}`,
gasPrice: 30_000_000_000, // 30 gwei
gasMultiplier: 1.5,
// gasPrice: 30_000_000_000, // 30 gwei
// gasMultiplier: 1.5,
chainId: 1,
accounts: [ socketDeployerKey ],
},
Expand Down Expand Up @@ -150,6 +152,13 @@ const config: HardhatUserConfig = {
chainId: 42161,
accounts: [ socketDeployerKey ],
},
base: {
url: process.env.BASE_RPC,
// gasPrice: 5_000_000_000, // 5 gwei
gasMultiplier: 1.5,
chainId: 8453,
accounts: [ socketDeployerKey ],
},
Comment on lines +155 to +161
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing environment variable validation for BASE_RPC.

Other networks like mainnet (line 70-73) and xdai (line 75-78) have explicit validation that throws an error if the RPC URL is not set. The base network should follow the same pattern for consistency and clearer error messages.

Add validation before the config object:

+const BASE_RPC = process.env.BASE_RPC;
+if (!BASE_RPC) {
+  throw new Error("Please set your BASE_RPC in a .env file");
+}

Then update the network config to use the validated constant:

 base: {
-  url: process.env.BASE_RPC,
+  url: BASE_RPC,
   // gasPrice: 5_000_000_000, // 5 gwei
   gasMultiplier: 1.5,
   chainId: 8453,
   accounts: [ socketDeployerKey ],
 },

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In hardhat.config.ts around lines 155 to 161, add the same environment-variable
validation used for other networks: read process.env.BASE_RPC into a constant
(e.g., BASE_RPC) and if it's falsy throw an Error with a clear message
indicating BASE_RPC must be set; then replace process.env.BASE_RPC in the base
network config with the validated BASE_RPC constant so the config consistently
fails fast with a descriptive error when the RPC URL is missing.

aurora: {
url: "https://mainnet.aurora.dev",
chainId: 1313161554,
Expand All @@ -168,6 +177,7 @@ const config: HardhatUserConfig = {
polygon: process.env.POLYGON_ETHERSCAN_KEY,
gnosis: process.env.GNOSIS_ETHERSCAN_KEY,
optimisticEthereum: process.env.OPTIMISM_ETHERSCAN_KEY,
base: process.env.BASE_ETHERSCAN_KEY,
arbitrumOne: process.env.ARBITRUM_ETHERSCAN_KEY,
aurora: process.env.AURORA_ETHERSCAN_KEY,
bsc: process.env.BINANCE_ETHERSCAN_KEY,
Expand All @@ -184,7 +194,15 @@ const config: HardhatUserConfig = {
browserURL: 'https://zkevm.polygonscan.com',
apiURL: 'https://api-zkevm.polygonscan.com/api',
}
}
},
{
network: "base",
chainId: 8453,
urls: {
browserURL: 'https://basescan.org',
apiURL: 'https://api.basescan.org/api',
}
},
]
},
paths: {
Expand Down
166 changes: 82 additions & 84 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,84 @@
{
"name": "socket-gateway-verifier",
"version": "0.0.1",
"description": "",
"files": [
"artifacts",
"contracts"
],
"scripts": {
"hardhat:test": "hardhat test",
"hardhat:compile": "hardhat compile",
"hardhat:coverage": "hardhat coverage",
"build": "rm -rf dist && tsc --declaration && hardhat compile && cp -r ./{package.json,yarn.lock,artifacts,networks,contracts,deployments,copy_contracts.sh} dist/",
"publish:dist": "yarn build && yarn publish dist -f --access public",
"docgen": "hardhat docgen",
"lint": "prettier --write **.sol"
},
"pre-commit": [
"lint"
],
"keywords": [],
"author": "",
"license": "ISC",
"engines": {
"node": "16.x"
},
"devDependencies": {
"@defi-wonderland/smock": "^2.2.0",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
"@nomicfoundation/hardhat-network-helpers": "^1.0.4",
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@socket.tech/ll-core": "^0.1.33",
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
"@typechain/ethers-v5": "^7.2.0",
"@typechain/hardhat": "^2.3.1",
"@types/chai": "^4.3.1",
"@types/mocha": "^9.1.1",
"@types/node": "^12.20.50",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"bignumber.js": "9.0.0",
"chai": "^4.3.6",
"dotenv": "^10.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-promise": "^5.2.0",
"ethereum-waffle": "^3.3.0",
"fs-extra": "^11.1.0",
"hardhat": "^2.9.5",
"hardhat-deploy": "^0.11.0",
"hardhat-gas-reporter": "^1.0.8",
"hardhat-preprocessor": "^0.1.4",
"prettier": "^2.6.2",
"prettier-plugin-solidity": "^1.0.0-beta.13",
"solhint": "^3.3.7",
"solidity-coverage": "^0.7.21",
"solidity-docgen": "^0.6.0-beta.29",
"solparse": "^2.2.8",
"ts-node": "^10.7.0",
"typechain": "^5.2.0",
"typescript": "^4.6.3"
},
"dependencies": {
"@openzeppelin/contracts": "^4.6.0",
"@openzeppelin/contracts-upgradeable": "^4.6.0",
"@solidity-parser/parser": "^0.13.2",
"@types/fs-extra": "^9.0.13",
"eth-revert-reason": "^1.0.3",
"ethers": "^5.7.1",
"fs-extra": "^11.1.0",
"hardhat-abi-exporter": "^2.2.1",
"hardhat-deploy": "^0.11.14",
"moment": "^2.29.4",
"perf_hooks": "^0.0.1",
"pre-commit": "^1.2.2",
"sleep-promise": "^9.1.0",
"solmate": "^6.6.1"
}
"name": "socket-gateway-verifier",
"version": "0.0.1",
"description": "",
"files": [
"artifacts",
"contracts"
],
"scripts": {
"hardhat:test": "hardhat test",
"hardhat:compile": "hardhat compile",
"hardhat:coverage": "hardhat coverage",
"build": "rm -rf dist && tsc --declaration && hardhat compile && cp -r ./{package.json,yarn.lock,artifacts,networks,contracts,deployments,copy_contracts.sh} dist/",
"publish:dist": "yarn build && yarn publish dist -f --access public",
"docgen": "hardhat docgen",
"lint": "prettier --write \"./**/*.sol\""
},
"pre-commit": [
"lint"
],
"keywords": [],
"author": "",
"license": "ISC",
"engines": {
"node": "18.x"
},
"devDependencies": {
"@defi-wonderland/smock": "^2.2.0",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@socket.tech/ll-core": "^0.1.33",
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
"@typechain/ethers-v5": "^7.2.0",
"@typechain/hardhat": "^2.3.1",
"@types/chai": "^4.3.1",
"@types/mocha": "^9.1.1",
"@types/node": "^18.11.18",
"@types/sinon-chai": "^3.2.3",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"bignumber.js": "9.0.0",
"chai": "^4.3.6",
"dotenv": "^10.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-promise": "^5.2.0",
"ethereum-waffle": "^3.3.0",
"fs-extra": "^11.1.0",
"hardhat": "^2.9.5",
"hardhat-deploy": "^0.11.0",
"hardhat-gas-reporter": "^1.0.8",
"hardhat-preprocessor": "^0.1.4",
"prettier": "^2.6.2",
"prettier-plugin-solidity": "1.3.0",
"solhint": "^3.3.7",
"solidity-coverage": "^0.7.21",
"solidity-docgen": "^0.6.0-beta.29",
"solparse": "^2.2.8",
"ts-node": "^10.7.0",
"typechain": "^5.2.0",
"typescript": "^4.6.3"
},
"dependencies": {
"@openzeppelin/contracts": "^4.6.0",
"@openzeppelin/contracts-upgradeable": "^4.6.0",
"@socket.tech/ll-core-v2": "^0.0.81",
"@solidity-parser/parser": "^0.13.2",
"@types/fs-extra": "^9.0.13",
"eth-revert-reason": "^1.0.3",
"ethers": "5.7.1",
"fs-extra": "^11.1.0",
"hardhat-abi-exporter": "^2.2.1",
"moment": "^2.29.4",
"perf_hooks": "^0.0.1",
"pre-commit": "^1.2.2",
"sleep-promise": "^9.1.0",
"solidity-bytes-utils": "^0.8.2",
"solmate": "^6.6.1"
}
}
12 changes: 0 additions & 12 deletions script/Counter.s.sol

This file was deleted.

Loading