Distributor

Git Source

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

NameTypeDescription
_rateuint256uint

Returns

NameTypeDescription
<none>uint256uint

nextRewardFor

view function for next reward for specified address

function nextRewardFor(address _recipient) public view returns (uint256);

Parameters

NameTypeDescription
_recipientaddressaddress

Returns

NameTypeDescription
<none>uint256uint

addRecipient

adds recipient for distributions

function addRecipient(address _recipient, uint256 _rewardRate) external onlyPolicy;

Parameters

NameTypeDescription
_recipientaddressaddress
_rewardRateuint256uint

removeRecipient

removes recipient for distributions

function removeRecipient(uint256 _index, address _recipient) external onlyPolicy;

Parameters

NameTypeDescription
_indexuint256uint
_recipientaddressaddress

setAdjustment

set adjustment info for a collector's reward rate

function setAdjustment(uint256 _index, bool _add, uint256 _rate, uint256 _target) external onlyPolicy;

Parameters

NameTypeDescription
_indexuint256uint
_addboolbool
_rateuint256uint
_targetuint256uint

Structs

Info

struct Info {
    uint256 rate;
    address recipient;
}

Adjust

struct Adjust {
    bool add;
    uint256 rate;
    uint256 target;
}