跳到主要内容

JBPayoutRedemptionPaymentTerminal

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

Traits

abstract

Code

https://github.com/jbx-protocol/juice-contracts-v3/blob/main/contracts/abstract/JBPayoutRedemptionPaymentTerminal.sol

Interfaces

NameDescription
IJBPayoutRedemptionPaymentTerminalGeneral interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules.

Inheritance

ContractDescription
JBSingleTokenPaymentTerminalGeneric terminal managing all inflows of funds into the protocol ecosystem for one token.
JBOperatableIncludes convenience functionality for checking a message sender's permissions before executing certain transactions.
OwnableIncludes convenience functionality for checking a message sender's permissions before executing certain transactions.
ReentrancyGuardContract module that helps prevent reentrant calls to a function.

Constructor

/**
@param _token The token that this terminal manages.
@param _decimals The number of decimals the token fixed point amounts are expected to have.
@param _currency The currency that this terminal's token adheres to for price feeds.
@param _baseWeightCurrency The currency to base token issuance on.
@param _payoutSplitsGroup The group that denotes payout splits from this terminal in the splits store.
@param _operatorStore A contract storing operator assignments.
@param _projects A contract which mints ERC-721's that represent project ownership and transfers.
@param _directory A contract storing directories of terminals and controllers for each project.
@param _splitsStore A contract that stores splits for each project.
@param _prices A contract that exposes price feeds.
@param _store A contract that stores the terminal's data.
@param _owner The address that will own this contract.
*/
constructor( // payable constructor save the gas used to check msg.value==0
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) {
baseWeightCurrency = _baseWeightCurrency;
payoutSplitsGroup = _payoutSplitsGroup;
projects = _projects;
directory = _directory;
splitsStore = _splitsStore;
prices = _prices;
store = _store;

transferOwnership(_owner);
}
  • _token is the token that this terminal manages.
  • _decimals is the number of decimals the token fixed point amounts are expected to have.
  • _currency is the currency that this terminal's token adheres to for price feeds. From JBCurrencies.
  • _baseWeightCurrency is the currency to base token issuance on. From JBCurrencies.
  • _payoutSplitsGroup is the group that denotes payout splits from this terminal in the splits store. From JBSplitGroups.
  • _operatorStore is an IJBOperatorStore contract storing operator assignments.
  • _projects is an IJBProjects contract which mints ERC-721's that represent project ownership and transfers.
  • _directory is an IJBDirectory contract storing directories of terminals and controllers for each project.
  • _splitsStore is an IJBSplitsStore contract that stores splits for each project.
  • _prices is an IJBPrices contract that exposes price feeds.
  • _store is a contract that stores the terminal's data.
  • _owner is the address that will own this contract.

Events

NameData
AddToBalance
  • uint256 indexed projectId
  • uint256 amount
  • uint256 refundedFees
  • string memo
  • address caller
Migrate
DistributePayouts
  • uint256 indexed fundingCycleConfiguration
  • uint256 indexed fundingCycleNumber
  • uint256 indexed projectId
  • address beneficiary
  • uint256 amount
  • uint256 distributedAmount
  • uint256 fee
  • uint256 beneficiaryDistributionAmount
  • string memo
  • address caller
UseAllowance
  • uint256 indexed fundingCycleConfiguration
  • uint256 indexed fundingCycleNumber
  • uint256 indexed projectId
  • address beneficiary
  • uint256 amount
  • uint256 distributedAmount
  • uint256 netDistributedamount
  • string memo
  • address caller
ProcessFee
  • uint256 indexed projectId
  • uint256 indexed amount
  • bool indexed wasHeld
  • address beneficiary
  • address caller
RefundHeldFees
  • uint256 indexed projectId
  • uint256 indexed amount
  • uint256 indexed refundedFees
  • uint256 leftoverAmount
  • address caller
HoldFee
  • uint256 indexed projectId
  • uint256 indexed amount
  • uint256 indexed fee
  • uint256 feeDiscount
  • address beneficiary
  • address caller
Pay
  • uint256 indexed fundingCycleConfiguration
  • uint256 indexed fundingCycleNumber
  • uint256 indexed projectId
  • address beneficiary
  • uint256 amount
  • uint256 beneficiaryTokenCount
  • string memo
  • address payer
  • address caller
DelegateDidPay
RedeemTokens
  • uint256 indexed fundingCycleConfiguration
  • uint256 indexed fundingCycleNumber
  • uint256 indexed projectId
  • address holder
  • address beneficiary
  • uint256 tokenCount
  • uint256 reclaimedAmount
  • string memo
  • bytes metadata
  • address caller
DelegateDidRedeem
DistributeToPayoutSplit
  • uint256 indexed projectId
  • uint256 indexed domain
  • uint256 indexed group
  • JBSplit split
  • uint256 amount
  • address caller
SetFee
  • uint256 fee
  • address caller
SetFeeGauge
SetFeelessAddress
  • address indexed addrs
  • bool indexed flag
  • address caller

Modifiers

FunctionDefinition
isTerminalOf

Params

  • uint256 _projectId

Properties

FunctionDefinition
projects

Traits

  • immutable

Returns

directory

Traits

  • immutable

Returns

splitsStore

Traits

  • immutable

Returns

prices

Traits

  • immutable

Returns

store

Traits

  • immutable

Returns

baseWeightCurrency

Traits

  • immutable

Returns

  • uint256
payoutSplitsGroup

Traits

  • immutable

Returns

  • uint256
fee

Returns

  • uint256
feeGauge

Params

Returns

isFeelessAddress

returns

  • bool

Read

FunctionDefinition
currentEthOverflowOf

Params

  • uint256 _projectId

Returns

  • uint256 ethOverflow
heldFeesOf

Params

  • uint256 _projectId

Returns

supportsInterface

Params

  • uint256 _interfaceId

Returns

  • bool

Write

FunctionDefinition
pay

Traits

  • payable
  • virtual

Params

  • uint256 _projectId
  • uint256 _amount
  • address _token
  • address _beneficiary
  • uint256 _minReturnedTokens
  • bool _preferClaimedTokens
  • string _memo
  • bytes _metadata

Returns

  • uint256 beneficiaryTokenCount
distributePayoutsOf

Traits

  • virtual

Params

  • uint256 _projectId
  • uint256 _amount
  • uint256 _currency
  • address _token
  • uint256 _minReturnedTokens
  • string _memo

Returns

  • uint256 netLeftoverDistributionAmount
useAllowanceOf

Traits

Params

  • uint256 _projectId
  • uint256 _amount
  • uint256 _currency
  • address _token
  • uint256 _minReturnedTokens
  • address payable _beneficiary
  • string _memo

Returns

  • uint256 netDistributedAmount
redeemTokensOf

Traits

Params

  • address _holder
  • uint256 _projectId
  • uint256 _tokenCount
  • address _token
  • uint256 _minReturnedTokens
  • address payable _beneficiary
  • string _memo
  • bytes _metadata

Returns

  • uint256 reclaimAmount
migrate

Traits

Params

Returns

  • uint256 balance
addToBalanceOf

Traits

  • payable
  • virtual

Params

  • uint256 _projectId
  • uint256 _amount
  • address _token
  • string _memo
processFees

Traits

Params

  • uint256 _projectId
setFee

Traits

Params

  • uint256 _fee
setFeeGauge

Traits

Params

setFeelessAddress

Traits

Params

  • address _address
  • bool _flag
_transferFrom

Traits

  • internal
  • virtual

Params

  • address _from
  • address payable _to
  • uint256 _amount
_beforeTransferTo

Traits

  • internal
  • virtual

Params

  • address _to
  • uint256 _amount