Cargando el resto de esta comparación.

JBPayoutRedemptionPaymentTerminal diff

Creado El diff nunca expira
30 eliminaciones
669 líneas
53 adiciones
676 líneas
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
pragma solidity ^0.8.16;


import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165Checker.sol';
import '@paulrberg/contracts/math/PRBMath.sol';
import '@paulrberg/contracts/math/PRBMath.sol';
import './../interfaces/IJBController.sol';
import './../interfaces/IJBController.sol';
import './../interfaces/IJBPayoutRedemptionPaymentTerminal.sol';
import './../interfaces/IJBPayoutRedemptionPaymentTerminal3_1.sol';
import './../libraries/JBConstants.sol';
import './../libraries/JBConstants.sol';
import './../libraries/JBCurrencies.sol';
import './../libraries/JBCurrencies.sol';
import './../libraries/JBFixedPointNumber.sol';
import './../libraries/JBFixedPointNumber.sol';
import './../libraries/JBFundingCycleMetadataResolver.sol';
import './../libraries/JBFundingCycleMetadataResolver.sol';
import './../libraries/JBOperations.sol';
import './../libraries/JBOperations.sol';
import './../libraries/JBTokens.sol';
import './../libraries/JBTokens.sol';
import './../structs/JBPayDelegateAllocation.sol';
import './../structs/JBPayDelegateAllocation.sol';
import './../structs/JBTokenAmount.sol';
import './../structs/JBTokenAmount.sol';
import './JBOperatable.sol';
import './JBOperatable.sol';
import './JBSingleTokenPaymentTerminal.sol';
import './JBSingleTokenPaymentTerminal.sol';


/**
/**
@notice
@notice
Generic terminal managing all inflows and outflows of funds into the protocol ecosystem.
Generic terminal managing all inflows and outflows of funds into the protocol ecosystem.


@dev
@dev
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.
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.


@dev
@dev
Adheres to -
Adheres to -
IJBPayoutRedemptionPaymentTerminal: General interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules.
IJBPayoutRedemptionPaymentTerminal3_1: General interface for the methods in this contract that interact with the blockchain's state according to the protocol's rules.


@dev
@dev
Inherits from -
Inherits from -
JBSingleTokenPaymentTerminal: Generic terminal managing all inflows of funds into the protocol ecosystem for one token.
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.
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.
Ownable: Includes convenience functionality for checking a message sender's permissions before executing certain transactions.
*/
*/
abstract contract JBPayoutRedemptionPaymentTerminal is
abstract contract JBPayoutRedemptionPaymentTerminal3_1 is
JBSingleTokenPaymentTerminal,
JBSingleTokenPaymentTerminal,
JBOperatable,
JBOperatable,
Ownable,
Ownable,
IJBPayoutRedemptionPaymentTerminal
IJBPayoutRedemptionPaymentTerminal3_1
{
{
// A library that parses the packed funding cycle metadata into a friendlier format.
// A library that parses the packed funding cycle metadata into a friendlier format.
using JBFundingCycleMetadataResolver for JBFundingCycle;
using JBFundingCycleMetadataResolver for JBFundingCycle;


//*********************************************************************//
//*********************************************************************//
// --------------------------- custom errors ------------------------- //
// --------------------------- custom errors ------------------------- //
//*********************************************************************//
//*********************************************************************//
error FEE_TOO_HIGH();
error FEE_TOO_HIGH();
error INADEQUATE_DISTRIBUTION_AMOUNT();
error INADEQUATE_DISTRIBUTION_AMOUNT();
error INADEQUATE_RECLAIM_AMOUNT();
error INADEQUATE_RECLAIM_AMOUNT();
error INADEQUATE_TOKEN_COUNT();
error INADEQUATE_TOKEN_COUNT();
error NO_MSG_VALUE_ALLOWED();
error NO_MSG_VALUE_ALLOWED();
error PAY_TO_ZERO_ADDRESS();
error PAY_TO_ZERO_ADDRESS();
error PROJECT_TERMINAL_MISMATCH();
error PROJECT_TERMINAL_MISMATCH();
error REDEEM_TO_ZERO_ADDRESS();
error REDEEM_TO_ZERO_ADDRESS();
error TERMINAL_IN_SPLIT_ZERO_ADDRESS();
error TERMINAL_IN_SPLIT_ZERO_ADDRESS();
error TERMINAL_TOKENS_INCOMPATIBLE();
error TERMINAL_TOKENS_INCOMPATIBLE();


//*********************************************************************//
//*********************************************************************//
// ---------------------------- modifiers ---------------------------- //
// ---------------------------- modifiers ---------------------------- //
//*********************************************************************//
//*********************************************************************//


/**
/**
@notice
@notice
A modifier that verifies this terminal is a terminal of provided project ID.
A modifier that verifies this terminal is a terminal of provided project ID.
*/
*/
modifier isTerminalOf(uint256 _projectId) {
modifier isTerminalOf(uint256 _projectId) {
if (!directory.isTerminalOf(_projectId, this)) revert PROJECT_TERMINAL_MISMATCH();
if (!directory.isTerminalOf(_projectId, this)) revert PROJECT_TERMINAL_MISMATCH();
_;
_;
}
}


//*********************************************************************//
//*********************************************************************//
// --------------------- internal stored constants ------------------- //
// --------------------- internal stored constants ------------------- //
//*********************************************************************//
//*********************************************************************//


/**
/**
@notice
@notice
Maximum fee that can be set for a funding cycle configuration.
Maximum fee that can be set for a funding cycle configuration.


@dev
@dev
Out of MAX_FEE (50_000_000 / 1_000_000_000).
Out of MAX_FEE (50_000_000 / 1_000_000_000).
*/
*/
uint256 internal constant _FEE_CAP = 50_000_000;
uint256 internal constant _FEE_CAP = 50_000_000;


/**
/**
@notice
@notice
The fee beneficiary project ID is 1, as it should be the first project launched during the deployment process.
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;
uint256 internal constant _FEE_BENEFICIARY_PROJECT_ID = 1;


//*********************************************************************//
//*********************************************************************//
// --------------------- internal stored properties ------------------ //
// --------------------- internal stored properties ------------------ //
//*********************************************************************//
//*********************************************************************//


/**
/**
@notice
@notice
Fees that are being held to be processed later.
Fees that are being held to be processed later.


_projectId The ID of the project for which fees are being held.
_projectId The ID of the project for which fees are being held.