/
IJBFundingCycleDataSource.sol
42 lines (39 loc) · 1.98 KB
/
IJBFundingCycleDataSource.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IERC165} from '@openzeppelin/contracts/utils/introspection/IERC165.sol';
import {JBPayDelegateAllocation} from './../structs/JBPayDelegateAllocation.sol';
import {JBPayParamsData} from './../structs/JBPayParamsData.sol';
import {JBRedeemParamsData} from './../structs/JBRedeemParamsData.sol';
import {JBRedemptionDelegateAllocation} from './../structs/JBRedemptionDelegateAllocation.sol';
/// @title Datasource
/// @notice The datasource is called by JBPayoutRedemptionPaymentTerminals on pay and redemption, and provide an extra layer of logic to use a custom weight, a custom memo and/or a pay/redeem delegate
interface IJBFundingCycleDataSource is IERC165 {
/// @notice The datasource implementation for JBPaymentTerminal.pay(..)
/// @param data the data passed to the data source in terminal.pay(..), as a JBPayParamsData struct:
/// @return weight the weight to use to override the funding cycle weight
/// @return memo the memo to override the pay(..) memo
/// @return delegateAllocations The amount to send to delegates instead of adding to the local balance.
function payParams(
JBPayParamsData calldata data
)
external
returns (
uint256 weight,
string memory memo,
JBPayDelegateAllocation[] memory delegateAllocations
);
/// @notice The datasource implementation for JBPaymentTerminal.redeemTokensOf(..)
/// @param data the data passed to the data source in terminal.redeemTokensOf(..), as a JBRedeemParamsData struct:
/// @return reclaimAmount The amount to claim, overriding the terminal logic.
/// @return memo The memo to override the redeemTokensOf(..) memo.
/// @return delegateAllocations The amount to send to delegates instead of adding to the beneficiary.
function redeemParams(
JBRedeemParamsData calldata data
)
external
returns (
uint256 reclaimAmount,
string memory memo,
JBRedemptionDelegateAllocation[] memory delegateAllocations
);
}