marsxr
February 14, 2021, 10:57pm
1
I would like to get a vanity contract address.
Just like 1INCH: https://etherscan.io/token/0x111111111117dc0aa78b770fa6a738034120c302
Just like TORN: https://etherscan.io/address/0x77777feddddffc19ff86db637967013e6c6a116c
I would like to deploy to multiple chains: ETH mainnent, xDAI, BSC (Binance Smart Chain).
(I’m not religious about particular chain, some of them have fees that make use prohibitively expensive)
I think that in order to accomplish the same address on multiple chains, I will have to use CREATE2
: https://blog.openzeppelin.com/getting-the-most-out-of-create2/
Same contract address on multiple chains (EVM comparible) possible?
Maybe you have a piece of code handy to generate a salt and find such cool addresses?
Thank you for suggestions
2 Likes
Hi @marsxr ,
The problem appears to be in two parts. How to create a vanity address (trial and error) and how to create the same address on multiple chains.
OpenZeppelin Contracts includes a utility for Create2: https://docs.openzeppelin.com/contracts/3.x/api/utils#Create2
You could look at how EIP1820 registry uses the same address on every network (it also has a vanity address):
marsxr
February 15, 2021, 9:37am
4
There are two parts to this question.
Here is another example: https://github.com/gnosis/safe-contract-deployment-replay
Replaying the deployment, same account, same nonce, same gas price, everything the same.
The reason why I prefer CREATE2
and salt is less private key to manage, I could reuse one of the private keys that I already have in place.
I guess I'll need to figure it out, my use case is not typical
2 Likes
Amxx
February 15, 2021, 10:49am
5
Hello @marsxr ,
I run into that issue a few months ago, and came up with this factory:
The Contract Address 0xfac000a12da42b871c0aad5f25391aae62958db1 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on...
It is available on most networks, and there is a package to help you deploy on additional networks, or even on local test chains. It uses create2, so you just have to give it the bytecode and a salt.
I do not have a vanity address generator that, given a bytecode and a regexp would “mine” a salt for you, but it might not be very hard to write one.
2 Likes
marsxr
March 1, 2021, 7:49am
6
Realizing some troubles related to oracle (Chainlink).
BSC and XDAI do not have native oracle system yet.
Some of the DeFi functionality is ETH only.
I may still want to deploy a token on multiple chains, using the same address, using CREATE2
Then the contracts using that token can be a little bit different.
Related:
At this point I’m reaching a conclusion that I’m overthinking, paralysis analysis, done is better than perfect.
1 Like