Skip to main content

JBSplit

Code​

https://github.com/jbx-protocol/juice-contracts-v3/blob/main/contracts/structs/JBSplit.sol

Definition​

/**
@member preferClaimed A flag that only has effect if a projectId is also specified, and the project has a token contract attached. If so, this flag indicates if the tokens that result from making a payment to the project should be delivered claimed into the beneficiary's wallet, or unclaimed to save gas.
@member preferAddToBalance A flag indicating if a distribution to a project should prefer triggering it's addToBalance function instead of its pay function.
@member percent The percent of the whole group that this split occupies. This number is out of `JBConstants.SPLITS_TOTAL_PERCENT`.
@member projectId The ID of a project. If an allocator is not set but a projectId is set, funds will be sent to the protocol treasury belonging to the project who's ID is specified. Resulting tokens will be routed to the beneficiary with the claimed token preference respected.
@member beneficiary An address. The role the of the beneficary depends on whether or not projectId is specified, and whether or not an allocator is specified. If allocator is set, the beneficiary will be forwarded to the allocator for it to use. If allocator is not set but projectId is set, the beneficiary is the address to which the project's tokens will be sent that result from a payment to it. If neither allocator or projectId are set, the beneficiary is where the funds from the split will be sent.
@member lockedUntil Specifies if the split should be unchangeable until the specified time, with the exception of extending the locked period.
@member allocator If an allocator is specified, funds will be sent to the allocator contract along with all properties of this split.
*/
struct JBSplit {
bool preferClaimed;
bool preferAddToBalance;
uint256 percent;
uint256 projectId;
address payable beneficiary;
uint256 lockedUntil;
IJBSplitAllocator allocator;
}
  • preferClaimed Is a flag that only has effect if a projectId is also specified, and the project has a token contract attached. If so, this flag indicates if the tokens that result from making a payment to the project should be delivered claimed into the beneficiary's wallet, or unclaimed to save gas.
  • preferAddToBalance is a flag indicating if a distribution to a project should prefer triggering it's addToBalance function instead of its pay function.
  • percent is the percent of the whole group that this split occupies. This number is out of JBConstants.SPLITS_TOTAL_PERCENT.
  • projectId the ID of a project. If an allocator is not set but a projectId is set, funds will be sent to the protocol treasury belonging to the project who's ID is specified. Resulting tokens will be routed to the beneficiary with the claimed token preference respected.
  • beneficiary is an address. The role the of the beneficary depends on whether or not projectId is specified, and whether or not an allocator is specified. If allocator is set, the beneficiary will be forwarded to the allocator for it to use. If allocator is not set but projectId is set, the beneficiary is the address to which the project's tokens will be sent that result from a payment to it. If neither allocator or projectId are set, the beneficiary is where the funds from the split will be sent.
  • lockedUntil specifies if the split should be unchangeable until the specified time, with the exception of extending the locked period.
  • allocator is if an allocator is specified, funds will be sent to the allocator contract along with all properties of this split.