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

optimizing example scripts #66

Merged
merged 2 commits into from
Mar 1, 2024
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
4 changes: 2 additions & 2 deletions examples/manta/scripts/changeFeeParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ task('changeFeeParams', 'Change fee params for zkLink').setAction(async (taskArg
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new manta.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 3441005, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 3441005 : 169, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/manta/scripts/setValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ task('setValidator', 'Set validator for zkLink')
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new manta.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 3441005, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 3441005 : 169, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/manta/scripts/syncBatchRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ task('syncBatchRoot', 'Forward message to L2').setAction(async (taskArgs, hre) =
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
// https://github.com/Manta-Network/bridging-tutorial/blob/ad640a17264e2f009065811a0ff0872d8063b27b/standard-bridge-custom-token/README.md?plain=1#L152
const messenger = new manta.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 3441005, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 3441005 : 169, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
5 changes: 3 additions & 2 deletions examples/manta/scripts/syncL2Requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ task('syncL2Requests', 'Send sync point to arbitrator')
const l1Provider = new ethers.providers.StaticJsonRpcProvider(process.env.L1RPC);
const l2Provider = new ethers.providers.StaticJsonRpcProvider(process.env.L2RPC);
const mantaName = process.env.MANTA;
const ethereumName = process.env.ETHEREUM;
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new manta.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 3441005, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 3441005 : 169, // 3441005 for Manta Pacific Testnet, 169 for Manta Pacific Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/mantle/scripts/changeFeeParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ task('changeFeeParams', 'Change fee params for zkLink').setAction(async (taskArg
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);

const messenger = new mantle.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 5001, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 5001 : 5000, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/mantle/scripts/setValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ task('setValidator', 'Set validator for zkLink')
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);

const messenger = new mantle.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 5001, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 5001 : 5000, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/mantle/scripts/syncBatchRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ task('syncBatchRoot', 'Forward message to L2').setAction(async (taskArgs, hre) =
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);

const messenger = new mantle.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 5001, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 5001 : 5000, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
5 changes: 3 additions & 2 deletions examples/mantle/scripts/syncL2Requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ task('syncL2Requests', 'Send sync point to arbitrator')
const l1Provider = new ethers.providers.StaticJsonRpcProvider(process.env.L1RPC);
const l2Provider = new ethers.providers.StaticJsonRpcProvider(process.env.L2RPC);
const mantleName = process.env.MANTLE;
const ethereumName = process.env.ETHEREUM;
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new mantle.CrossChainMessenger({
l1ChainId: 5, // 5 for Goerli, 1 for Ethereum
l2ChainId: 5001, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 5 : 1, // 5 for Goerli, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 5001 : 5000, // 5001 for Mantle Testnet, 5000 for Mantle Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
bedrock: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/optimism/scripts/changeFeeParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ task('changeFeeParams', 'Change fee params for zkLink').setAction(async (taskArg
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new optimism.CrossChainMessenger({
l1ChainId: 11155111, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: 11155420, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 11155111 : 1, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 11155420 : 10, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
});
Expand Down
4 changes: 2 additions & 2 deletions examples/optimism/scripts/setValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ task('setValidator', 'Set validator for zkLink')
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new optimism.CrossChainMessenger({
l1ChainId: 11155111, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: 11155420, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 11155111 : 1, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 11155420 : 10, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
});
Expand Down
4 changes: 2 additions & 2 deletions examples/optimism/scripts/syncBatchRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ task('syncBatchRoot', 'Forward message to L2').setAction(async (taskArgs, hre) =
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new optimism.CrossChainMessenger({
l1ChainId: 11155111, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: 11155420, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 11155111 : 1, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 11155420 : 10, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
});
Expand Down
5 changes: 3 additions & 2 deletions examples/optimism/scripts/syncL2Requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ task('syncL2Requests', 'Send sync point to arbitrator')
const l1Provider = new ethers.providers.StaticJsonRpcProvider(process.env.L1RPC);
const l2Provider = new ethers.providers.StaticJsonRpcProvider(process.env.L2RPC);
const optimismName = process.env.OPTIMISM;
const ethereumName = process.env.ETHEREUM;
const l1Wallet = new ethers.Wallet(walletPrivateKey, l1Provider);
const l2Wallet = new ethers.Wallet(walletPrivateKey, l2Provider);
const messenger = new optimism.CrossChainMessenger({
l1ChainId: 11155111, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: 11155420, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1ChainId: ethereumName !== 'ETHEREUM' ? 11155111 : 1, // 11155111 for Sepolia, 1 for Ethereum
l2ChainId: ethereumName !== 'ETHEREUM' ? 11155420 : 10, // 11155420 for OP Sepolia, 10 for OP Mainnet
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Wallet,
});
Expand Down
2 changes: 1 addition & 1 deletion examples/zksync/scripts/changeFeeParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ task('changeFeeParams', 'Change fee params for zkLink').setAction(async (taskArg
const zkLinkCallValue = ethers.parseEther('0');
const zkLinkCallData = zkLinkFactory.interface.encodeFunctionData('changeFeeParams', [INIT_FEE_PARAMS]);
const l2GatewayFactory = await hre.ethers.getContractFactory('ZkSyncL2Gateway');
const l2GatewayCallData = l2GatewayFactory.interface.encodeFunctionData('claimMessage', [
const l2GatewayCallData = l2GatewayFactory.interface.encodeFunctionData('claimMessageCallback', [
zkLinkCallValue,
zkLinkCallData,
]);
Expand Down
2 changes: 1 addition & 1 deletion examples/zksync/scripts/setValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ task('setValidator', 'Set validator for zkLink')
const zkLinkCallValue = ethers.parseEther('0');
const zkLinkCallData = zkLinkFactory.interface.encodeFunctionData('setValidator', [validatorAddr, isActive]);
const l2GatewayFactory = await hre.ethers.getContractFactory('ZkSyncL2Gateway');
const l2GatewayCallData = l2GatewayFactory.interface.encodeFunctionData('claimMessage', [
const l2GatewayCallData = l2GatewayFactory.interface.encodeFunctionData('claimMessageCallback', [
zkLinkCallValue,
zkLinkCallData,
]);
Expand Down
2 changes: 1 addition & 1 deletion examples/zksync/scripts/syncBatchRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ task('syncBatchRoot', 'Send batch root from arbitrator to zkLink')
const zkLinkCallValue = ethers.parseEther(msgValue);
const zkLinkCallData = zkLinkFactory.interface.encodeFunctionData('syncBatchRoot', [number, hash, 0]);
const l2GatewayFactory = await hre.ethers.getContractFactory('ZkSyncL2Gateway');
const l2GatewayCallData = l2GatewayFactory.interface.encodeFunctionData('claimMessage', [
const l2GatewayCallData = l2GatewayFactory.interface.encodeFunctionData('claimMessageCallback', [
zkLinkCallValue,
zkLinkCallData,
]);
Expand Down
Loading