Skip to main content

JBSurplus

Git Source

Surplus calculations.

Functions​

currentSurplusOf​

Gets the total current surplus amount across all of a project's terminals.

This amount changes as the value of the balances changes in relation to the currency being used to measure the project's payout limits.

function currentSurplusOf(
uint256 projectId,
IJBTerminal[] memory terminals,
JBAccountingContext[] memory accountingContexts,
uint256 decimals,
uint256 currency
)
internal
view
returns (uint256 surplus);

Parameters

NameTypeDescription
projectIduint256The ID of the project to get the total surplus for.
terminalsIJBTerminal[]The terminals to look for surplus within.
accountingContextsJBAccountingContext[]The accounting contexts to use to calculate the surplus.
decimalsuint256The number of decimals that the fixed point surplus result should include.
currencyuint256The currency that the surplus result should be in terms of.

Returns

NameTypeDescription
surplusuint256The total surplus of a project's funds in terms of currency, as a fixed point number with the specified number of decimals.