Skip to main content

JBPayoutRedemptionPaymentTerminal3_1

Generic terminal managing all inflows and outflows of funds into the protocol ecosystem.

Git Source

Inherits: JBSingleTokenPaymentTerminal, JBOperatable, Ownable, IJBPayoutRedemptionPaymentTerminal3_1

A project can transfer its funds, along with the power to reconfigure and mint/burn their tokens, from this contract to another allowed terminal of the same token type contract at any time.

Adheres to:

Inherits from:

  • JBSingleTokenPaymentTerminal: Generic terminal managing all inflows of funds into the protocol ecosystem for one token.
  • JBOperatable: Includes convenience functionality for checking a message sender's permissions before executing certain transactions.
  • Ownable: Includes convenience functionality for checking a message sender's permissions before executing certain transactions.*

State Variables

_FEE_CAP

Maximum fee that can be set for a funding cycle configuration.

Out of MAX_FEE (50_000_000 / 1_000_000_000).

uint256 internal constant _FEE_CAP = 50_000_000;

_FEE_BENEFICIARY_PROJECT_ID

The fee beneficiary project ID is 1, as it should be the first project launched during the deployment process.

uint256 internal constant _FEE_BENEFICIARY_PROJECT_ID = 1;

_heldFeesOf

Fees that are being held to be processed later.

  • _projectId The ID of the project for which fees are being held.
mapping(uint256 => JBFee[]) internal _heldFeesOf;

projects

Mints ERC-721's that represent project ownership and transfers.

IJBProjects public immutable override projects;

directory

The directory of terminals and controllers for projects.

IJBDirectory public immutable override directory;

splitsStore

The contract that stores splits for each project.

IJBSplitsStore public immutable override splitsStore;

prices

The contract that exposes price feeds.

IJBPrices public immutable override prices;

store

The contract that stores and manages the terminal's data.

IJBSingleTokenPaymentTerminalStore public immutable override store;

baseWeightCurrency

The currency to base token issuance on.

If this differs from currency, there must be a price feed available to convert currency to baseWeightCurrency.

uint256 public immutable override baseWeightCurrency;

payoutSplitsGroup

The group that payout splits coming from this terminal are identified by.

uint256 public immutable override payoutSplitsGroup;

fee

The platform fee percent.

Out of MAX_FEE (25_000_000 / 1_000_000_000)

uint256 public override fee = 25_000_000;

feeGauge

The data source that returns a discount to apply to a project's fee.

IJBFeeGauge public override feeGauge;

isFeelessAddress

Addresses that can be paid towards from this terminal without incurring a fee.

Only addresses that are considered to be contained within the ecosystem can be feeless. Funds sent outside the ecosystem may incur fees despite being stored as feeless.

  • _address The address that can be paid toward.
mapping(address => bool) public override isFeelessAddress;

Functions

isTerminalOf

A modifier that verifies this terminal is a terminal of provided project ID.

modifier isTerminalOf(uint256 _projectId);

currentEthOverflowOf

Gets the current overflowed amount in this terminal for a specified project, in terms of ETH.

The current overflow is represented as a fixed point number with 18 decimals.

function currentEthOverflowOf(uint256 _projectId) external view virtual override returns (uint256);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to get overflow for.

Returns

NameTypeDescription
<none>uint256The current amount of ETH overflow that project has in this terminal, as a fixed point number with 18 decimals.

heldFeesOf

The fees that are currently being held to be processed later for each project.

function heldFeesOf(uint256 _projectId) external view override returns (JBFee[] memory);

Parameters

NameTypeDescription
_projectIduint256The ID of the project for which fees are being held.

Returns

NameTypeDescription
<none>JBFee[]An array of fees that are being held.

supportsInterface

Indicates if this contract adheres to the specified interface.

See IERC165-supportsInterface.

function supportsInterface(bytes4 _interfaceId)
public
view
virtual
override(JBSingleTokenPaymentTerminal, IERC165)
returns (bool);

Parameters

NameTypeDescription
_interfaceIdbytes4The ID of the interface to check for adherance to.

_balance

Checks the balance of tokens in this contract.

function _balance() internal view virtual returns (uint256);

Returns

NameTypeDescription
<none>uint256The contract's balance.

constructor

