/
IFeeCalculator.sol
49 lines (42 loc) · 2.01 KB
/
IFeeCalculator.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
43
44
45
46
47
48
49
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IFeeCalculator {
/// @notice An event emitted once the service fee is modified
event ServiceFeeSet(address account, address token, uint256 newServiceFee);
/// @notice An event emitted once a member claims fees accredited to him
event Claim(address member, address token, uint256 amount);
/// @notice Construct a new FeeCalculator contract
/// @param _precision The precision for every fee calculator
function initFeeCalculator(uint256 _precision) external;
/// @return The current precision for service fee calculations of tokens
function serviceFeePrecision() external view returns (uint256);
/// @notice Sets the service fee for a token
/// @param _token The target token
/// @param _serviceFeePercentage The new service fee percentage
function setServiceFee(address _token, uint256 _serviceFeePercentage)
external;
/// @notice Returns all data for a specific native fee calculator
/// @param _token The target token
/// @return serviceFeePercentage The current service fee
/// @return feesAccrued Total fees accrued since contract deployment
/// @return previousAccrued Total fees accrued up to the last point a member claimed rewards
/// @return accumulator Accumulates rewards on a per-member basis
function tokenFeeData(address _token)
external
view
returns (
uint256 serviceFeePercentage,
uint256 feesAccrued,
uint256 previousAccrued,
uint256 accumulator
);
/// @param _account The address of a validator
/// @param _token The token address
/// @return The total amount claimed by the provided validator address for the specified token
function claimedRewardsPerAccount(address _account, address _token)
external
view
returns (uint256);
/// @notice Sends out the reward accumulated by the caller for the specified token
function claim(address _token) external;
}