Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add cli option to specify withdrawer address in the add-l1-validator … #11199

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions yarn-project/cli/src/cmds/l1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
.addOption(l1ChainIdOption)
.option('--validator <addresse>', 'ethereum address of the validator', parseEthereumAddress)
.option('--rollup <address>', 'ethereum address of the rollup contract', parseEthereumAddress)
.option(`--withdrawer <address>', 'ethereum address of the withdrawer`, parseEthereumAddress)
.action(async options => {
const { addL1Validator } = await import('./update_l1_validators.js');
await addL1Validator({
Expand All @@ -89,6 +90,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
mnemonic: options.mnemonic,
validatorAddress: options.validator,
rollupAddress: options.rollup,
withdrawerAddress: options.withdrawer,
log,
debugLogger,
});
Expand Down
6 changes: 4 additions & 2 deletions yarn-project/cli/src/cmds/l1/update_l1_validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface RollupCommandArgs {
privateKey?: string;
mnemonic?: string;
rollupAddress: EthAddress;
withdrawerAddress: EthAddress;
}

export interface LoggerArgs {
Expand All @@ -37,9 +38,10 @@ export async function addL1Validator({
mnemonic,
validatorAddress,
rollupAddress,
withdrawerAddress,
log,
debugLogger,
}: RollupCommandArgs & LoggerArgs & { validatorAddress: EthAddress }) {
}: RollupCommandArgs & LoggerArgs & { validatorAddress: EthAddress}) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

might need to run format here

const config = getL1ContractsConfigEnvVars();
const dualLog = makeDualLog(log, debugLogger);
const publicClient = getPublicClient(rpcUrl, chainId);
Expand Down Expand Up @@ -67,7 +69,7 @@ export async function addL1Validator({
const txHash = await rollup.write.deposit([
validatorAddress.toString(),
validatorAddress.toString(),
validatorAddress.toString(),
withdrawerAddress.toString(),
config.minimumStake,
]);
dualLog(`Transaction hash: ${txHash}`);
Expand Down
Loading