constructor(
address _token,
uint256 _decimals,
uint256 _currency,
uint256 _baseWeightCurrency,
uint256 _payoutSplitsGroup,
IJBOperatorStore _operatorStore,
IJBProjects _projects,
IJBDirectory _directory,
IJBSplitsStore _splitsStore,
IJBPrices _prices,
IJBSingleTokenPaymentTerminalStore _store,
address _owner
) payable JBSingleTokenPaymentTerminal(_token, _decimals, _currency) JBOperatable(_operatorStore);

Parameters

NameTypeDescription
_tokenaddressThe token that this terminal manages.
_decimalsuint256The number of decimals the token fixed point amounts are expected to have.
_currencyuint256The currency that this terminal's token adheres to for price feeds.
_baseWeightCurrencyuint256The currency to base token issuance on.
_payoutSplitsGroupuint256The group that denotes payout splits from this terminal in the splits store.
_operatorStoreIJBOperatorStoreA contract storing operator assignments.
_projectsIJBProjectsA contract which mints ERC-721's that represent project ownership and transfers.
_directoryIJBDirectoryA contract storing directories of terminals and controllers for each project.
_splitsStoreIJBSplitsStoreA contract that stores splits for each project.
_pricesIJBPricesA contract that exposes price feeds.
_storeIJBSingleTokenPaymentTerminalStoreA contract that stores the terminal's data.
_owneraddressThe address that will own this contract.

pay

Contribute tokens to a project.

function pay(
uint256 _projectId,
uint256 _amount,
address _token,
address _beneficiary,
uint256 _minReturnedTokens,
bool _preferClaimedTokens,
string calldata _memo,
bytes calldata _metadata
) external payable virtual override isTerminalOf(_projectId) returns (uint256);

Parameters

NameTypeDescription
_projectIduint256The ID of the project being paid.
_amountuint256The amount of terminal tokens being received, as a fixed point number with the same amount of decimals as this terminal. If this terminal's token is ETH, this is ignored and msg.value is used in its place.
_tokenaddressThe token being paid. This terminal ignores this property since it only manages one token.
_beneficiaryaddressThe address to mint tokens for and pass along to the funding cycle's data source and delegate.
_minReturnedTokensuint256The minimum number of project tokens expected in return, as a fixed point number with the same amount of decimals as this terminal.
_preferClaimedTokensboolA flag indicating whether the request prefers to mint project tokens into the beneficiaries wallet rather than leaving them unclaimed. This is only possible if the project has an attached token contract. Leaving them unclaimed saves gas.
_memostringA memo to pass along to the emitted event, and passed along the the funding cycle's data source and delegate. A data source can alter the memo before emitting in the event and forwarding to the delegate.
_metadatabytesBytes to send along to the data source, delegate, and emitted event, if provided.

Returns

NameTypeDescription
<none>uint256The number of tokens minted for the beneficiary, as a fixed point number with 18 decimals.

redeemTokensOf

Holders can redeem their tokens to claim the project's overflowed tokens, or to trigger rules determined by the project's current funding cycle's data source.

Only a token holder or a designated operator can redeem its tokens.

function redeemTokensOf(
address _holder,
uint256 _projectId,
uint256 _tokenCount,
address _token,
uint256 _minReturnedTokens,
address payable _beneficiary,
string memory _memo,
bytes memory _metadata
)
external
virtual
override
requirePermission(_holder, _projectId, JBOperations.REDEEM)
returns (uint256 reclaimAmount);

Parameters

NameTypeDescription
_holderaddressThe account to redeem tokens for.
_projectIduint256The ID of the project to which the tokens being redeemed belong.
_tokenCountuint256The number of project tokens to redeem, as a fixed point number with 18 decimals.
_tokenaddressThe token being reclaimed. This terminal ignores this property since it only manages one token.
_minReturnedTokensuint256The minimum amount of terminal tokens expected in return, as a fixed point number with the same amount of decimals as the terminal.
_beneficiaryaddress payableThe address to send the terminal tokens to.
_memostringA memo to pass along to the emitted event.
_metadatabytesBytes to send along to the data source, delegate, and emitted event, if provided.

Returns

NameTypeDescription
reclaimAmountuint256The amount of terminal tokens that the project tokens were redeemed for, as a fixed point number with 18 decimals.

distributePayoutsOf

Distributes payouts for a project with the distribution limit of its current funding cycle.

Payouts are sent to the preprogrammed splits. Any leftover is sent to the project's owner.

Anyone can distribute payouts on a project's behalf. The project can preconfigure a wildcard split that is used to send funds to msg.sender. This can be used to incentivize calling this function.

