0xsequence / create3 Goto Github PK
View Code? Open in Web Editor NEWCREATE3 (see EIP-3171) implemented in Solidity
CREATE3 (see EIP-3171) implemented in Solidity
Hey Guys,
I am very excited about CREATE3 (thanks for sharing this !!!) and have tried to apply it in our context but I cant manage to produce same contract addresses across different networks.
I have a contract "CrossChainBridgeRouter" (which I want to deploy with same addresses) and in the same .sol-file I have another helper contract with this code:
`contract RouterDeployer {
bytes private salt = bytes('ThisIsMySalt');
function deployRouter() external returns (address) {
return Create3.create3(keccak256(salt), type(CrossChainBridgeRouter).creationCode);
}
}`
and then I have a deploy script that deploys the helper contract and calls the deploy function.
But when I do that in various networks, it produces different addresses and I dont know why. The deployer wallet is the same, the salt is fixed and the contract code doesnt change either. So where is the variation coming from?
This is my deploy script:
` console.log("Deploying from address: ", deployer.address);
console.log("Deploying helper contract that has CREATE3 deployer function...");
const RouterDeployer = await hre.ethers.getContractFactory('RouterDeployer');
const routerDeployer = await RouterDeployer.deploy();
await routerDeployer.deployed();
console.log("Now deploying actual router contract using CREATE3...");
const routerDeployedAt = await routerDeployer.callStatic.deployRouter();
console.log(routerDeployedAt);`
Do you have an idea what I am missing or doing wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.