🎯Same-address tokens
Learn how to create ERC-20 tokens with the same address on different blockchains using 20lab.
What Are Same-Address Tokens?
If you want to have a cross-chain token (two separate token smart contracts connected by a bridge), it is sometimes important to keep the same addresses for both. This can have benefits such as:
Easier bridge setup
Proof to users that it is the same token across chains
Simplified integration for wallets and exchanges
How It Works
We've enabled this feature by using a hybrid contract initialization approach. Instead of only using the constructor in the token smart contract, we also include an initializer - a public function that can be run only once to set up the core functionality of the token.
Although this method isn't mandatory when users deploy tokens directly from their wallet, it's necessary in our case. We use the CREATE2 opcode to maintain the same token address even if some parameters are changed in the bytecode.
Prerequisites
These requirements must be met to obtain same-address tokens:
Both tokens must be generated using the 20lab generator v. 1.6.0 or higher.
Both tokens must be generated with EXACTLY THE SAME parameters, except for:
Default exchange: Only the "Token integration template" must be the same (see supported exchanges documentation)
Custom token for wallet taxes: Can be different between chains
Custom token for dividends: Can be different between chains
The above 3 parameters can be different in both tokens and won't affect the token address in any way.
Step-by-Step Process
Step 1: Deploy Your First Token
Deploy the first token on 20lab.app by choosing your features, compiling it, and creating it on the first blockchain where you want it to exist.

Step 2: Modify Address (Optional)
After compilation, you can optionally change the address by modifying the salt or searching for a desired pattern in the token address.
Step 3: Get Creation Details
After successful deployment, go to your dashboard and you will see an info icon below your token address. Click on it to see the creation details.


Step 4: Copy the Salt
Copy and save the "Salt" value from the creation details. You'll need this for your second token.
Creating the Second Token
Step 1: Start Second Token Creation
Begin creating the second token on a different blockchain.

Important: Keep all the parameters exactly the same as in the first token, because all of them will affect the address of your next token (with the few exceptions listed in the Prerequisites section).
This is intentional behavior to prevent others from creating another token at the same address as yours. Because the parameters must be identical, no one can insert their own owner address or add a recipient - this would change the token address completely.
Step 2: Validate and Use Salt
Validate your token configuration and select the 'Modify by salt' option.

Paste the copied salt from your first token and check if your token address matches the first token's address.

If you haven't changed any parameters other than the allowed exceptions, your second token address should be exactly the same as the first one.
Step 3: Deploy the Second Token
Deploy your second token with the matching address.
Success! 👏
You now have both tokens with the same address on two different blockchains.
Example of successful same-address deployment:
Ethereum Goerli:
0x8960b7E3912B4eb03d8195aC1F0Db9Fdb6B17827
BSC Testnet:
0x8960b7E3912B4eb03d8195aC1F0Db9Fdb6B17827

Important Security Notes
Parameter Verification: Always double-check that your parameters match exactly (except for the allowed exceptions)
Address Validation: Always verify the address matches before deploying the second token
Bridge Setup: Having the same address simplifies bridge configuration but doesn't automatically create the bridge connection
Troubleshooting
If addresses don't match:
Verify all parameters are identical (except allowed exceptions)
Check that you're using the correct salt
Ensure you're using generator v. 1.6.0 or higher
Review that the token integration template for your Default Exchange is the same for both tokens
Last updated
Was this helpful?