跳到主要内容

currentReclaimableOverflowOf

Contract: JBSingleTokenPaymentTerminalStore​‌

Interface: IJBSingleTokenPaymentTerminalStore

The current amount of overflowed tokens from a terminal that can be reclaimed by the specified number of tokens, using the specified total token supply and overflow amounts.

If the project has an active funding cycle reconfiguration ballot, the project's ballot redemption rate is used.

Definition

function currentReclaimableOverflowOf(
uint256 _projectId,
uint256 _tokenCount,
uint256 _totalSupply,
uint256 _overflow
) external view override returns (uint256) { ... }
  • Arguments:
    • _projectId is the ID of the project to get the reclaimable overflow amount for.
    • _tokenCount is the number of tokens to make the calculation with, as a fixed point number with 18 decimals.
    • _totalSupply is the total number of tokens to make the calculation with, as a fixed point number with 18 decimals.
    • _overflow is the amount of overflow to make the calculation with, as a fixed point number.
  • The view function can be accessed externally by anyone.
  • The view function does not alter state on the blockchain.
  • The resulting function overrides a function definition from the JBSingleTokenPaymentTerminalStore interface.
  • The function returns the amount of overflowed tokens that can be reclaimed, as a fixed point number with the same number of decimals as the provided _overflow.

Body

  1. If there's no overflow, there's nothing reclaimable.

    // If there's no overflow, there's no reclaimable overflow.
    if (_overflow == 0) return 0;
  2. Make sure the provided token count is within the bounds of the total supply.

    // Can't redeem more tokens that is in the supply.
    if (_tokenCount > _totalSupply) return 0;
  3. Get a reference to the project's current funding cycle.

    // Get a reference to the project's current funding cycle.
    JBFundingCycle memory _fundingCycle = fundingCycleStore.currentOf(_projectId);

    External references:

  4. Return the reclaimable overflow using the project's current funding cycle and the provided parameters.

    // If there is no overflow, nothing is reclaimable.
    return
    _reclaimableOverflowDuring(_projectId, _fundingCycle, _tokenCount, _totalSupply, _overflow);

    Internal references: