JBETHERC20ProjectPayer
Sends ETH or ERC20's to a project treasury as it receives direct payments or has it's functions called.
Inherit from this contract or borrow from its logic to forward ETH or ERC20's to project treasuries from within other contracts.
Code
https://github.com/jbx-protocol/juice-contracts-v2/blob/main/contracts/JBETHERC20ProjectPayer.sol
Addresses
There can be several instances of this contract deployed.
Interfaces
Name | Description |
---|---|
IJBProjectPayer | General interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules. |
Inheritance
Contract | Description |
---|---|
Ownable | Includes convenience functionality for specifying an address that owns the contract, with modifiers that only allow access by the owner. |
ERC165 | Introspection on interface adherance. |
Constructor
/**
@param _defaultProjectId The ID of the project whose treasury should be forwarded this contract's received payments.
@param _defaultBeneficiary The address that'll receive the project's tokens.
@param _defaultPreferClaimedTokens A flag indicating whether issued tokens should be automatically claimed into the beneficiary's wallet.
@param _defaultMemo A 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.
@param _defaultMetadata Bytes to send along to the project's data source and delegate, if provided.
@param _defaultPreferAddToBalance A flag indicating if received payments should call the `pay` function or the `addToBalance` function of a project.
@param _directory A contract storing directories of terminals and controllers for each project.
@param _owner The address that will own the contract.
*/
constructor(
uint256 _defaultProjectId,
address payable _defaultBeneficiary,
bool _defaultPreferClaimedTokens,
string memory _defaultMemo,
bytes memory _defaultMetadata,
bool _defaultPreferAddToBalance,
IJBDirectory _directory,
address _owner
) {
defaultProjectId = _defaultProjectId;
defaultBeneficiary = _defaultBeneficiary;
defaultPreferClaimedTokens = _defaultPreferClaimedTokens;
defaultMemo = _defaultMemo;
defaultMetadata = _defaultMetadata;
defaultPreferAddToBalance = _defaultPreferAddToBalance;
directory = _directory;
_transferOwnership(_owner);
}
_defaultProjectId
is the ID of the project whose treasury should be forwarded this contract's received payments._defaultBeneficiary
is the address that'll receive the project's tokens._defaultPreferClaimedTokens
is a flag indicating whether issued tokens should be automatically claimed into the beneficiary's wallet._defaultMemo
is the memo that'll be passed along to the emitted event.._defaultMetadata
are bytes to send along to the project's data source and delegate, if provided._defaultPreferAddToBalance
is a flag indicating if received payments should call thepay
function or theaddToBalance
function of a project._directory
is a contract storing directories of terminals and controllers for each project._owner
is the address that will own the contract.
Events
Name | Data |
---|---|
SetDefaultValues |
|
Properties
Name | Definition |
---|---|
directory | Returns |
defaultProjectId | Returns
|
defaultBeneficiary | Returns
|
defaultPreferClaimedTokens | Returns
|
defaultMemo | Returns
|
defaultMetadata | Returns
|
defaultPreferAddToBalance | Returns
|
Read
Function | Definition |
---|---|
supportsInterface | Params
Returns
|
Write
Function | Definition |
---|---|
receive | Traits
|
setDefaultValues | Traits
Params
|
pay | Traits
Params
|
addToBalanceOf | Traits
Params
|
_pay | Traits
Params
|
_addToBalanceOf | Traits
Params
|