From 52a153db7d7a00bc4250e1947971d0f9143fca5d Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 10 Dec 2025 16:06:47 -0500 Subject: [PATCH 01/21] chore: Typechain generation with foundry Signed-off-by: Faisal Usmani --- .github/actions/generate-evm-artifacts/action.yml | 8 +++++++- .github/workflows/publish.yml | 1 + ...phery.sol => 113DeploySponsoredCCTPSrcPeriphery.s.sol} | 0 ...phery.sol => 114DeploySponsoredCCTPDstPeriphery.s.sol} | 0 4 files changed, 8 insertions(+), 1 deletion(-) rename script/mintburn/cctp/{113DeploySponsoredCCTPSrcPeriphery.sol => 113DeploySponsoredCCTPSrcPeriphery.s.sol} (100%) rename script/mintburn/cctp/{114DeploySponsoredCCTPDstPeriphery.sol => 114DeploySponsoredCCTPDstPeriphery.s.sol} (100%) diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index 0ae401266..2ab2783ba 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -16,9 +16,15 @@ runs: - name: Install packages shell: bash run: yarn install --frozen-lockfile - - name: Build EVM + - name: Build Harhat shell: bash run: yarn build-evm + - name: Build Foundry + shell: bash + run: forge build --skip test script && rm out/build-info/*.json + - name: Generate Typechain + shell: bash + run: npx typechain --target ethers-v5 "out/**/*.json" --out-dir typechain-types - name: Archive EVM artifacts (for caching) shell: bash env: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f0d991876..a5c5ec478 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,6 +21,7 @@ env: artifacts cache typechain + typechain-types SVM_ARTIFACTS_PATHS: | target/idl target/types diff --git a/script/mintburn/cctp/113DeploySponsoredCCTPSrcPeriphery.sol b/script/mintburn/cctp/113DeploySponsoredCCTPSrcPeriphery.s.sol similarity index 100% rename from script/mintburn/cctp/113DeploySponsoredCCTPSrcPeriphery.sol rename to script/mintburn/cctp/113DeploySponsoredCCTPSrcPeriphery.s.sol diff --git a/script/mintburn/cctp/114DeploySponsoredCCTPDstPeriphery.sol b/script/mintburn/cctp/114DeploySponsoredCCTPDstPeriphery.s.sol similarity index 100% rename from script/mintburn/cctp/114DeploySponsoredCCTPDstPeriphery.sol rename to script/mintburn/cctp/114DeploySponsoredCCTPDstPeriphery.s.sol From 7ec12baab272b8e5e0916e93f8776cbc69719fcd Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 10 Dec 2025 16:30:11 -0500 Subject: [PATCH 02/21] install foundry Signed-off-by: Faisal Usmani --- .github/actions/generate-evm-artifacts/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index 2ab2783ba..2c86cdd1d 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -19,6 +19,10 @@ runs: - name: Build Harhat shell: bash run: yarn build-evm + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + - name: Install forge dependencies + run: forge install - name: Build Foundry shell: bash run: forge build --skip test script && rm out/build-info/*.json From 0c9cbd5998e5b8d7f8da4efd228ad9d527f0713f Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 10 Dec 2025 16:31:40 -0500 Subject: [PATCH 03/21] add shell Signed-off-by: Faisal Usmani --- .github/actions/generate-evm-artifacts/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index 2c86cdd1d..44eb2f82c 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -22,6 +22,7 @@ runs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - name: Install forge dependencies + shell: bash run: forge install - name: Build Foundry shell: bash From 9a520d098dea1d6fab6c4a5fae0f9a96f5877b2f Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 10 Dec 2025 16:39:30 -0500 Subject: [PATCH 04/21] update path Signed-off-by: Faisal Usmani --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d62bd570a..0ad92bea6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -47,6 +47,7 @@ jobs: artifacts cache typechain + typechain-types steps: - name: Checkout repo uses: actions/checkout@v3 From 0158dbb80b165c915c430a982fc3f108f860cfcc Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 11 Dec 2025 15:11:04 -0500 Subject: [PATCH 05/21] remove hardhat hypechain generation Signed-off-by: Faisal Usmani --- .github/actions/cache-evm-artifacts/action.yml | 2 +- .github/actions/generate-evm-artifacts/action.yml | 2 +- .github/workflows/pr.yml | 1 - .github/workflows/publish.yml | 1 - hardhat.config.ts | 5 ----- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/actions/cache-evm-artifacts/action.yml b/.github/actions/cache-evm-artifacts/action.yml index 9fa0527af..67ff4b764 100644 --- a/.github/actions/cache-evm-artifacts/action.yml +++ b/.github/actions/cache-evm-artifacts/action.yml @@ -23,7 +23,7 @@ runs: # The job that generates the artifacts is responsible for archiving them to the cache tarball. This avoids any # conflicts with other caching actions that might have cleaned some of cached contents. path: evm-artifacts.tar - key: evm-artifacts-${{ runner.os }}-node-${{ steps.resolved-node.outputs.version }}-${{ hashFiles('yarn.lock', 'hardhat.config.ts', 'contracts/**/*.sol') }} + key: evm-artifacts-${{ runner.os }}-node-${{ steps.resolved-node.outputs.version }}-${{ hashFiles('yarn.lock', 'hardhat.config.ts', 'foundry.toml', 'contracts/**/*.sol') }} - name: Unpack restored EVM artifacts if: steps.evm-artifacts-cache.outputs.cache-hit == 'true' shell: bash diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index 44eb2f82c..c496804c1 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -29,7 +29,7 @@ runs: run: forge build --skip test script && rm out/build-info/*.json - name: Generate Typechain shell: bash - run: npx typechain --target ethers-v5 "out/**/*.json" --out-dir typechain-types + run: npx typechain --target ethers-v5 "out/**/*.json" --out-dir typechain - name: Archive EVM artifacts (for caching) shell: bash env: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0ad92bea6..d62bd570a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -47,7 +47,6 @@ jobs: artifacts cache typechain - typechain-types steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a5c5ec478..f0d991876 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,6 @@ env: artifacts cache typechain - typechain-types SVM_ARTIFACTS_PATHS: | target/idl target/types diff --git a/hardhat.config.ts b/hardhat.config.ts index 3bc4a907c..1fb14481b 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -28,7 +28,6 @@ import { getNodeUrl } from "./utils"; import "@nomicfoundation/hardhat-verify"; // Must be above hardhat-upgrades import "@nomiclabs/hardhat-waffle"; -import "@typechain/hardhat"; import "@matterlabs/hardhat-zksync-solc"; import "@matterlabs/hardhat-zksync-verify"; import "@matterlabs/hardhat-zksync-upgradable"; @@ -396,10 +395,6 @@ const config: HardhatUserConfig = { ], }, namedAccounts: { deployer: 0 }, - typechain: { - outDir: "./typechain", - target: "ethers-v5", - }, paths: { tests: "./test/evm/hardhat", }, From 94a5035ef0b72c4dd7be971ade545b1439290192 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 11 Dec 2025 15:12:35 -0500 Subject: [PATCH 06/21] version bump Signed-off-by: Faisal Usmani --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b184ddc6..b9960633e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "4.1.16-beta.0", + "version": "4.1.18-alpha.1", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { From c1834041803cc751169b6e62575935aa98c69451 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 11 Dec 2025 15:12:55 -0500 Subject: [PATCH 07/21] typo Signed-off-by: Faisal Usmani --- .github/actions/generate-evm-artifacts/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index c496804c1..88dd47909 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -16,7 +16,7 @@ runs: - name: Install packages shell: bash run: yarn install --frozen-lockfile - - name: Build Harhat + - name: Build Hardhat shell: bash run: yarn build-evm - name: Install Foundry From 0e41cff54f48d201bc84e1c1b5658de74ff5aae3 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 11 Dec 2025 15:20:36 -0500 Subject: [PATCH 08/21] remove @typechain/hardhat Signed-off-by: Faisal Usmani --- package.json | 1 - yarn.lock | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/package.json b/package.json index b9960633e..4baf8df0f 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,6 @@ "@openzeppelin/hardhat-upgrades": "^1.22.0", "@pinata/sdk": "^2.1.0", "@typechain/ethers-v5": "^11.0.0", - "@typechain/hardhat": "^8.0.0", "@types/bn.js": "^5.1.0", "@types/chai": "^4.3.5", "@types/mocha": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index 5b1feb8a7..c8334063a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3993,13 +3993,6 @@ dependencies: ethers "^5.0.2" -"@typechain/hardhat@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-8.0.0.tgz#60568b7a2d0260cc741fb0830a8caee8eb06ac64" - integrity sha512-XUVbqlMx8tJTOmzZCD/r196CidtNWAnTBZRcYxjLTKgcJMvc/kHQpWBnVMMB5QHxVKpYpCiz8g07FYCpG8rrjA== - dependencies: - fs-extra "^9.1.0" - "@types/async-eventemitter@^0.2.1": version "0.2.1" resolved "https://registry.yarnpkg.com/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz#f8e6280e87e8c60b2b938624b0a3530fb3e24712" @@ -9710,7 +9703,7 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.0, fs-extra@^9.1.0: +fs-extra@^9.0.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== From 57060132cea8f817adcf81d934e62c4d6df69d34 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 11 Dec 2025 15:37:05 -0500 Subject: [PATCH 09/21] fixed tests Signed-off-by: Faisal Usmani --- test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts | 4 ++-- test/evm/hardhat/chain-adapters/Polygon_Adapter.ts | 4 ++-- .../hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts b/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts index 57c31b866..93f4424f1 100644 --- a/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts +++ b/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts @@ -27,8 +27,8 @@ import { MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/contracts/interfaces/IOFT.sol/IOFT"; -import { IOFT__factory } from "../../../../typechain/factories/contracts/interfaces/IOFT.sol/IOFT__factory"; +} from "../../../../typechain/IOFT.sol/IOFT"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; import { hubPoolFixture, enableTokensForLP } from "../fixtures/HubPool.Fixture"; import { constructSingleChainTree } from "../MerkleLib.utils"; import { CIRCLE_DOMAIN_IDs } from "../../../../deploy/consts"; diff --git a/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts b/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts index f8f3850a6..4c339971f 100644 --- a/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts +++ b/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts @@ -32,8 +32,8 @@ import { MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/contracts/interfaces/IOFT.sol/IOFT"; -import { IOFT__factory } from "../../../../typechain/factories/contracts/interfaces/IOFT.sol/IOFT__factory"; +} from "../../../../typechain/IOFT.sol/IOFT"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; import { CIRCLE_DOMAIN_IDs } from "../../../../deploy/consts"; import { AdapterStore, AdapterStore__factory } from "../../../../typechain"; import { CHAIN_IDs } from "@across-protocol/constants"; diff --git a/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts b/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts index 690d3a206..3fbf7a8be 100644 --- a/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts +++ b/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts @@ -26,8 +26,8 @@ import { MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/contracts/interfaces/IOFT.sol/IOFT"; -import { IOFT__factory } from "../../../../typechain/factories/contracts/interfaces/IOFT.sol/IOFT__factory"; +} from "../../../../typechain/IOFT.sol/IOFT"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; import { CHAIN_IDs } from "@across-protocol/constants"; let hubPool: Contract, arbitrumSpokePool: Contract, dai: Contract, weth: Contract, l2UsdtContract: Contract; From 798b46dffefded3db27489fc979815bbe06eb214 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 11 Dec 2025 15:40:39 -0500 Subject: [PATCH 10/21] fix more tests Signed-off-by: Faisal Usmani --- .../hardhat/chain-specific-spokepools/Polygon_SpokePool.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts b/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts index b3989e5c3..d5e8a36b1 100644 --- a/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts +++ b/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts @@ -25,13 +25,13 @@ import { } from "../../../../utils/utils"; import { getOftEid } from "../../../../utils/utils"; import { CHAIN_IDs } from "@across-protocol/constants"; -import { IOFT__factory } from "../../../../typechain/factories/contracts/interfaces/IOFT.sol/IOFT__factory"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; import { MessagingFeeStructOutput, MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/contracts/interfaces/IOFT.sol/IOFT"; +} from "../../../../typechain/IOFT.sol/IOFT"; import { hre } from "../../../../utils/utils.hre"; import { hubPoolFixture } from "../fixtures/HubPool.Fixture"; import { buildRelayerRefundLeaves, buildRelayerRefundTree, constructSingleRelayerRefundTree } from "../MerkleLib.utils"; From 3147301ff5a36044c5a634b843d49f6fab94bb4a Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 17 Dec 2025 11:09:01 -0500 Subject: [PATCH 11/21] updated typechain command Signed-off-by: Faisal Usmani --- .github/actions/generate-evm-artifacts/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index 88dd47909..6ef416ebe 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -26,10 +26,10 @@ runs: run: forge install - name: Build Foundry shell: bash - run: forge build --skip test script && rm out/build-info/*.json + run: forge build --skip test script - name: Generate Typechain shell: bash - run: npx typechain --target ethers-v5 "out/**/*.json" --out-dir typechain + run: npx typechain --target ethers-v5 "out/!(build-info)/**/+([a-zA-Z0-9_]).json" --out-dir typechain - name: Archive EVM artifacts (for caching) shell: bash env: From 4a83f8f21bb3cfb786ac6b5d312a85be46e16513 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 17 Dec 2025 14:46:08 -0500 Subject: [PATCH 12/21] typechain artifacts Signed-off-by: Faisal Usmani --- .../actions/generate-evm-artifacts/action.yml | 5 +- .gitignore | 3 ++ scripts/typechainArtifacts.ts | 51 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 scripts/typechainArtifacts.ts diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index 6ef416ebe..cb97f9594 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -27,9 +27,12 @@ runs: - name: Build Foundry shell: bash run: forge build --skip test script + - name: Generate Typechain artifacts + shell: bash + run: npx ts-node scripts/typechainArtifacts.ts - name: Generate Typechain shell: bash - run: npx typechain --target ethers-v5 "out/!(build-info)/**/+([a-zA-Z0-9_]).json" --out-dir typechain + run: npx typechain --target ethers-v5 "typechain-artifacts" --out-dir typechain - name: Archive EVM artifacts (for caching) shell: bash env: diff --git a/.gitignore b/.gitignore index 147e874f2..e793a9a35 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ out zkout cache-foundry +# Typechain +.typechain-artifacts + # Upgradeability files .openzeppelin diff --git a/scripts/typechainArtifacts.ts b/scripts/typechainArtifacts.ts new file mode 100644 index 000000000..859b07beb --- /dev/null +++ b/scripts/typechainArtifacts.ts @@ -0,0 +1,51 @@ +import fs from "fs"; +import path from "path"; +import fg from "fast-glob"; + +type ArtifactJson = { + contractName?: string; + [key: string]: unknown; +}; + +const OUT_DIR = "out"; +const STAGE_DIR = ".typechain-artifacts"; + +function main() { + if (fs.existsSync(STAGE_DIR)) { + fs.rmdirSync(STAGE_DIR, { recursive: true }); + } + fs.mkdirSync(STAGE_DIR, { recursive: true }); + + const files = fg.sync([`${OUT_DIR}/**/*.json`, `!${OUT_DIR}/build-info/**`], { + dot: false, + onlyFiles: true, + }); + + const seen = new Map(); // contractName -> first file path kept + const dups: Array<{ name: string; kept: string; dropped: string }> = []; + + for (const file of files) { + const name = file.split("/").pop()?.split(".")[0]; + if (!name) continue; + + const already = seen.get(name); + if (already) { + dups.push({ name, kept: already, dropped: file }); + continue; + } + + seen.set(name, file); + + // One artifact per name => stable TypeChain inputs + const dest = path.join(STAGE_DIR, `${name}.json`); + fs.copyFileSync(file, dest); + } + + if (dups.length > 0) { + console.warn(`\nTypeChain dedupe: dropped ${dups.length} duplicate contract names:\n`); + } + + console.log(`Staged ${seen.size} unique artifacts into ${STAGE_DIR}/`); +} + +main(); From 60c6e4b58d3f0b303d57f7fa59bdb57e0f08e4bc Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 17 Dec 2025 15:43:03 -0500 Subject: [PATCH 13/21] update tests Signed-off-by: Faisal Usmani --- .github/actions/generate-evm-artifacts/action.yml | 2 +- .gitignore | 2 +- test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts | 4 ++-- test/evm/hardhat/chain-adapters/Polygon_Adapter.ts | 4 ++-- .../hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts | 4 ++-- .../hardhat/chain-specific-spokepools/Polygon_SpokePool.ts | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/generate-evm-artifacts/action.yml b/.github/actions/generate-evm-artifacts/action.yml index cb97f9594..9b2edbff6 100644 --- a/.github/actions/generate-evm-artifacts/action.yml +++ b/.github/actions/generate-evm-artifacts/action.yml @@ -32,7 +32,7 @@ runs: run: npx ts-node scripts/typechainArtifacts.ts - name: Generate Typechain shell: bash - run: npx typechain --target ethers-v5 "typechain-artifacts" --out-dir typechain + run: npx typechain --target ethers-v5 "typechain-artifacts/**/*.json" --out-dir typechain - name: Archive EVM artifacts (for caching) shell: bash env: diff --git a/.gitignore b/.gitignore index e793a9a35..2746c1796 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,7 @@ zkout cache-foundry # Typechain -.typechain-artifacts +typechain-artifacts # Upgradeability files .openzeppelin diff --git a/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts b/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts index 93f4424f1..51c110e28 100644 --- a/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts +++ b/test/evm/hardhat/chain-adapters/Arbitrum_Adapter.ts @@ -27,8 +27,8 @@ import { MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/IOFT.sol/IOFT"; -import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; +} from "../../../../typechain/IOFT"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT__factory"; import { hubPoolFixture, enableTokensForLP } from "../fixtures/HubPool.Fixture"; import { constructSingleChainTree } from "../MerkleLib.utils"; import { CIRCLE_DOMAIN_IDs } from "../../../../deploy/consts"; diff --git a/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts b/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts index 4c339971f..05500d63f 100644 --- a/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts +++ b/test/evm/hardhat/chain-adapters/Polygon_Adapter.ts @@ -32,8 +32,8 @@ import { MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/IOFT.sol/IOFT"; -import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; +} from "../../../../typechain/IOFT"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT__factory"; import { CIRCLE_DOMAIN_IDs } from "../../../../deploy/consts"; import { AdapterStore, AdapterStore__factory } from "../../../../typechain"; import { CHAIN_IDs } from "@across-protocol/constants"; diff --git a/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts b/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts index 3fbf7a8be..aa720e344 100644 --- a/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts +++ b/test/evm/hardhat/chain-specific-spokepools/Arbitrum_SpokePool.ts @@ -26,8 +26,8 @@ import { MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/IOFT.sol/IOFT"; -import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; +} from "../../../../typechain/IOFT"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT__factory"; import { CHAIN_IDs } from "@across-protocol/constants"; let hubPool: Contract, arbitrumSpokePool: Contract, dai: Contract, weth: Contract, l2UsdtContract: Contract; diff --git a/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts b/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts index d5e8a36b1..01b37e101 100644 --- a/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts +++ b/test/evm/hardhat/chain-specific-spokepools/Polygon_SpokePool.ts @@ -25,13 +25,13 @@ import { } from "../../../../utils/utils"; import { getOftEid } from "../../../../utils/utils"; import { CHAIN_IDs } from "@across-protocol/constants"; -import { IOFT__factory } from "../../../../typechain/factories/IOFT.sol/IOFT__factory"; +import { IOFT__factory } from "../../../../typechain/factories/IOFT__factory"; import { MessagingFeeStructOutput, MessagingReceiptStructOutput, OFTReceiptStructOutput, SendParamStruct, -} from "../../../../typechain/IOFT.sol/IOFT"; +} from "../../../../typechain/IOFT"; import { hre } from "../../../../utils/utils.hre"; import { hubPoolFixture } from "../fixtures/HubPool.Fixture"; import { buildRelayerRefundLeaves, buildRelayerRefundTree, constructSingleRelayerRefundTree } from "../MerkleLib.utils"; From f52ae992d4476605c3003dc0d32cafaac0a10bbf Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 17 Dec 2025 15:48:49 -0500 Subject: [PATCH 14/21] folder name Signed-off-by: Faisal Usmani --- scripts/typechainArtifacts.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/typechainArtifacts.ts b/scripts/typechainArtifacts.ts index 859b07beb..73e1c9b70 100644 --- a/scripts/typechainArtifacts.ts +++ b/scripts/typechainArtifacts.ts @@ -2,13 +2,8 @@ import fs from "fs"; import path from "path"; import fg from "fast-glob"; -type ArtifactJson = { - contractName?: string; - [key: string]: unknown; -}; - const OUT_DIR = "out"; -const STAGE_DIR = ".typechain-artifacts"; +const STAGE_DIR = "typechain-artifacts"; function main() { if (fs.existsSync(STAGE_DIR)) { From 4e21e9700469536171ba2b9a242633dbb95d0a7a Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 17 Dec 2025 15:57:46 -0500 Subject: [PATCH 15/21] version bump Signed-off-by: Faisal Usmani --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4baf8df0f..e1f9186b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "4.1.18-alpha.1", + "version": "4.1.18-alpha.2", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { From 588f1cf49afda4f4f630f8c4e9704901e462237e Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 17 Dec 2025 16:30:59 -0500 Subject: [PATCH 16/21] version bump Signed-off-by: Faisal Usmani --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e1f9186b9..735a766ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "4.1.18-alpha.2", + "version": "4.1.18", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { From e34633b8a43f6e60a923b50ebd93ba284856b430 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Wed, 17 Dec 2025 20:32:08 -0500 Subject: [PATCH 17/21] version bump Signed-off-by: Faisal Usmani --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 735a766ba..a27967602 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "4.1.18", + "version": "4.1.19", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { From f44c5d3df91ef20657c218381a70e3bb8a703f9b Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 18 Dec 2025 09:32:00 -0500 Subject: [PATCH 18/21] version bump Signed-off-by: Faisal Usmani --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a27967602..d8dd6f2d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "4.1.19", + "version": "4.1.19-alpha.1", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { From d80422ba5dadf224d4b775f50afe2cb86036f29a Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 18 Dec 2025 11:07:36 -0500 Subject: [PATCH 19/21] revert strings Signed-off-by: Faisal Usmani --- hardhat.config.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 89d56b972..753cf756f 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -81,6 +81,7 @@ const solcVersion = "0.8.30"; // Hardhat 2.14.0 doesn't support prague yet, so we use paris instead (need to upgrade to v3 to use prague) const evmVersion = isTest ? "paris" : "prague"; +const revertStrings = isTest || process.env.CI === "true" ? "debug" : "strip"; // Compilation settings are overridden for large contracts to allow them to compile without going over the bytecode // limit. @@ -90,7 +91,7 @@ const LARGE_CONTRACT_COMPILER_SETTINGS = { optimizer: { enabled: true, runs: 800 }, viaIR: true, evmVersion, - debug: { revertStrings: isTest ? "debug" : "strip" }, + debug: { revertStrings }, }, }; const DEFAULT_CONTRACT_COMPILER_SETTINGS = { @@ -100,7 +101,7 @@ const DEFAULT_CONTRACT_COMPILER_SETTINGS = { viaIR: true, evmVersion, // Only strip revert strings if not testing or in ci. - debug: { revertStrings: isTest ? "debug" : "strip" }, + debug: { revertStrings }, }, }; // This is only used by Blast_SpokePool for now, as it's the largest bytecode-wise @@ -110,7 +111,7 @@ const LARGEST_CONTRACT_COMPILER_SETTINGS = { optimizer: { enabled: true, runs: 50 }, viaIR: true, evmVersion, - debug: { revertStrings: isTest ? "debug" : "strip" }, + debug: { revertStrings }, }, }; From 1e1159d318f8bc33a2ad4c1f775b615947a9a8c3 Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 18 Dec 2025 11:10:22 -0500 Subject: [PATCH 20/21] version bump Signed-off-by: Faisal Usmani --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8dd6f2d7..605de495f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "4.1.19-alpha.1", + "version": "4.1.19-alpha.2", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { From 03d6ba40d30df7da0fa03afbd2edb3f6400748bd Mon Sep 17 00:00:00 2001 From: Faisal Usmani Date: Thu, 18 Dec 2025 12:07:54 -0500 Subject: [PATCH 21/21] add CI back to is test check Signed-off-by: Faisal Usmani --- hardhat.config.ts | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 753cf756f..40ffc98fa 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,12 +1,14 @@ const { subtask } = require("hardhat/config"); const { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } = require("hardhat/builtin-tasks/task-names"); +const isTest = process.env.IS_TEST === "true" || process.env.CI === "true"; + subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_: any, __: any, runSuper: any) => { const paths = await runSuper(); // Filter out files that cause problems when using "paris" hardfork (currently used to compile everything when IS_TEST=true) // Reference: https://github.com/NomicFoundation/hardhat/issues/2306#issuecomment-1039452928 - if (process.env.IS_TEST === "true") { + if (isTest) { return paths.filter((p: any) => { return ( !p.includes("contracts/periphery/mintburn") && @@ -69,8 +71,6 @@ const tasks = [ // eslint-disable-next-line node/no-missing-require tasks.forEach((task) => require(`./tasks/${task}`)); -const isTest = process.env.IS_TEST === "true"; - // To compile with zksolc, `hardhat` must be the default network and its `zksync` property must be true. // So we allow the caller to set this environment variable to toggle compiling zk contracts or not. // TODO: Figure out way to only compile specific contracts intended to be deployed on ZkSync (e.g. ZkSync_SpokePool) if @@ -81,7 +81,7 @@ const solcVersion = "0.8.30"; // Hardhat 2.14.0 doesn't support prague yet, so we use paris instead (need to upgrade to v3 to use prague) const evmVersion = isTest ? "paris" : "prague"; -const revertStrings = isTest || process.env.CI === "true" ? "debug" : "strip"; +const revertStrings = isTest ? "debug" : "strip"; // Compilation settings are overridden for large contracts to allow them to compile without going over the bytecode // limit. diff --git a/package.json b/package.json index 605de495f..07f10e931 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "4.1.19-alpha.2", + "version": "4.1.19-alpha.3", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": {