10 Steps to Launch Contracts with Same CA

If you want to create multiple contracts on various networks/layers you may want to have them share the same contract address. This is not a requirement, and actually, RebelMint template contracts don't have the same contract address. It really doesn't matter, but if you wanted to have a consistent address across the networks, here's one way to achieve it.

  1. Identify which account you want to 'own' the contract, note that this should be a secure account that you control, and is not an exchange address. This might be your 'artist' account address, and for simplicity I'll call it the artist account. Keep this account address handy for a later steps.

  2. Make a brand new address (it can be a hot account, up to you) to deploy all contracts from, let's call it the deployment account. This is so that the nonce of the account on each network is the same - initially 0. When creating contracts, the nonce affects the created contract's address, so you want it to be the same on each network

  3. Send deployment funds to the deployment account on each network. It doesn't matter where from, and it doesn't matter in how many transactions (receiving funds to an account doesn't increase that account's nonce, only transactions sent from that account do). You can send funds manually, or you can use a multisending bridge, like gas.zip

  4. Set your network in your browser extension (MetaMask, for example), and select the deployment account as the active one.

  5. Open RebelMint.org, disconnect your wallet if it's already connected, refresh the page, and reconnect on the network you're currently deploying on with the link in top right. Make sure you're connected with the deployment account .

  6. In the Execute section in the nav, click on Create Contract, verify the network, complete the form and create the contract.

  7. After creation, links will appear to see the contract on the network explorer and to set up the contract on RebelMint. Open both in new tabs.

    1. In the RebelMint contract setup tab, complete the setup and be sure to change the fund-receiver address. You can set the funds receiver to anything you want, but most likely you'll use the artist account that you identified in step 1. Send the transaction, and once it's confirmed, you can close the tab.

    2. On the network explorer, note the contract address (if everything goes right, it'll be consistent across the networks - letter capitalization might be different but don't worry about that). You want to interact with the smart contract to transfer ownership to the artist account that you identified in step 1. The function is called transferOwnership(), and all you do is enter the account address that you want to own the contract, the artist account , but be careful! Setting a contract's owner to an address you don't control will mean that you won't be able to edit the contract or create tokens, and you don't want that. Double check the address entered is correct, then send the transaction. Once it's confirmed, you can close the tab.

  8. After you have a contract deployed on a network and have the ownership updated to the artist account, you can close your open tabs and jump back to step 4 to create contracts on other networks. Repeat until you have all contracts deployed and ownership transferred on all desired networks.

  9. When you're all done, (yay!), now you can use the Token Manager page on RebelMint for your contract on each network to create tokens. You'll connect to the site with your artist account (that you transferred ownership to), on whatever network you're using. If you want the same token content in each network, you can use the same tokenURI link, no problem. Only Polygon network uses a non-Eth currency as the base currency, so on that network if you're selling for POL (base currency) you'll need to set the price differently than on other networks (note that POL is not an ERC-20 on Polygon, it's the base currency and uses the 0x0 address).

  10. Now when you share your RebelMint collection URLs, each network will have the same address. Cool!

Last updated