Skip to main content

JBFundAccessConstraintsStore

Information pertaining to how much funds can be accessed by a project from each payment terminal.

Git Source

Mainnet: 0xA4425A1E5b7B28Cb689719B1428e3088C1F89E30

Goerli: 0xbF8b5ea02e50073348767fd9418beDEd30C835D4

Inherits: JBControllerUtility, ERC165, IJBFundAccessConstraintsStore

Adheres to:

  • IJBFundAccessConstraintsStore: General interface for the generic controller methods in this contract that interacts with funding cycles and tokens according to the protocol's rules.

Inherits from:

  • JBControllerUtility: Several functions in this contract can only be accessed by a project owner, or an address that has been preconfifigured to be an operator of the project.
  • ERC165: Introspection on interface adherance.

State Variables

_packedDistributionLimitDataOf

Data regarding the distribution limit of a project during a configuration.

bits 0-231: The amount of token that a project can distribute per funding cycle.

bits 232-255: The currency of amount that a project can distribute.

  • _projectId The ID of the project to get the packed distribution limit data of.
  • _configuration The configuration during which the packed distribution limit data applies.
  • _terminal The terminal from which distributions are being limited.
  • _token The token for which distributions are being limited.*
mapping(uint256 => mapping(uint256 => mapping(IJBPaymentTerminal => mapping(address => uint256))))
internal _packedDistributionLimitDataOf;

_packedOverflowAllowanceDataOf

Data regarding the overflow allowance of a project during a configuration.

bits 0-231: The amount of overflow that a project is allowed to tap into on-demand throughout the configuration.*

bits 232-255: The currency of the amount of overflow that a project is allowed to tap.

  • _projectId The ID of the project to get the packed overflow allowance data of.
  • _configuration The configuration during which the packed overflow allowance data applies.
  • _terminal The terminal managing the overflow.
  • _token The token for which overflow is being allowed.*
mapping(uint256 => mapping(uint256 => mapping(IJBPaymentTerminal => mapping(address => uint256))))
internal _packedOverflowAllowanceDataOf;

Functions

distributionLimitOf

The amount of token that a project can distribute per funding cycle, and the currency it's in terms of.

The number of decimals in the returned fixed point amount is the same as that of the specified terminal.

function distributionLimitOf(
uint256 _projectId,
uint256 _configuration,
IJBPaymentTerminal _terminal,
address _token
) external view override returns (uint256, uint256);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to get the distribution limit of.
_configurationuint256The configuration during which the distribution limit applies.
_terminalIJBPaymentTerminalThe terminal from which distributions are being limited.
_tokenaddressThe token for which the distribution limit applies.

Returns

NameTypeDescription
<none>uint256The distribution limit, as a fixed point number with the same number of decimals as the provided terminal.
<none>uint256The currency of the distribution limit.

overflowAllowanceOf

The amount of overflow that a project is allowed to tap into on-demand throughout a configuration, and the currency it's in terms of.

The number of decimals in the returned fixed point amount is the same as that of the specified terminal.

function overflowAllowanceOf(
uint256 _projectId,
uint256 _configuration,
IJBPaymentTerminal _terminal,
address _token
) external view override returns (uint256, uint256);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to get the overflow allowance of.
_configurationuint256The configuration of the during which the allowance applies.
_terminalIJBPaymentTerminalThe terminal managing the overflow.
_tokenaddressThe token for which the overflow allowance applies.

Returns

NameTypeDescription
<none>uint256The overflow allowance, as a fixed point number with the same number of decimals as the provided terminal.
<none>uint256The currency of the overflow allowance.

constructor

constructor(IJBDirectory _directory) JBControllerUtility(_directory);

Parameters

NameTypeDescription
_directoryIJBDirectoryA contract storing directories of terminals and controllers for each project.

setFor

Sets a project's constraints for accessing treasury funds.

Only a project's current controller can set its fund access constraints.

function setFor(
uint256 _projectId,
uint256 _configuration,
JBFundAccessConstraints[] calldata _fundAccessConstraints
) external override onlyController(_projectId);

Parameters

NameTypeDescription
_projectIduint256The ID of the project whose fund access constraints are being set.
_configurationuint256The funding cycle configuration the constraints apply within.
_fundAccessConstraintsJBFundAccessConstraints[]An array containing amounts that a project can use from its treasury for each payment terminal. Amounts are fixed point numbers using the same number of decimals as the accompanying terminal. The _distributionLimit and _overflowAllowance parameters must fit in a uint232.

Errors

INVALID_DISTRIBUTION_LIMIT

error INVALID_DISTRIBUTION_LIMIT();

INVALID_DISTRIBUTION_LIMIT_CURRENCY

error INVALID_DISTRIBUTION_LIMIT_CURRENCY();

INVALID_OVERFLOW_ALLOWANCE

error INVALID_OVERFLOW_ALLOWANCE();

INVALID_OVERFLOW_ALLOWANCE_CURRENCY

error INVALID_OVERFLOW_ALLOWANCE_CURRENCY();