_payToSplits
Contract: JBETHERC20SplitsPayer
- Step by step
- Code
- Events
- Bug bounty
Split an amount between all splits.
Definition
function _payToSplits(
  uint256 _splitsProjectId,
  uint256 _splitsDomain,
  uint256 _splitsGroup,
  address _token,
  uint256 _amount,
  uint256 _decimals,
  address _defaultBeneficiary
) internal virtual returns (uint256 leftoverAmount) { ... }
- Arguments:
- _splitsProjectIdis the ID of the project to which the splits belong.
- _splitsDomainis the splits domain to which the group belongs.
- _splitsGroupis the splits group to pay.
- _tokenis the token the amonut being split is in.
- _amountis the amount of tokens being split, as a fixed point number. If the- _tokenis ETH, this is ignored and msg.value is used in its place.
- _decimalsis the number of decimals in the- _amountfixed point number.
- _defaultBeneficiaryis the address that will benefit from any non-specified beneficiaries in splits.
 
- The function is private to this contract.
- The function returns the amount leftover after all splits were paid.
Body
- 
Pay the splits of the specified project, domain, and group. // Pay the splits.
 leftoverAmount = _payTo(
 splitsStore.splitsOf(_splitsProjectId, _splitsDomain, _splitsGroup),
 _token,
 _amount,
 _decimals,
 _defaultBeneficiary
 );Internal references: External references: 
- 
Emit a DistributeToSplitGroupevent with the relevant parameters.emit DistributeToSplitGroup(_splitsProjectId, _splitsDomain, _splitsGroup, msg.sender);Event references: 
/**
  @notice
  Split an amount between all splits.
  @param _splitsProjectId The ID of the project to which the splits belong.
  @param _splitsDomain The splits domain to which the group belongs.
  @param _splitsGroup The splits group to pay.
  @param _token The token the amonut being split is in.
  @param _amount The amount of tokens being split, as a fixed point number. If the `_token` is ETH, this is ignored and msg.value is used in its place.
  @param _decimals The number of decimals in the `_amount` fixed point number.
  @param _defaultBeneficiary The address that will benefit from any non-specified beneficiaries in splits.
  @return leftoverAmount The amount leftover after all splits were paid.
*/
function _payToSplits(
  uint256 _splitsProjectId,
  uint256 _splitsDomain,
  uint256 _splitsGroup,
  address _token,
  uint256 _amount,
  uint256 _decimals,
  address _defaultBeneficiary
) internal virtual returns (uint256 leftoverAmount) {
  // Pay the splits.
  leftoverAmount = _payTo(
    splitsStore.splitsOf(_splitsProjectId, _splitsDomain, _splitsGroup),
    _token,
    _amount,
    _decimals,
    _defaultBeneficiary
  );
  emit DistributeToSplitGroup(_splitsProjectId, _splitsDomain, _splitsGroup, msg.sender);
}
| Name | Data | 
|---|---|
| DistributeToSplitGroup | 
 | 
| Category | Description | Reward | 
|---|---|---|
| Optimization | Help make this operation more efficient. | 0.5ETH | 
| Low severity | Identify a vulnerability in this operation that could lead to an inconvenience for a user of the protocol or for a protocol developer. | 1ETH | 
| High severity | Identify a vulnerability in this operation that could lead to data corruption or loss of funds. | 5+ETH |