Skip to content

Commit 8638b84

Browse files
fusmaniiclaude
andauthored
chore: rename deployments.json to legacy-addresses.json and simplify README (#1333)
Replace the manually-maintained deployments/README.md address tables with a pointer to broadcast/deployed-addresses.json as the source of truth. Rename deployments/deployments.json to legacy-addresses.json to reduce redundancy and clarify its legacy Hardhat role. Update all references across the codebase. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2f80d4b commit 8638b84

13 files changed

+30
-202
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This [script](https://github.com/across-protocol/contracts/blob/555475cdee6109af
1919

2020
## Deployed Contract Versions
2121

22-
The latest contract deployments can be found in `/deployments/deployments.json`.
22+
The latest contract deployments can be found in `/broadcast/deployed-addresses.json` (auto-generated by `yarn extract-addresses`). Legacy Hardhat deployment addresses are in `/deployments/legacy-addresses.json`.
2323

2424
## Requirements
2525

@@ -148,7 +148,7 @@ solana program set-upgrade-authority \
148148
--new-upgrade-authority $MULTISIG
149149
```
150150

151-
Update and commit `deployments/deployments.json` with the deployed program ID and deployment slot.
151+
Update and commit `deployments/legacy-addresses.json` with the deployed program ID and deployment slot.
152152

153153
Upload the IDL and set the upgrade authority to the multisig:
154154

deploy/016_deploy_zksync_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5252
let newAddress: string;
5353
// On production, we'll rarely want to deploy a new proxy contract so we'll default to deploying a new implementation
5454
// contract.
55-
// If a SpokePool can be found in deployments/deployments.json, then only deploy an implementation contract.
55+
// If a SpokePool can be found in deployments/legacy-addresses.json, then only deploy an implementation contract.
5656
const proxy = getDeployedAddress("SpokePool", spokeChainId, false);
5757
const implementationOnly = proxy !== undefined;
5858
if (implementationOnly) {

deploy/022_upgrade_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DeployFunction } from "hardhat-deploy/types";
22
import { getContractFactory } from "../utils";
3-
import * as deployments from "../deployments/deployments.json";
3+
import * as deployments from "../deployments/legacy-addresses.json";
44
import { HardhatRuntimeEnvironment } from "hardhat/types";
55
import { FILL_DEADLINE_BUFFER, QUOTE_TIME_BUFFER, WETH } from "./consts";
66

deploy/059_deploy_lens_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5252
let newAddress: string;
5353
// On production, we'll rarely want to deploy a new proxy contract so we'll default to deploying a new implementation
5454
// contract.
55-
// If a SpokePool can be found in deployments/deployments.json, then only deploy an implementation contract.
55+
// If a SpokePool can be found in deployments/legacy-addresses.json, then only deploy an implementation contract.
5656
const proxy = getDeployedAddress("SpokePool", spokeChainId, false);
5757
const implementationOnly = proxy !== undefined;
5858
if (implementationOnly) {

deployments/README.md

Lines changed: 4 additions & 179 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"test:report-gas": "IS_TEST=true REPORT_GAS=true hardhat test",
4949
"evm-contract-sizes": "sh scripts/evm-contract-sizes.sh",
5050
"generate-evm-artifacts": "rm -rf typechain && TYPECHAIN=ethers yarn hardhat typechain",
51-
"process-hardhat-export": "hardhat export --export-all ./cache/massExport.json && ts-node ./scripts/processHardhatExport.ts && prettier --write ./deployments/deployments.json",
51+
"process-hardhat-export": "hardhat export --export-all ./cache/massExport.json && ts-node ./scripts/processHardhatExport.ts && prettier --write ./deployments/legacy-addresses.json",
5252
"pre-commit-hook": "sh scripts/preCommitHook.sh",
5353
"extract-addresses": "./script/utils/extract_foundry_addresses.sh",
5454
"generate-constants-json": "ts-node ./script/utils/GenerateConstantsJson.ts"

script/utils/DeploymentUtils.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ contract DeploymentUtils is Script, Test, Constants, DeployedAddresses, Config {
159159
}
160160

161161
/**
162-
* @notice Get deployed address from deployments.json
162+
* @notice Get deployed address from deployed-addresses.json
163163
* @param contractName Name of the contract
164164
* @param chainId Chain ID
165165
* @param throwOnError Whether to throw error if not found

script/utils/EXTRACT_ADDRESSES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ The script recognizes these chains:
179179
## How It Works
180180

181181
1. The script scans the `broadcast/` directory for `run-latest.json` files
182-
2. It also reads from `deployments/deployments.json` for additional contract addresses
182+
2. It also reads from `deployments/legacy-addresses.json` for additional contract addresses
183183
3. It extracts contract addresses from each file's transaction data
184184
4. It organizes the data by chain ID and contract name
185185
5. It generates the three output files with the extracted information

script/utils/ExtractDeployedFoundryAddresses.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function readDeploymentsFile(deploymentsDir: string): BroadcastFile[] {
143143
const trackedFiles = getTrackedFiles(deploymentsDir);
144144

145145
try {
146-
const deploymentsPath = path.join(deploymentsDir, "deployments.json");
146+
const deploymentsPath = path.join(deploymentsDir, "legacy-addresses.json");
147147
const resolvedPath = path.resolve(deploymentsPath);
148148

149149
// Only include if file exists AND is tracked by git (committed or staged)
@@ -152,7 +152,7 @@ function readDeploymentsFile(deploymentsDir: string): BroadcastFile[] {
152152

153153
for (const [chainId, contracts] of Object.entries(data)) {
154154
if (typeof contracts === "object" && contracts !== null) {
155-
// Create a virtual broadcast file for deployments.json
155+
// Create a virtual broadcast file for legacy-addresses.json
156156
deploymentsFiles.push({
157157
scriptName: "DeploymentsJson",
158158
chainId: parseInt(chainId),
@@ -164,15 +164,15 @@ function readDeploymentsFile(deploymentsDir: string): BroadcastFile[] {
164164
}
165165
}
166166
} catch (error) {
167-
console.error(`Error reading deployments.json: ${error}`);
167+
console.error(`Error reading legacy-addresses.json: ${error}`);
168168
}
169169

170170
return deploymentsFiles;
171171
}
172172

173173
function extractContractAddresses(broadcastFile: BroadcastFile): Contract[] {
174174
if (broadcastFile.isDeploymentsJson && broadcastFile.deploymentsData) {
175-
// Handle deployments.json format
175+
// Handle legacy-addresses.json format
176176
const contracts: Contract[] = [];
177177
const deploymentsData = broadcastFile.deploymentsData;
178178

@@ -359,7 +359,7 @@ function generateAddressesFile(broadcastFiles: BroadcastFile[], outputFile: stri
359359
if (contracts.length > 0) {
360360
const chainId = broadcastFile.chainId;
361361
const chainName = getChainName(chainId);
362-
// For deployments.json, use contract name as scriptName for each contract
362+
// For legacy-addresses.json, use contract name as scriptName for each contract
363363
if (broadcastFile.isDeploymentsJson) {
364364
for (const contract of contracts) {
365365
const scriptName = contract.contractName;
@@ -507,17 +507,17 @@ function main(): void {
507507
console.log(`Scanning broadcast directory: ${broadcastDir}`);
508508
console.log(`Scanning deployments directory: ${deploymentsDir}`);
509509

510-
// Read deployments.json
510+
// Read legacy-addresses.json
511511
const deploymentsFiles = readDeploymentsFile(deploymentsDir);
512512

513513
// Find all broadcast files
514514
const broadcastFiles = findBroadcastFiles(broadcastDir);
515515

516-
// Combine both sources (order is important, deployments.json should be first)
516+
// Combine both sources (order is important, legacy-addresses.json should be first)
517517
const allFiles = [...deploymentsFiles, ...broadcastFiles];
518518

519519
if (allFiles.length === 0) {
520-
console.error("No run-latest.json files found in broadcast directory and no deployments.json found");
520+
console.error("No run-latest.json files found in broadcast directory and no legacy-addresses.json found");
521521
process.exit(1);
522522
}
523523

0 commit comments

Comments
 (0)