You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deploying the same create2 contract with different deployer wallets should result in the same deterministic address. For example, deploying to zksync-testnet and abstract-testnet with two different accounts should still result in the same address.
Using different deployer wallets here will result in two distinct create2 addresses. We should make use of Create2Factory so the deployer wallet is not accounted for. Example script below can be used to determine create2 address regardless of deployer wallet.
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { utils } from "zksync-ethers";
import { hexlify } from "ethers";
const deployScript = async function (hre: HardhatRuntimeEnvironment) {
console.info(`Running deploy script for the Counter contract`);
const artifact = await hre.deployer.loadArtifact("Counter");
const counterBytecodeHash = hexlify(utils.hashBytecode(artifact.bytecode));
const salt =
"0x7935910912126667836566922594852029127629416664760357073852948630";
const create2FactoryAddress = "0x0000000000000000000000000000000000010000";
const deterministicAddress = utils.create2Address(
create2FactoryAddress,
counterBytecodeHash,
salt,
"0x"
);
console.log("Counter contract address: ", deterministicAddress);
};
export default deployScript;
Rather then having to use the above script, it would be nice to make use of the above mentioned command.
It seems it takes account the deployer address
🔄 Reproduction Steps
Deploy Counter contract using create2 with "wallet A" on zksync-testnet observe the address
Deploy the same contract using create2 with "wallet B" on abstract-testnet observe the address
🤔 Expected Behavior
Deterministic address regardless of deployer wallet
😯 Current Behavior
Different address due to different deployer wallets being used
🖥️ Environment
Node version: [e.g., Node 18.16.1]
Operating System & Version: [e.g., Ubuntu 20.04]
Other relevant environment details:
📋 Additional Context
📎 Log Output
Paste any relevant log output here.
The text was updated successfully, but these errors were encountered:
🐛 Bug Report for hardaht-zksync plugins
💥 Plugin name
hardhat-zksync-deploy
📝 Description
Deploying the same create2 contract with different deployer wallets should result in the same deterministic address. For example, deploying to zksync-testnet and abstract-testnet with two different accounts should still result in the same address.
zksync-testnet
abstract-testnet
Using different deployer wallets here will result in two distinct create2 addresses. We should make use of
Create2Factory
so the deployer wallet is not accounted for. Example script below can be used to determine create2 address regardless of deployer wallet.Rather then having to use the above script, it would be nice to make use of the above mentioned command.
It seems it takes account the deployer address
🔄 Reproduction Steps
Counter
contract using create2 with "wallet A" on zksync-testnet observe the address🤔 Expected Behavior
Deterministic address regardless of deployer wallet
😯 Current Behavior
Different address due to different deployer wallets being used
🖥️ Environment
📋 Additional Context
📎 Log Output
The text was updated successfully, but these errors were encountered: