Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
30401bb
(feat): abs,apt,arb,aur,ava,base,mov
dhruvinparikh Sep 21, 2025
db8620b
(feat): bera,blast,bsc,ethereum,fraxtal,hype,ink,katana,linea,mode,op…
dhruvinparikh Sep 21, 2025
a375cc9
(chore): gen cosntants gile
dhruvinparikh Sep 23, 2025
eed5483
(chore): rm label for nonevm
dhruvinparikh Sep 23, 2025
c3d2096
Merge branch 'master' into feat/lzconstants
dhruvinparikh Jan 5, 2026
dd9e1b4
(chore): fix lint
dhruvinparikh Jan 5, 2026
1339745
ci: update Node.js, pnpm, and actions to latest versions
dhruvinparikh Jan 5, 2026
8414c13
ci: use pnpm 10 and --no-frozen-lockfile
dhruvinparikh Jan 5, 2026
b0f76f4
fix: add packages field to pnpm-workspace.yaml
dhruvinparikh Jan 5, 2026
2b160f8
(chore): fix checksum
dhruvinparikh Jan 5, 2026
a717254
feat: add LZ infra, chain IDs, hops, monad, stable constants for frax…
dhruvinparikh Feb 10, 2026
ed76392
feat: add OFT ABI exports for frax-lz-mesh
dhruvinparikh Feb 10, 2026
77a0078
feat: add all LZ ABIs (endpoint, ULN, hops, proxy admin, ERC20)
dhruvinparikh Feb 10, 2026
441c832
build: add compiled JS for scripts/constants and scripts/abis
dhruvinparikh Feb 10, 2026
86d33fd
refactor: remove LZ infra constants from chain files
dhruvinparikh Feb 11, 2026
b87c023
Merge branch 'master' into feat/lzconstants
dhruvinparikh Feb 18, 2026
9f859f0
feat: add HopV2 constants and ABI for frax-lz-mesh scanner
dhruvinparikh Mar 5, 2026
cdd5efa
feat: add REMOTE_ADMIN_V2_ABI
dhruvinparikh Mar 5, 2026
8ba0e17
feat: add REMOTEADMINV2 to fraxtal-l2 constants
dhruvinparikh Mar 5, 2026
0dadde0
feat: add REMOTEHOPV2 and REMOTEADMINV2 for polygon, linea, plumephoe…
dhruvinparikh Mar 5, 2026
14d7e3d
fix: correct REMOTEADMINV2 for linea, scroll, monad
dhruvinparikh Mar 5, 2026
69c5873
feat: add REMOTEHOPV2 and REMOTEADMINV2 for zksync, abstract
dhruvinparikh Mar 5, 2026
e8a8df8
chore: remove fraxtalMsig from REMOTE_ADMIN_V2_ABI
dhruvinparikh Mar 5, 2026
175c2ba
Re-Add Audited Functionality
tom2o17 Mar 11, 2026
c72590f
feat: add legacy OFT constants exports
dhruvinparikh Apr 21, 2026
de6078a
feat: add legacy OFT constants exports
dhruvinparikh Apr 21, 2026
1c61acf
build: compile legacy OFT constants to JS
dhruvinparikh Apr 21, 2026
08751f2
Merge upstream/master into feat/lzconstants
dhruvinparikh Apr 21, 2026
4047277
Merge origin/feat/lzconstants into local feat/lzconstants
dhruvinparikh Apr 22, 2026
3a7117f
Merge master into feat/lz-mesh-constants
dhruvinparikh Apr 22, 2026
11ee765
Merge branch 'feat/lz-mesh-constants' into feat/lzconstants
dhruvinparikh Apr 22, 2026
dc5c23f
style: prettier format Constants.sol
dhruvinparikh Apr 22, 2026
dfa6d82
Merge feat/tempo-somnia-constants into feat/lzconstants
dhruvinparikh Apr 22, 2026
2377c3e
chore: make .husky/pre-commit executable
dhruvinparikh Apr 22, 2026
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
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ jobs:
ARBITRUM_URL: ${{ secrets.ARBITRUM_MAINNET_URL }}
FRAXTAL_MAINNET_URL: ${{ secrets.FRAXTAL_MAINNET_RPC_URL }}
steps:
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
node-version: 20.x
- uses: pnpm/action-setup@v4
with:
version: 8.11.0
version: 10

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
- run: forge --version
- run: pnpm i
- run: pnpm install --no-frozen-lockfile
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

CI installs dependencies with --no-frozen-lockfile even though a pnpm-lock.yaml is present. This can make builds non-reproducible (and can pull newer transitive deps than what was reviewed). Prefer pnpm install --frozen-lockfile in CI and ensure the lockfile is kept up to date in PRs.