All funds distributed outside of this contract or any feeless terminals incure the protocol fee.

function distributePayoutsOf(
uint256 _projectId,
uint256 _amount,
uint256 _currency,
address _token,
uint256 _minReturnedTokens,
bytes calldata _metadata
) external virtual override returns (uint256 netLeftoverDistributionAmount);

Parameters

NameTypeDescription
_projectIduint256The ID of the project having its payouts distributed.
_amountuint256The amount of terminal tokens to distribute, as a fixed point number with same number of decimals as this terminal.
_currencyuint256The expected currency of the amount being distributed. Must match the project's current funding cycle's distribution limit currency.
_tokenaddressThe token being distributed. This terminal ignores this property since it only manages one token.
_minReturnedTokensuint256The minimum number of terminal tokens that the _amount should be valued at in terms of this terminal's currency, as a fixed point number with the same number of decimals as this terminal.
_metadatabytesBytes to send along to the emitted event, if provided.

Returns

NameTypeDescription
netLeftoverDistributionAmountuint256The amount that was sent to the project owner, as a fixed point number with the same amount of decimals as this terminal.

useAllowanceOf

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.

function useAllowanceOf(
uint256 _projectId,
uint256 _amount,
uint256 _currency,
address _token,
uint256 _minReturnedTokens,
address payable _beneficiary,
string memory _memo,
bytes calldata _metadata
)
external
virtual
override
requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.USE_ALLOWANCE)
returns (uint256 netDistributedAmount);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to use the allowance of.
_amountuint256The 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.
_currencyuint256The expected currency of the amount being distributed. Must match the project's current funding cycle's overflow allowance currency.
_tokenaddressThe token being distributed. This terminal ignores this property since it only manages one token.
_minReturnedTokensuint256The minimum number of tokens that the _amount should be valued at in terms of this terminal's currency, as a fixed point number with 18 decimals.
_beneficiaryaddress payableThe address to send the funds to.
_memostringA memo to pass along to the emitted event.
_metadatabytesBytes to send along to the emitted event, if provided.

Returns

NameTypeDescription
netDistributedAmountuint256The amount of tokens that was distributed to the beneficiary, as a fixed point number with the same amount of decimals as the terminal.

migrate

Allows a project owner to migrate its funds and operations to a new terminal that accepts the same token type.

Only a project's owner or a designated operator can migrate it.

function migrate(uint256 _projectId, IJBPaymentTerminal _to)
external
virtual
override
requirePermission(projects.ownerOf(_projectId), _projectId, JBOperations.MIGRATE_TERMINAL)
returns (uint256 balance);

Parameters

NameTypeDescription
_projectIduint256The ID of the project being migrated.
_toIJBPaymentTerminalThe terminal contract that will gain the project's funds.

Returns

NameTypeDescription
balanceuint256The amount of funds that were migrated, as a fixed point number with the same amount of decimals as this terminal.

addToBalanceOf

Receives funds belonging to the specified project.

function addToBalanceOf(
uint256 _projectId,
uint256 _amount,
address _token,
string calldata _memo,
bytes calldata _metadata
) external payable virtual override isTerminalOf(_projectId);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to which the funds received belong.
_amountuint256The amount of tokens to add, as a fixed point number with the same number of decimals as this terminal. If this is an ETH terminal, this is ignored and msg.value is used instead.
_tokenaddressThe token being paid. This terminal ignores this property since it only manages one currency.
_memostringA memo to pass along to the emitted event.
_metadatabytesExtra data to pass along to the emitted event.

processFees

Process any fees that are being held for the project.

Only a project owner, an operator, or the contract's owner can process held fees.

function processFees(uint256 _projectId)
external
virtual
override
requirePermissionAllowingOverride(
projects.ownerOf(_projectId),
_projectId,
JBOperations.PROCESS_FEES,
msg.sender == owner()
);

Parameters

NameTypeDescription
_projectIduint256The ID of the project whos held fees should be processed.

setFee

Allows the fee to be updated.

Only the owner of this contract can change the fee.

function setFee(uint256 _fee) external virtual override onlyOwner;

Parameters

NameTypeDescription
_feeuint256The new fee, out of MAX_FEE.

setFeeGauge

Allows the fee gauge to be updated.

Only the owner of this contract can change the fee gauge.

function setFeeGauge(IJBFeeGauge _feeGauge) external virtual override onlyOwner;

Parameters

NameTypeDescription
_feeGaugeIJBFeeGaugeThe new fee gauge.

