diff --git a/examples/zksync/scripts/changeFeeParams.js b/examples/zksync/scripts/changeFeeParams.js index 325e340..2ea35e2 100644 --- a/examples/zksync/scripts/changeFeeParams.js +++ b/examples/zksync/scripts/changeFeeParams.js @@ -69,13 +69,13 @@ task('changeFeeParams', 'Change fee params for zkLink').setAction(async (taskArg /** * The estimateL1ToL2Execute method gives us the gasLimit for sending an L1->L2 message */ - const l2Addr = utils.applyL1ToL2Alias(l2GatewayAddr); + const l1GatewayAliasAddr = utils.applyL1ToL2Alias(l1GatewayAddr); const l2GasLimit = await l2Provider.estimateL1ToL2Execute({ - contractAddress: l2Addr, + caller: l1GatewayAliasAddr, + contractAddress: l2GatewayAddr, calldata: l2GatewayCallData, - overrides: { - value: zkLinkCallValue, - }, + l2Value: zkLinkCallValue, + gasPerPubdataByte: utils.REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT, }); console.log(`Estimate gasLimit on L1 is ${l2GasLimit.valueOf()}`); diff --git a/examples/zksync/scripts/governance.js b/examples/zksync/scripts/governance.js index e137c69..035782a 100644 --- a/examples/zksync/scripts/governance.js +++ b/examples/zksync/scripts/governance.js @@ -130,19 +130,19 @@ async function encodeL1ToL2Calldata(taskArgs, hre, networkInfo) { console.log(`The l2 call value to target address: ${l2CallValue}`); console.log(`The refund address: ${refundAddress}`); - const l2GovernanceAddr = utils.applyL1ToL2Alias(l1GovernanceAddr); - console.log(`The l2 governance address: ${l2GovernanceAddr}`); + const l1GovernanceAliasAddr = utils.applyL1ToL2Alias(l1GovernanceAddr); + console.log(`The l2 governance address: ${l1GovernanceAliasAddr}`); /** * The estimateL1ToL2Execute method gives us the gasLimit for sending an L1->L2 message */ const l2GasLimit = await l2Provider.estimateL1ToL2Execute({ - contractAddress: l2GovernanceAddr, + caller: l1GovernanceAliasAddr, + contractAddress: l2ToContractAddress, calldata: l2CallData, - overrides: { - value: l2CallValue, - }, + l2Value: l2CallValue, + gasPerPubdataByte: utils.REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT, }); console.log(`Estimate gasLimit on L1 is ${l2GasLimit.valueOf()}`); diff --git a/examples/zksync/scripts/setValidator.js b/examples/zksync/scripts/setValidator.js index 16fb061..f2433cd 100644 --- a/examples/zksync/scripts/setValidator.js +++ b/examples/zksync/scripts/setValidator.js @@ -80,13 +80,13 @@ task('setValidator', 'Set validator for zkLink') /** * The estimateL1ToL2Execute method gives us the gasLimit for sending an L1->L2 message */ - const l2Addr = utils.applyL1ToL2Alias(l2GatewayAddr); + const l1GatewayAliasAddr = utils.applyL1ToL2Alias(l1GatewayAddr); const l2GasLimit = await l2Provider.estimateL1ToL2Execute({ - contractAddress: l2Addr, + caller: l1GatewayAliasAddr, + contractAddress: l2GatewayAddr, calldata: l2GatewayCallData, - overrides: { - value: zkLinkCallValue, - }, + l2Value: zkLinkCallValue, + gasPerPubdataByte: utils.REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT, }); console.log(`Estimate gasLimit on L1 is ${l2GasLimit.valueOf()}`); diff --git a/examples/zksync/scripts/syncBatchRoot.js b/examples/zksync/scripts/syncBatchRoot.js index dfd2d7c..8200024 100644 --- a/examples/zksync/scripts/syncBatchRoot.js +++ b/examples/zksync/scripts/syncBatchRoot.js @@ -89,13 +89,13 @@ task('syncBatchRoot', 'Send batch root from arbitrator to zkLink') /** * The estimateL1ToL2Execute method gives us the gasLimit for sending an L1->L2 message */ - const l2Addr = utils.applyL1ToL2Alias(l2GatewayAddr); + const l1GatewayAliasAddr = utils.applyL1ToL2Alias(l1GatewayAddr); const l2GasLimit = await l2Provider.estimateL1ToL2Execute({ - contractAddress: l2Addr, + caller: l1GatewayAliasAddr, + contractAddress: l2GatewayAddr, calldata: l2GatewayCallData, - overrides: { - value: zkLinkCallValue, - }, + l2Value: zkLinkCallValue, + gasPerPubdataByte: utils.REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT, }); console.log(`Estimate gasLimit on L1 is ${l2GasLimit.valueOf()}`);