Split
The Split contract lets you specify multiple wallet addresses who are recipients of any revenue or royalty split. You define what percentage of funds that get sent to this address go to each recipient you specify.
For example, you could define 0x1 and 0x2 and configure them both to receive 50% of the funds that go to this wallet. The split contract will store the funds, and will split the funds between the two recipients when either user
This contract also has the ability to hold native currencies (ETH and MATIC) and any ERC-20 tokens.
The Split contract is a way to easily create a royalty split to securely hold and distribute funds. You can use it to store any funds by sending funds directly to the contract, using it's address as the recipient address of other contracts, or any other way that you can send funds to a standard wallet.
You could use the Split contract to:
- Use as a "team wallet", where funds are distributed between the members of your team with set percentages.
- Share revenue from your primary minting in an NFT drop
- Share revenue from our royalty sales with members of your team such as an artist
- Any programmatic split of revenue
Create a Split Contract
Learn how to create any of thirdweb's pre-built contracts in the Deploying Contracts page.
Getting the contract in your application
To start using your Split contract inside your application, you'll need to use it's contract address. You can get the contract address from the dashboard.
- Javascript
- React
- Python
- Go
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK("rinkeby");
const contract = sdk.getSplit("{{contract_address}}");
import { useSplit } from '@thirdweb-dev/react'
export default function Component() {
const split = useSplit("<YOUR-CONTRACT-ADDRESS>")
// Now you can use the split contract in the rest of the component
}
Python SDK support for initializing the SDK is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for initializing the SDK is coming soon.
Want this feature sooner? Let us know in Discord!
View Recipients
Using the dashboard
You can view the recipients of your Split contract in the Overview button on the dashboard.
Using the SDK
- Javascript
- React
- Python
- Go
const recipients = await contract.getAllRecipients();
console.log(recipients);
React SDK support for getAllRecipients is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for getAllRecipients is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for getAllRecipients is coming soon.
Want this feature sooner? Let us know in Discord!
View Balance
In the Overview tab of your split in the dashboard, you can see your (the wallet you're currently connected with)'s split of the funds in this contract.
Native Token Balance
Use this if you have been tokens native to the network (e.g. Ether
on the Ethereum network).
- Javascript
- React
- Python
- Go
// The address to check the funds of
const address = "{{wallet_address}}";
const funds = await contract.balanceOf(address);
console.log(funds);
React SDK support for balanceOf is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for balanceOf is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for balanceOf is coming soon.
Want this feature sooner? Let us know in Discord!
Non-Native Token Balance
Use this if you have been sent custom tokens to the address.
- Javascript
- React
- Python
- Go
// The address to check the funds of
const address = "{{wallet_address}}";
// The address of the currency to check the contracts funds of
const tokenAddress = "0x..."
const funds = await contract.balanceOfToken(address, tokenAddress);
console.log(funds);
React SDK support for balanceOfToken is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for balanceOfToken is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for balanceOfToken is coming soon.
Want this feature sooner? Let us know in Discord!
Distribute funds
This distributes funds held by the contract to all recipeients.
Native Token
- Javascript
- React
- Python
- Go
await contract.distribute();
React SDK support for distribute is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for distribute is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for distribute is coming soon.
Want this feature sooner? Let us know in Discord!
Non-Native Token
- Javascript
- React
- Python
- Go
// The address of the currency to distribute funds
const tokenAddress = "0x..."
await contract.distributeToken(tokenAddress);
React SDK support for distributeToken is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for distributeToken is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for distributeToken is coming soon.
Want this feature sooner? Let us know in Discord!
Withdraw Funds
- Javascript
- React
- Python
- Go
// the wallet address that wants to withdraw their funds
const walletAddress = "{{wallet_address}}"
await contract.withdraw(walletAddress);
React SDK support for withdraw is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for withdraw is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for withdraw is coming soon.
Want this feature sooner? Let us know in Discord!