setFeelessAddress

Sets whether projects operating on this terminal can pay towards the specified address without incurring a fee.

Only the owner of this contract can set addresses as feeless.

function setFeelessAddress(address _address, bool _flag) external virtual override onlyOwner;

Parameters

NameTypeDescription
_addressaddressThe address that can be paid towards while still bypassing fees.
_flagboolA flag indicating whether the terminal should be feeless or not.

addToBalanceOf

Receives funds belonging to the specified project.

function addToBalanceOf(
uint256 _projectId,
uint256 _amount,
address _token,
bool _shouldRefundHeldFees,
string calldata _memo,
bytes calldata _metadata
) public payable virtual override isTerminalOf(_projectId);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to which the funds received belong.
_amountuint256The amount of tokens to add, as a fixed point number with the same number of decimals as this terminal. If this is an ETH terminal, this is ignored and msg.value is used instead.
_tokenaddressThe token being paid. This terminal ignores this property since it only manages one currency.
_shouldRefundHeldFeesboolA flag indicating if held fees should be refunded based on the amount being added.
_memostringA memo to pass along to the emitted event.
_metadatabytesExtra data to pass along to the emitted event.

_transferFrom

Transfers tokens.

function _transferFrom(address _from, address payable _to, uint256 _amount) internal virtual;

Parameters

NameTypeDescription
_fromaddressThe address from which the transfer should originate.
_toaddress payableThe address to which the transfer should go.
_amountuint256The amount of the transfer, as a fixed point number with the same number of decimals as this terminal.

_beforeTransferTo

Logic to be triggered before transferring tokens from this terminal.

function _beforeTransferTo(address _to, uint256 _amount) internal virtual;

Parameters

NameTypeDescription
_toaddressThe address to which the transfer is going.
_amountuint256The amount of the transfer, as a fixed point number with the same number of decimals as this terminal.

_cancelTransferTo

Logic to be triggered if a transfer should be undone

function _cancelTransferTo(address _to, uint256 _amount) internal virtual;

Parameters

NameTypeDescription
_toaddressThe address to which the transfer went.
_amountuint256The amount of the transfer, as a fixed point number with the same number of decimals as this terminal.

_redeemTokensOf

Holders can redeem their tokens to claim the project's overflowed tokens, or to trigger rules determined by the project's current funding cycle's data source.

Only a token holder or a designated operator can redeem its tokens.

function _redeemTokensOf(
address _holder,
uint256 _projectId,
uint256 _tokenCount,
uint256 _minReturnedTokens,
address payable _beneficiary,
string memory _memo,
bytes memory _metadata
) internal returns (uint256 reclaimAmount);

Parameters

NameTypeDescription
_holderaddressThe account to redeem tokens for.
_projectIduint256The ID of the project to which the tokens being redeemed belong.
_tokenCountuint256The number of project tokens to redeem, as a fixed point number with 18 decimals.
_minReturnedTokensuint256The minimum amount of terminal tokens expected in return, as a fixed point number with the same amount of decimals as the terminal.
_beneficiaryaddress payableThe address to send the terminal tokens to.
_memostringA memo to pass along to the emitted event.
_metadatabytesBytes to send along to the data source, delegate, and emitted event, if provided.

Returns

NameTypeDescription
reclaimAmountuint256The amount of terminal tokens that the project tokens were redeemed for, as a fixed point number with 18 decimals.

_distributePayoutsOf

Distributes payouts for a project with the distribution limit of its current funding cycle.

Payouts are sent to the preprogrammed splits. Any leftover is sent to the project's owner.

Anyone can distribute payouts on a project's behalf. The project can preconfigure a wildcard split that is used to send funds to msg.sender. This can be used to incentivize calling this function.

All funds distributed outside of this contract or any feeless terminals incure the protocol fee.

function _distributePayoutsOf(
uint256 _projectId,
uint256 _amount,
uint256 _currency,
uint256 _minReturnedTokens,
bytes calldata _metadata
) internal returns (uint256 netLeftoverDistributionAmount);

Parameters

NameTypeDescription
_projectIduint256The ID of the project having its payouts distributed.
_amountuint256The amount of terminal tokens to distribute, as a fixed point number with same number of decimals as this terminal.
_currencyuint256The expected currency of the amount being distributed. Must match the project's current funding cycle's distribution limit currency.
_minReturnedTokensuint256The minimum number of terminal tokens that the _amount should be valued at in terms of this terminal's currency, as a fixed point number with the same number of decimals as this terminal.
_metadatabytesBytes to send along to the emitted event, if provided.

