Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 3.04 KB

File metadata and controls

77 lines (55 loc) · 3.04 KB

recordAddedBalanceFor

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

Contract: JBSingleTokenPaymentTerminalStore​‌

Interface: IJBSingleTokenPaymentTerminalStore

Records newly added funds for the project.

The msg.sender must be an IJBSingleTokenPaymentTerminal.

Definition

function recordAddedBalanceFor(uint256 _projectId, uint256 _amount) external override { ... }
  • Arguments:
    • _projectId is the ID of the project to which the funds being added belong.
    • _amount is 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 JBSingleTokenPaymentTerminalStore interface.
  • The function doesn't return anything.

Body

  1. 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