Suggested change
- run: pnpm install --no-frozen-lockfile
- run: pnpm install --frozen-lockfile

Copilot uses AI. Check for mistakes.
- run: pnpm lint:check
- run: forge build --sizes
# - run: forge test
Empty file modified .husky/pre-commit
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"forge-std": "github:foundry-rs/forge-std#60acb7aaadcce2d68e52986a0a66fe79f07d138f",
"frax-standard-solidity": "github:FraxFinance/frax-standard-solidity#v1.1.3",
"solidity-bytes-utils": "github:GNSPS/solidity-bytes-utils",
"viem": "^2.37.8",
"solmate": "github:transmissions11/solmate#fadb2e2778adbf01c80275bfb99e5c14969d964b",
"@fraxfinance/layerzero-v2-upgradeable": "github:fraxfinance/LayerZero-v2-upgradeable#deps/pin-oz",
"@openzeppelin/contracts-4.8.1": "npm:@openzeppelin/contracts@4.8.1",
Expand Down
2,512 changes: 1,155 additions & 1,357 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
packages: []

onlyBuiltDependencies:
- "frax-standard-solidity"
- "forge-std"
- "ds-test"
- "solmate"
- "solidity-bytes-utils"
- "@fraxfinance/layerzero-v2-upgradeable"
4 changes: 4 additions & 0 deletions scripts/constants/TEMPLATE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
// Multisigs

// PoolRelatedTokens

// LayerZero

// FraxtalLZHop
1 change: 1 addition & 0 deletions scripts/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export * as Mainnet from "./mainnet";
export * as Mode from "./mode";
export * as Moonbeam from "./moonbeam";
export * as Moonriver from "./moonriver";
export * as Movement from "./movement";
export * as Optimism from "./optimism";
export * as Plumephoenix from "./plumephoenix";
export * as Polygon from "./polygon";
Expand Down
12 changes: 12 additions & 0 deletions scripts/constants/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,3 +1032,15 @@ export const KYBERSWAP_ELASTIC_TICK_FEES_READER_V2 = "0x8Fd8Cb948965d9305999D767
export const NON_FUNGIBLE_POSITION_MANAGER = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88";
export const SWAPROUTER = "0xE592427A0AEce92De3Edee1F18E0157C05861564";
export const UNISWAP_V3_FACTORY = "0x1F98431c8aD98523631AE4a59f267346ea31F984";

// LayerZero
export const FPIOFT = "0x9033BAD7aA130a2466060A2dA71fAe2219781B4b";
export const FRXETHOFT = "0x1c1649A38f4A3c5A0c4a24070f688C525AB7D6E6";
export const FRXUSDOFT = "0x566a6442A5A6e9895B9dCA97cC7879D632c6e4B0";
export const SFRXETHOFT = "0xbBc424e58ED38dd911309611ae2d7A23014Bd960";
export const SFRXUSDOFT = "0x7311CEA93ccf5f4F7b789eE31eBA5D9B9290E126";
export const WFRAXOFT = "0x04ACaF8D2865c0714F79da09645C13FD2888977f";

// FraxtalLZHop
export const REMOTEHOP = "0x3ad4dC2319394bB4BE99A0e4aE2AbF7bCEbD648E";
export const REMOTEMINTREDEEMHOP = "0x99B5587ab54A49e3F827D10175Caf69C0187bfA8";
2 changes: 1 addition & 1 deletion scripts/constants/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export const FRXETH = "5sDrwVNiHMM2jC78hRBH1CtysDQYiNKihubgW2zNu8tf"
export const FRXUSD = "GzX1ireZDU865FiMaKrdVB1H6AE8LAqWYCg6chrMrfBw"
export const SFRXETH = "58zpC9acE6F4FBtd88L64NoWHJcmzLsQSy5bjz35Ydgv"
export const SFRXUSD = "DUvWQMyASSkLNJFwsMDA4kwxEvmfaqpPGrvUVKtitX45"
export const WFRAX = "zZbQjiRg8uSxZaPu996XuviuZeSY6nsaMuutKZQBJga"
export const WFRAX = "zZbQjiRg8uSxZaPu996XuviuZeSY6nsaMuutKZQBJga"
51 changes: 35 additions & 16 deletions scripts/generateConstants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as fs from "fs/promises";
import path from "path";
import { isAddress } from "viem"

import * as constants from "./constants";

