Skip to content

Commit

Permalink
add tsconfig; use node over ts-node for deploy / verify scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
DZGoldman committed Apr 18, 2023
1 parent 8d63045 commit 49ff3f0
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 54 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ files/local/l1ArbProtocolTransferTXs.json
files/local/l1ArbTokenBridgeTransferTXs.json
files/local/l1NovaProtocolTransferTXs.json
files/local/l1NovaTokenBridgeTransferTXs.json
dist
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"execute:ownership:transfer": "ts-node ./scripts/executeLocalProtocolOwnershipTransfer.ts",
"verify:ownership:transfer": "ts-node ./scripts/protocolOwnershipVerifier.ts",
"verify:contracts:etherscan": "ts-node ./scripts/verifyContractsCode.ts",
"deploy:foundation-wallet": "ts-node ./scripts/foundation-wallet-deployment/deploy.ts",
"verify:foundation-wallet": "ts-node ./scripts/foundation-wallet-deployment/verifyDeployment.ts",
"deploy:foundation-wallet": "tsc && node ./dist/scripts/foundation-wallet-deployment/deploy.js",
"verify:foundation-wallet": "tsc && node ./dist/scripts/foundation-wallet-deployment/verifyDeployment.js",
"test:integration": "hardhat test",
"test:proposals": "ts-node ./scripts/proposalTests.ts",
"format:sol": "forge fmt"
Expand Down
106 changes: 54 additions & 52 deletions scripts/deployGoerliGovParamUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,67 +28,69 @@ if (!apiKey) {
throw new Error("Set VERIFY_API_KEY");
}

// NOTE: needs updating for new Address Registry Interfaces; low priority, commenting out so tsc succeeds

const main = async () => {
const l1Deployer = new Wallet(l1Key, new JsonRpcProvider(l1RPC));
const l1Verifier = new ContractVerifier(5, apiKey, {});
// const l1Deployer = new Wallet(l1Key, new JsonRpcProvider(l1RPC));
// const l1Verifier = new ContractVerifier(5, apiKey, {});

const l2Deployer = new Wallet(l2Key, new JsonRpcProvider(L2_RPC));
const l2Verifier = new ContractVerifier(421613, apiKey, {});
// const l2Deployer = new Wallet(l2Key, new JsonRpcProvider(L2_RPC));
// const l2Verifier = new ContractVerifier(421613, apiKey, {});

const l1AddressRegistryFactory = new L1AddressRegistry__factory().connect(l1Deployer);
const l1AddressRegistry = await l1AddressRegistryFactory.deploy(
GOERLI_ROLLUP_INBOX,
GOERLI_ROLLUP_GOV_L1_TIMELOCK
);
await l1AddressRegistry.deployed();
console.log("L1AddressRegistry", l1AddressRegistry.address);
// const l1AddressRegistryFactory = new L1AddressRegistry__factory().connect(l1Deployer);
// const l1AddressRegistry = await l1AddressRegistryFactory.deploy(
// GOERLI_ROLLUP_INBOX,
// GOERLI_ROLLUP_GOV_L1_TIMELOCK
// );
// await l1AddressRegistry.deployed();
// console.log("L1AddressRegistry", l1AddressRegistry.address);

await l1Verifier.verifyWithAddress(
"L1AddressRegistry",
l1AddressRegistry.address,
abi.encode(["address", "address"], [GOERLI_ROLLUP_INBOX, GOERLI_ROLLUP_GOV_L1_TIMELOCK])
);
// await l1Verifier.verifyWithAddress(
// "L1AddressRegistry",
// l1AddressRegistry.address,
// abi.encode(["address", "address"], [GOERLI_ROLLUP_INBOX, GOERLI_ROLLUP_GOV_L1_TIMELOCK])
// );

const setGovL1ParamsFactory = new L1SetInitialGovParamsAction__factory().connect(l1Deployer);
const setL1GovParams = await setGovL1ParamsFactory.deploy(l1AddressRegistry.address);
await setL1GovParams.deployed();
console.log("L1SetInitialGovParamsAction", setL1GovParams.address);
// const setGovL1ParamsFactory = new L1SetInitialGovParamsAction__factory().connect(l1Deployer);
// const setL1GovParams = await setGovL1ParamsFactory.deploy(l1AddressRegistry.address);
// await setL1GovParams.deployed();
// console.log("L1SetInitialGovParamsAction", setL1GovParams.address);

await l1Verifier.verifyWithAddress(
"L1SetInitialGovParamsAction",
setL1GovParams.address,
abi.encode(["address"], [l1AddressRegistry.address])
);
// await l1Verifier.verifyWithAddress(
// "L1SetInitialGovParamsAction",
// setL1GovParams.address,
// abi.encode(["address"], [l1AddressRegistry.address])
// );

const l2GovRegistryFactory = new L2AddressRegistry__factory().connect(l2Deployer);
const l2GovRegistry = await l2GovRegistryFactory.deploy(
GOERLI_ROLLUP_CORE_GOV,
GOERLI_ROLLUP_TREASURY_GOV,
GOERLI_ROLLUP_TREASURY_WALLET
);
await l2GovRegistry.deployed();
console.log("L2AddressRegistry", l2GovRegistry.address);
await l2Verifier.verifyWithAddress(
"L2AddressRegistry",
l2GovRegistry.address,
abi.encode(
["address", "address", "address"],
[GOERLI_ROLLUP_CORE_GOV, GOERLI_ROLLUP_TREASURY_GOV, GOERLI_ROLLUP_TREASURY_WALLET]
)
);
// const l2GovRegistryFactory = new L2AddressRegistry__factory().connect(l2Deployer);
// const l2GovRegistry = await l2GovRegistryFactory.deploy(
// GOERLI_ROLLUP_CORE_GOV,
// GOERLI_ROLLUP_TREASURY_GOV,
// GOERLI_ROLLUP_TREASURY_WALLET
// );
// await l2GovRegistry.deployed();
// console.log("L2AddressRegistry", l2GovRegistry.address);
// await l2Verifier.verifyWithAddress(
// "L2AddressRegistry",
// l2GovRegistry.address,
// abi.encode(
// ["address", "address", "address"],
// [GOERLI_ROLLUP_CORE_GOV, GOERLI_ROLLUP_TREASURY_GOV, GOERLI_ROLLUP_TREASURY_WALLET]
// )
// );

const setL2GovParamsFactory = new ArbGoerliSetInitialGovParamsAction__factory().connect(
l2Deployer
);
const setL2GovParams = await setL2GovParamsFactory.deploy(l2GovRegistry.address);
await setL2GovParams.deployed();
console.log("ArbGoerliSetInitialGovParams", setL2GovParams.address);
// const setL2GovParamsFactory = new ArbGoerliSetInitialGovParamsAction__factory().connect(
// l2Deployer
// );
// const setL2GovParams = await setL2GovParamsFactory.deploy(l2GovRegistry.address);
// await setL2GovParams.deployed();
// console.log("ArbGoerliSetInitialGovParams", setL2GovParams.address);

await l2Verifier.verifyWithAddress(
"ArbGoerliSetInitialGovParamsAction",
setL2GovParams.address,
abi.encode(["address"], [l2GovRegistry.address])
);
// await l2Verifier.verifyWithAddress(
// "ArbGoerliSetInitialGovParamsAction",
// setL2GovParams.address,
// abi.encode(["address"], [l2GovRegistry.address])
// );
};

main().then(() => console.log("Done."));
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"resolveJsonModule": true
},
"include": ["./scripts", "./src-ts", "test-ts"],
}

0 comments on commit 49ff3f0

Please sign in to comment.