Returns

NameTypeDescription
netLeftoverDistributionAmountuint256The amount that was sent to the project owner, as a fixed point number with the same amount of decimals as this terminal.

_useAllowanceOf

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.

function _useAllowanceOf(
uint256 _projectId,
uint256 _amount,
uint256 _currency,
uint256 _minReturnedTokens,
address payable _beneficiary,
string memory _memo,
bytes calldata _metadata
) internal returns (uint256 netDistributedAmount);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to use the allowance of.
_amountuint256The 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.
_currencyuint256The expected currency of the amount being distributed. Must match the project's current funding cycle's overflow allowance currency.
_minReturnedTokensuint256The minimum number of tokens that the _amount should be valued at in terms of this terminal's currency, as a fixed point number with 18 decimals.
_beneficiaryaddress payableThe address to send the funds to.
_memostringA memo to pass along to the emitted event.
_metadatabytesBytes to send along to the emitted event, if provided.

Returns

NameTypeDescription
netDistributedAmountuint256The amount of tokens that was distributed to the beneficiary, as a fixed point number with the same amount of decimals as the terminal.

_distributeToPayoutSplitsOf

Pays out splits for a project's funding cycle configuration.

function _distributeToPayoutSplitsOf(
uint256 _projectId,
uint256 _domain,
uint256 _group,
uint256 _amount,
uint256 _feeDiscount
) internal returns (uint256 leftoverAmount, uint256 feeEligibleDistributionAmount);

Parameters

NameTypeDescription
_projectIduint256The ID of the project for which payout splits are being distributed.
_domainuint256The domain of the splits to distribute the payout between.
_groupuint256The group of the splits to distribute the payout between.
_amountuint256The total amount being distributed, as a fixed point number with the same number of decimals as this terminal.
_feeDiscountuint256The amount of discount to apply to the fee, out of the MAX_FEE.

Returns

NameTypeDescription
leftoverAmountuint256If the leftover amount if the splits don't add up to 100%.
feeEligibleDistributionAmountuint256The total amount of distributions that are eligible to have fees taken from.

_distributeToPayoutSplit

Pays out a split for a project's funding cycle configuration.

function _distributeToPayoutSplit(
JBSplit memory _split,
uint256 _projectId,
uint256 _group,
uint256 _amount,
uint256 _feeDiscount
) internal returns (uint256 netPayoutAmount);

Parameters

NameTypeDescription
_splitJBSplitThe split to distribute payouts to.
_projectIduint256
_groupuint256
_amountuint256The total amount being distributed to the split, as a fixed point number with the same number of decimals as this terminal.
_feeDiscountuint256The amount of discount to apply to the fee, out of the MAX_FEE.

Returns

NameTypeDescription
netPayoutAmountuint256The amount sent to the split after subtracting fees.

_takeFeeFrom

Takes a fee into the platform's project, which has an id of _FEE_BENEFICIARY_PROJECT_ID.

function _takeFeeFrom(
uint256 _projectId,
JBFundingCycle memory _fundingCycle,
uint256 _amount,
address _beneficiary,
uint256 _feeDiscount
) internal returns (uint256 feeAmount);

Parameters

NameTypeDescription
_projectIduint256The ID of the project having fees taken from.
_fundingCycleJBFundingCycleThe funding cycle during which the fee is being taken.
_amountuint256The amount of the fee to take, as a floating point number with 18 decimals.
_beneficiaryaddressThe address to mint the platforms tokens for.
_feeDiscountuint256The amount of discount to apply to the fee, out of the MAX_FEE.

Returns

NameTypeDescription
feeAmountuint256The amount of the fee taken.

_processFee

Process a fee of the specified amount.

function _processFee(uint256 _amount, address _beneficiary, uint256 _from) internal;

Parameters

NameTypeDescription
_amountuint256The fee amount, as a floating point number with 18 decimals.
_beneficiaryaddressThe address to mint the platform's tokens for.
_fromuint256The project ID the fee is being paid from.

_pay

Contribute tokens to a project.

function _pay(
uint256 _amount,
address _payer,
uint256 _projectId,
address _beneficiary,
uint256 _minReturnedTokens,
bool _preferClaimedTokens,
string memory _memo,
bytes memory _metadata
) internal returns (uint256 beneficiaryTokenCount);

Parameters