Expand All @@ -22,11 +23,14 @@ const networkPrefixes = {
FraxtalTestnetL2: "FXTL_TN_L2",
Holesky: "HOLESKY",
Hyperliquid: "HYPE",
Ink: "INK",
Katana: "KTN",
Mainnet: "ETH",
Movement:"MOVE",
Moonbeam: "MNBM",
Moonriver: "MOVR",
Optimism: "OPTI",
Plumephoenix: "PLUME",
Polygon: "POLY",
PolygonzkEVM: "POLY_ZKEVM",
Scroll: "SCROLL",
Expand All @@ -36,7 +40,8 @@ const networkPrefixes = {
Unichain: "UNI",
Worldchain: "WRLD",
Linea: "LINEA",
Zksync:"ZKSYNC"
XLayer: "XLAYER",
Zksync: "ZKSYNC"
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

ZkSync is exported with that casing, but networkPrefixes uses Zksync. This mismatch causes networkPrefixes[networkName] to be undefined and results in Constants.undefined_* labels in generated Solidity. Rename the key to ZkSync and consider failing generation when a prefix is missing.

Copilot uses AI. Check for mistakes.
};

const REMOVE_DUPLICATE_LABELS = false;
Expand All @@ -48,22 +53,27 @@ async function main() {
// Prepare seen/duplicate values
const seenValues = [];

// Generate the files
for (let n = 0; n < networks.length; n++) {
const networkName = networks[n];
const outputString = await handleSingleNetwork(networkName, constants[networkName], seenValues);

const finalString =
`// SPDX-License-Identifier: ISC
const headerString = `// SPDX-License-Identifier: ISC
pragma solidity >=0.8.0;

// **NOTE** Generated code, do not modify. Run 'npm run generate:constants'.

import { TestBase } from "forge-std/Test.sol";

` + outputString;
`

let finalConstantsString = headerString;

// Generate the files
for (let n = 0; n < networks.length; n++) {
const networkName = networks[n];
const outputString = await handleSingleNetwork(networkName, constants[networkName], seenValues);

const finalString = headerString + outputString;
finalConstantsString = finalConstantsString + outputString;
await fs.writeFile(path.resolve("src/contracts/chain-constants", `${networkName}.sol`), finalString);
}
await fs.writeFile(path.resolve("src/", `Constants.sol`), finalConstantsString);
}

async function handleSingleNetwork(networkName, constants, seenValues) {
Expand All @@ -73,7 +83,12 @@ async function handleSingleNetwork(networkName, constants, seenValues) {
if (typeof value === "string") {
// Determine whether it is an address or a string
if (value.startsWith("0x")) {
return ` address internal constant ${key} = ${value};`;
if (isAddress(value)) { return ` address internal constant ${key} = ${value};`; }
else if (value.length === 66) {
return ` bytes32 internal constant ${key} = ${value};`;
} else {
throw new Error("Unidentifed constant type")
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Typo in error message: "Unidentifed" → "Unidentified". Also consider including the key/value in the error to make debugging generation failures easier.

Suggested change
throw new Error("Unidentifed constant type")
throw new Error(`Unidentified constant type for key "${key}" with value "${value}"`);

Copilot uses AI. Check for mistakes.
}
}
return ` string internal constant ${key} = "${value}";`;
} else {
Expand Down Expand Up @@ -109,6 +124,11 @@ async function handleSingleNetwork(networkName, constants, seenValues) {
}
});

const contractString = `library ${networkName} {
${constantString}
}
`;

// Generate the labels for the entries
const labelStrings = Object.entries(constantsToLabel)
.map(([key, value]) => {
Expand All @@ -119,13 +139,11 @@ async function handleSingleNetwork(networkName, constants, seenValues) {
return ` vm.label(${value}, "Constants.${networkPrefixes[networkName]}_${key}");`;
})
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

labelStrings always emits vm.label(${value}, ...), but vm.label only accepts address. Since the generator now supports bytes32 (and some networks may have non-address strings), this can produce invalid Solidity. Consider filtering constantsToLabel so only isAddress(value) === true entries generate labels, and skip/omit everything else.

Copilot uses AI. Check for mistakes.
.join("\n");
const contractString = `library ${networkName} {
${constantString}
}
`;

// if (networkName == "Mainnet") {
const constantsHelper = `
let constantsHelper = "";

if (networkName != "Aptos" && networkName != "Movement" && networkName != "Solana") {
constantsHelper = constantsHelper + `
abstract contract AddressHelper${networkName} is TestBase {
constructor() {
labelConstants();
Expand All @@ -136,6 +154,7 @@ ${labelStrings}
}
}
`;
}
return contractString + constantsHelper;
// }
// return contractString;
Expand Down
Loading
Loading