chore: consolidate local WIP (repo cleanup 20260707)
All checks were successful
CI / lint-and-test (push) Successful in 9m52s
All checks were successful
CI / lint-and-test (push) Successful in 9m52s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -24,8 +24,13 @@ async function main() {
|
||||
console.log("\nDeploying SubAccountFactory...");
|
||||
const SubAccountFactory = await ethers.getContractFactory("SubAccountFactory");
|
||||
const factory = await SubAccountFactory.deploy();
|
||||
const factoryDeployTx = factory.deploymentTransaction();
|
||||
await factory.waitForDeployment();
|
||||
const factoryAddress = await factory.getAddress();
|
||||
const factoryBlock =
|
||||
factoryDeployTx != null
|
||||
? (await factoryDeployTx.wait())?.blockNumber ?? null
|
||||
: null;
|
||||
console.log("SubAccountFactory deployed to:", factoryAddress);
|
||||
|
||||
// Deploy a TreasuryWallet with initial owners
|
||||
@@ -37,8 +42,13 @@ async function main() {
|
||||
|
||||
const TreasuryWallet = await ethers.getContractFactory("TreasuryWallet");
|
||||
const treasury = await TreasuryWallet.deploy(owners, threshold);
|
||||
const treasuryDeployTx = treasury.deploymentTransaction();
|
||||
await treasury.waitForDeployment();
|
||||
const treasuryAddress = await treasury.getAddress();
|
||||
const treasuryBlock =
|
||||
treasuryDeployTx != null
|
||||
? (await treasuryDeployTx.wait())?.blockNumber ?? null
|
||||
: null;
|
||||
console.log("TreasuryWallet deployed to:", treasuryAddress);
|
||||
|
||||
// Save deployment addresses to a JSON file
|
||||
@@ -47,6 +57,7 @@ async function main() {
|
||||
chainId: 138,
|
||||
deployedAt: new Date().toISOString(),
|
||||
deployer: deployer.address,
|
||||
deployBlock: treasuryBlock ?? factoryBlock ?? null,
|
||||
contracts: {
|
||||
SubAccountFactory: factoryAddress,
|
||||
TreasuryWallet: treasuryAddress,
|
||||
|
||||
59
contracts/scripts/verify-chain138.ts
Normal file
59
contracts/scripts/verify-chain138.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { run, network } from "hardhat";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
async function main() {
|
||||
const deployPath = path.join(__dirname, "../deployments/chain138.json");
|
||||
if (!fs.existsSync(deployPath)) {
|
||||
throw new Error("Missing deployments/chain138.json — run pnpm run deploy:chain138 first");
|
||||
}
|
||||
|
||||
const deployment = JSON.parse(fs.readFileSync(deployPath, "utf8")) as {
|
||||
deployer: string;
|
||||
contracts: { SubAccountFactory: string; TreasuryWallet: string };
|
||||
};
|
||||
|
||||
if (network.name !== "chain138") {
|
||||
console.log("Using network:", network.name);
|
||||
}
|
||||
|
||||
console.log("Verifying SubAccountFactory:", deployment.contracts.SubAccountFactory);
|
||||
try {
|
||||
await run("verify:verify", {
|
||||
address: deployment.contracts.SubAccountFactory,
|
||||
constructorArguments: [],
|
||||
});
|
||||
console.log("SubAccountFactory verified");
|
||||
} catch (e: unknown) {
|
||||
const msg = e instanceof Error ? e.message : String(e);
|
||||
if (msg.includes("Already Verified") || msg.includes("already verified")) {
|
||||
console.log("SubAccountFactory already verified");
|
||||
} else {
|
||||
console.warn("SubAccountFactory verify:", msg);
|
||||
}
|
||||
}
|
||||
|
||||
const owners = [deployment.deployer];
|
||||
const threshold = 1;
|
||||
|
||||
console.log("Verifying TreasuryWallet:", deployment.contracts.TreasuryWallet);
|
||||
try {
|
||||
await run("verify:verify", {
|
||||
address: deployment.contracts.TreasuryWallet,
|
||||
constructorArguments: [owners, threshold],
|
||||
});
|
||||
console.log("TreasuryWallet verified");
|
||||
} catch (e: unknown) {
|
||||
const msg = e instanceof Error ? e.message : String(e);
|
||||
if (msg.includes("Already Verified") || msg.includes("already verified")) {
|
||||
console.log("TreasuryWallet already verified");
|
||||
} else {
|
||||
console.warn("TreasuryWallet verify:", msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user