NameTypeDescription
_amountuint256The amount of terminal tokens being received, as a fixed point number with the same amount of decimals as this terminal. If this terminal's token is ETH, this is ignored and msg.value is used in its place.
_payeraddressThe address making the payment.
_projectIduint256The ID of the project being paid.
_beneficiaryaddressThe address to mint tokens for and pass along to the funding cycle's data source and delegate.
_minReturnedTokensuint256The minimum number of project tokens expected in return, as a fixed point number with the same amount of decimals as this terminal.
_preferClaimedTokensboolA flag indicating whether the request prefers to mint project tokens into the beneficiaries wallet rather than leaving them unclaimed. This is only possible if the project has an attached token contract. Leaving them unclaimed saves gas.
_memostringA memo to pass along to the emitted event, and passed along the the funding cycle's data source and delegate. A data source can alter the memo before emitting in the event and forwarding to the delegate.
_metadatabytesBytes to send along to the data source, delegate, and emitted event, if provided.

Returns

NameTypeDescription
beneficiaryTokenCountuint256The number of tokens minted for the beneficiary, as a fixed point number with 18 decimals.

_addToBalanceOf

Receives funds belonging to the specified project.

function _addToBalanceOf(
uint256 _projectId,
uint256 _amount,
bool _shouldRefundHeldFees,
string memory _memo,
bytes memory _metadata
) internal;

Parameters

NameTypeDescription
_projectIduint256The ID of the project to which the funds received belong.
_amountuint256The amount of tokens to add, as a fixed point number with the same number of decimals as this terminal. If this is an ETH terminal, this is ignored and msg.value is used instead.
_shouldRefundHeldFeesboolA flag indicating if held fees should be refunded based on the amount being added.
_memostringA memo to pass along to the emitted event.
_metadatabytesExtra data to pass along to the emitted event.

_refundHeldFees

Refund fees based on the specified amount.

function _refundHeldFees(uint256 _projectId, uint256 _amount) internal returns (uint256 refundedFees);

Parameters

NameTypeDescription
_projectIduint256The project for which fees are being refunded.
_amountuint256The amount to base the refund on, as a fixed point number with the same amount of decimals as this terminal.

Returns

NameTypeDescription
refundedFeesuint256How much fees were refunded, as a fixed point number with the same number of decimals as this terminal

_feeAmount

Returns the fee amount based on the provided amount for the specified project.

function _feeAmount(uint256 _amount, uint256 _fee, uint256 _feeDiscount) internal pure returns (uint256);

Parameters

NameTypeDescription
_amountuint256The amount that the fee is based on, as a fixed point number with the same amount of decimals as this terminal.
_feeuint256The percentage of the fee, out of MAX_FEE.
_feeDiscountuint256The percentage discount that should be applied out of the max amount, out of MAX_FEE_DISCOUNT.

Returns

NameTypeDescription
<none>uint256The amount of the fee, as a fixed point number with the same amount of decimals as this terminal.

_currentFeeDiscount

Get the fee discount from the fee gauge for the specified project.

function _currentFeeDiscount(uint256 _projectId) internal view returns (uint256);

Parameters

NameTypeDescription
_projectIduint256The ID of the project to get a fee discount for.

Returns

NameTypeDescription
<none>uint256feeDiscount The fee discount, which should be interpreted as a percentage out MAX_FEE_DISCOUNT.

Errors

FEE_TOO_HIGH

error FEE_TOO_HIGH();

INADEQUATE_DISTRIBUTION_AMOUNT

error INADEQUATE_DISTRIBUTION_AMOUNT();

INADEQUATE_RECLAIM_AMOUNT

error INADEQUATE_RECLAIM_AMOUNT();

INADEQUATE_TOKEN_COUNT

error INADEQUATE_TOKEN_COUNT();

NO_MSG_VALUE_ALLOWED

error NO_MSG_VALUE_ALLOWED();

PAY_TO_ZERO_ADDRESS

error PAY_TO_ZERO_ADDRESS();

PROJECT_TERMINAL_MISMATCH

error PROJECT_TERMINAL_MISMATCH();

REDEEM_TO_ZERO_ADDRESS

error REDEEM_TO_ZERO_ADDRESS();

TERMINAL_IN_SPLIT_ZERO_ADDRESS

error TERMINAL_IN_SPLIT_ZERO_ADDRESS();

TERMINAL_TOKENS_INCOMPATIBLE

error TERMINAL_TOKENS_INCOMPATIBLE();