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

fix zksync estimateL1ToL2Execute #101

Merged
merged 2 commits into from
Apr 16, 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
10 changes: 5 additions & 5 deletions examples/zksync/scripts/changeFeeParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`);

Expand Down
12 changes: 6 additions & 6 deletions examples/zksync/scripts/governance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`);

Expand Down
10 changes: 5 additions & 5 deletions examples/zksync/scripts/setValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`);

Expand Down
10 changes: 5 additions & 5 deletions examples/zksync/scripts/syncBatchRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`);

Expand Down
Loading