Distributor
Inherits: Policy
State Variables
KLIMA
address public immutable KLIMA;
treasury
address public immutable treasury;
epochLength
uint256 public immutable epochLength;
nextEpochBlock
uint256 public nextEpochBlock;
adjustments
mapping(uint256 => Adjust) public adjustments;
info
Info[] public info;
Functions
constructor
constructor(address _treasury, address _klima, uint256 _epochLength, uint256 _nextEpochBlock);
distribute
send epoch reward to staking contract
function distribute() external returns (bool);
adjust
increment reward rate for collector
function adjust(uint256 _index) internal;
nextRewardAt
view function for next reward at given rate
function nextRewardAt(uint256 _rate) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_rate | uint256 | uint |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | uint |
nextRewardFor
view function for next reward for specified address
function nextRewardFor(address _recipient) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_recipient | address | address |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | uint |
addRecipient
adds recipient for distributions
function addRecipient(address _recipient, uint256 _rewardRate) external onlyPolicy;
Parameters
Name | Type | Description |
---|---|---|
_recipient | address | address |
_rewardRate | uint256 | uint |
removeRecipient
removes recipient for distributions
function removeRecipient(uint256 _index, address _recipient) external onlyPolicy;
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | uint |
_recipient | address | address |
setAdjustment
set adjustment info for a collector's reward rate
function setAdjustment(uint256 _index, bool _add, uint256 _rate, uint256 _target) external onlyPolicy;
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | uint |
_add | bool | bool |
_rate | uint256 | uint |
_target | uint256 | uint |
Structs
Info
struct Info {
uint256 rate;
address recipient;
}
Adjust
struct Adjust {
bool add;
uint256 rate;
uint256 target;
}