Skip to main content

JBERC20PaymentTerminal3_1_1

Manages the inflows and outflows of an ERC-20 token.

Git Source

Inherits: JBPayoutRedemptionPaymentTerminal3_1_1

Functions

_balance

Checks the balance of tokens in this contract.

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

Returns

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

constructor

constructor(
IERC20Metadata _token,
uint256 _currency,
uint256 _baseWeightCurrency,
uint256 _payoutSplitsGroup,
IJBOperatorStore _operatorStore,
IJBProjects _projects,
IJBDirectory _directory,
IJBSplitsStore _splitsStore,
IJBPrices _prices,
address _store,
address _owner
)
JBPayoutRedemptionPaymentTerminal3_1_1(
address(_token),
_token.decimals(),
_currency,
_baseWeightCurrency,
_payoutSplitsGroup,
_operatorStore,
_projects,
_directory,
_splitsStore,
_prices,
_store,
_owner
);

Parameters

NameTypeDescription
_tokenIERC20MetadataThe token that this terminal manages.
_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.
_storeaddressA contract that stores the terminal's data.
_owneraddressThe address that will own this contract.

_transferFrom

Transfers tokens.

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

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 override;

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 override;

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.