Skip to content
Merged
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
3 changes: 3 additions & 0 deletions script/20260619-deploy-v4-authoriser-clone.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ contract DeployV4AuthoriserClone is Script {
if (block.chainid == LibSafeInvariants.BASE_CHAIN_ID) {
return LibProdDeployV4.STOX_PROD_AUTHORISER_V4_CLONE;
}
if (block.chainid == LibSafeInvariants.HYPEREVM_CHAIN_ID) {
return LibProdDeployV4.STOX_PROD_AUTHORISER_V4_CLONE_HYPEREVM;
}
revert V4AuthoriserCloneUnsupportedChain(block.chainid);
}

Expand Down
4 changes: 4 additions & 0 deletions script/BuildPointers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ contract BuildPointers is Script {
GEN_V4_PATH,
"address constant STOX_PROD_AUTHORISER_V4_CLONE_ETHEREUM = address(0x66566cc91dEAf818859bD4b09B7903ac48998157);"
);
vm.writeLine(
GEN_V4_PATH,
"address constant STOX_PROD_AUTHORISER_V4_CLONE_HYPEREVM = address(0x66566cc91dEAf818859bD4b09B7903ac48998157);"
);
vm.writeLine(GEN_V4_PATH, "uint256 constant V4_SWAP_DEADLINE = 1_793_491_200;");
for (uint256 t = 0; t < tags.length; t++) {
for (uint256 c = 0; c < 12; c++) {
Expand Down
1 change: 1 addition & 0 deletions src/generated/LibProdDeployV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ library LibProdDeployV4 {
bytes32 constant STOX_PROD_AUTHORISER_V4_CLONE_CODEHASH =
0x2089950d3cc1112dd66a58adcfadeadc490b50053ac67be8bc676b4a2dcd1717;
address constant STOX_PROD_AUTHORISER_V4_CLONE_ETHEREUM = address(0x66566cc91dEAf818859bD4b09B7903ac48998157);
address constant STOX_PROD_AUTHORISER_V4_CLONE_HYPEREVM = address(0x66566cc91dEAf818859bD4b09B7903ac48998157);
uint256 constant V4_SWAP_DEADLINE = 1_793_491_200;
address constant STOX_RECEIPT_0_1_1 = STOX_RECEIPT_ADDRESS_0_1_1_GEN;
bytes32 constant STOX_RECEIPT_CODEHASH_0_1_1 = STOX_RECEIPT_CODEHASH_0_1_1_GEN;
Expand Down
3 changes: 3 additions & 0 deletions src/lib/LibSafeInvariants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ library LibSafeInvariants {
/// @notice Ethereum mainnet chain id.
uint256 internal constant ETHEREUM_CHAIN_ID = 1;

/// @notice HyperEVM mainnet chain id.
uint256 internal constant HYPEREVM_CHAIN_ID = 999;
Comment on lines +197 to +198

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Add the HyperEVM Safe mapping before enabling this chain ID.

safeForChainId in this file handles only BASE_CHAIN_ID and ETHEREUM_CHAIN_ID at Lines 473-480. DeployV4AuthoriserClone.run() calls assertActiveChainTokenOwnerSafe(block.chainid) before deployment, so block.chainid == 999 always reverts with UnsupportedChainForTokenOwnerSafe. The new HyperEVM clone branch is therefore unreachable. Add the correct HyperEVM Safe address and mapping, then add a HyperEVM fork test for this pre-flight path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/LibSafeInvariants.sol` around lines 197 - 198, Add the correct
HyperEVM token-owner Safe address and include HYPEREVM_CHAIN_ID in
safeForChainId alongside the existing BASE_CHAIN_ID and ETHEREUM_CHAIN_ID
mappings. Ensure DeployV4AuthoriserClone.run() can pass
assertActiveChainTokenOwnerSafe(block.chainid) on chain 999, and add a HyperEVM
fork test covering this pre-flight deployment path.


/// @notice The ST0x token-owner Safe on **Base** (the reference chain).
address internal constant STOX_TOKEN_OWNER_SAFE = 0xe70d821f3462a074e63b42d0AaC6523faAe1d611;

Expand Down
Loading