Cloning Split contracts
In some situations, you can create the same contract at the same address on different chains. This is particularly useful if you accidentally sent funds to a Split on the wrong chain and you want to clone that Split to the same address on a new chain.
There are a few ways to do this. That said, there are a few caveats, so we recommend you read these instructions fully before diving in.
When you can clone
Cloning a Split is only possible with immutable v1 Splits or v2+ Splits. The app makes this easier for you, but here's the breakdown of when a Split can be cloned.
To find out whether you can clone a Split through the app, go to the Split detail view and click the Clone Contract button.
If the Split can be cloned in the app, you will see a list of available chains onto which the Split can be cloned. Continue to the next section.
If the Split cannot be cloned in the app, you will see the reason why. Skip the next section and go to the section, "Cloning a Split via a block explorer".
Cloning a Split via the app
Once you click Clone Contract and see a list of chain, just select the chain to clone the Split onto. In a new tab, you'll see a pre-filled new Split form.
At the bottom of the form click View Split Address. Make sure this address matches exactly the address of the Split you're cloning.
If the addresses do not match, do not create the Split. If the addresses do match, connect your wallet and deploy your Split.
Cloning a Split via a block explorer
If the app says your Split cannot be cloned via the app, you'll be told why this is the case. Here are the possible reasons:
- It's a mutable v1 Split. These cannot be cloned at all.
- It's an immutable v1 Split. These can be cloned via a block explorer. Continue reading.
- It's a v2 Split that has been modified. These can be cloned via a block explorer. Continue reading.
- It's a v2 Split that was created via a third party app. These can be cloned via a block explorer. Continue reading.
- It's a v2 Split has the same configuration on the network. This is rare. Technically these can be cloned, but it's not straightforward. Please reach out to us if you run into this issue.
This is an advanced tutorial, and we recommend only doing this if you're unable to use the app to clone a Split.
To clone the Split onto a new chain, here's what we'll do:
- We'll copy the input data from the "Split Created" transaction on the original Split.
- We'll copy the factory address of the contract that created the Split.
- We'll then build the transaction and send that same data to the Split factory address on the new chain.
Get input data from original Split
First, make sure you have "Show hex data" turned on in your MetaMask settings.
- Open MetaMask
- Click the 3 dots in the top right
- Click Settings
- Click Advanced
- Scroll down to the "Show hex data" setting (you can turn this setting off after you've successfully duplicated the Split)
Second, open the create Split transaction in the block explorer for the Split you wish to duplicate. To do this:
- Go to the Split detail page.
- Scroll down to the Activity section and find the very first event. It should say "Split Created".
- Hover over that and click the arrow + square icon to open that transaction on a block explorer.
Ensure you're viewing the right transaction. You should see something like "Call Create Split
Function by ..." in the Transaction Action section on the block explorer.
If you don't see this, you should reach out to the app through with you created the Split (e.g., Titles, fxhash, Zora, etc). Ask them to help you find the input hex data passed to the CreateSplit
function.
Once you've found the right transaction, scroll down to the "More Details" section and click "+ Click to show more".
In the "Input Data" section:
- Click the "View Input As" dropdown
- Select "Original"
You should now see a long string of characters that begins with 0x
. This is the data that was sent to the smart contract that created the Split, which we need in order to duplicate the Split.
You will eventually need to paste this entire string into MetaMask. For now, copy and paste it somewhere you can reference.
Get the factory address
Find the smart contract address that actually created the Split. To find this, scroll up to the To field and copy that 0x...
address.
Build the transaction
Finally, open MetaMask, make sure you're connected to the network on which you want to deploy the duplicated Split, and click Send to create a new transaction.
In the To field, paste in the factory address you just copied. (This is the factory contract that created the Split.)
Do not change the Asset and Amount fields—leave them as they are.
In the Hex data field, paste in that long Input Data string that we copied from the Input data.
Note: since the MetaMask popup closes each time you change tabs, it might be easier to open MetaMask in it's own window. To do this: open the MetaMask extension, click the 3 dots in the top right, click Expand view.
Click Next to preview the transaction. You should see a message at the top of the transaction that says "Contract interaction".
Confirm the transaction and your Split will be created on the new chain.
You can locate your Split in the app on the new chain by searching for the address in the app like we did previously (in the second step of the "If the addresses do not match" section). It might take a minute or two for our app to register the new Split.
Remember that you just created a new Split according to the original configuration of the duplicated Split. You will want to update your newly created Split since it's likely not the configuration you need. You can do that using the app as you normally would: connect your wallet, go to the Split detail page, and click Edit.