Skip to main content

useAllowanceOf

Contract: JBPayoutRedemptionPaymentTerminal​‌

Interface: IJBPayoutRedemptionPaymentTerminal

Allows a project to send funds from its overflow up to the preconfigured allowance.

Only a project's owner or a designated operator can use its allowance.

Incurs the protocol fee.

Definition

function useAllowanceOf(
uint256 _projectId,
uint256 _amount,
uint256 _currency,
address _token,
uint256 _minReturnedTokens,
address payable _beneficiary,
string memory _memo
)
external
virtual
override
requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.USE_ALLOWANCE)
returns (uint256 netDistributedAmount) { ... }
  • Arguments:
    • _projectId is the ID of the project to use the allowance of.
    • _amount is the amount of terminal tokens to use from this project's current allowance, as a fixed point number with the same amount of decimals as this terminal.
    • _currency is the expected currency of the amount being distributed. Must match the project's current funding cycle's overflow allowance currency.
    • _token is the token being distributed. This terminal ignores this property since it only manages one token.
    • _minReturnedTokens is the minimum number of tokens that the _amount should be valued at in terms of this terminal's currency, as a fixed point number with the same amount of decimals as this terminal.
    • _beneficiary is the address to send the funds to.
  • Through the requirePermission modifier, the function is only accessible by the project's owner, or from an operator that has been given the JBOperations.USE_ALLOWANCE permission by the project owner for the provided _projectId.
  • The function can be overriden by inheriting contracts.
  • The resulting function overrides a function definition from the IJBPayoutRedemptionPaymentTerminal interface.
  • The function returns the amount of tokens that was distributed to the beneficiary, as a fixed point number with the same amount of decimals as the terminal.

Body

  1. Forward to the internal function.

    return _useAllowanceOf(_projectId, _amount, _currency, _minReturnedTokens, _beneficiary, _memo);

    Internal references: