recordAddedBalanceFor
Contract: JBSingleTokenPaymentTerminalStore
Interface: IJBSingleTokenPaymentTerminalStore
- Step by step
 - Code
 - Bug bounty
 
Records newly added funds for the project.
The msg.sender must be an IJBSingleTokenPaymentTerminal.
Definition
function recordAddedBalanceFor(uint256 _projectId, uint256 _amount) external override { ... }
- Arguments:
_projectIdis the ID of the project to which the funds being added belong._amountis the amount of terminal tokens added, as a fixed point number with the same amount of decimals as its relative terminal.
 - The resulting function overrides a function definition from the 
JBSingleTokenPaymentTerminalStoreinterface. - The function doesn't return anything.
 
Body
- 
Increment the project's balance by the specified amount.
// Increment the balance.
balanceOf[IJBSingleTokenPaymentTerminal(msg.sender)][_projectId] =
balanceOf[IJBSingleTokenPaymentTerminal(msg.sender)][_projectId] +
_amount;Internal references:
 
/**
  @notice
  Records newly added funds for the project.
  @dev
  The msg.sender must be an IJBSingleTokenPaymentTerminal.
  @param _projectId The ID of the project to which the funds being added belong.
  @param _amount The amount of terminal tokens added, as a fixed point number with the same amount of decimals as its relative terminal.
*/
function recordAddedBalanceFor(uint256 _projectId, uint256 _amount) external override {
  // Increment the balance.
  balanceOf[IJBSingleTokenPaymentTerminal(msg.sender)][_projectId] =
    balanceOf[IJBSingleTokenPaymentTerminal(msg.sender)][_projectId] +
    _amount;
}
| 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 |