Skip to main content

AutoRewardsDistributor

Controller Contract to set tribe per block in Rewards Distributor Admin on Rari

Functions

constructor

function constructor(
address coreAddress,
contract IRewardsDistributorAdmin _rewardsDistributorAdmin,
contract ITribalChief _tribalChief,
uint256 _tribalChiefRewardIndex,
address _cTokenAddress,
bool _isBorrowIncentivized
) public

constructor function

Parameters

NameTypeDescription
coreAddressaddressaddress of core contract
_rewardsDistributorAdmincontract IRewardsDistributorAdminaddress of rewards distributor admin contract
_tribalChiefcontract ITribalChiefaddress of tribalchief contract
_tribalChiefRewardIndexuint256index for this contract's rewards in tribalchief
_cTokenAddressaddressaddress of ctoken contract to incentivize
_isBorrowIncentivizedboolboolean that incentivizes borrow or supply

_deriveRequiredCompSpeed

function _deriveRequiredCompSpeed() internal returns (uint256 compSpeed)

helper function that gets all needed state from the TribalChief contract based on this state, it then calculates what the compSpeed should be.

getNewRewardSpeed

function getNewRewardSpeed() public returns (uint256 newCompSpeed, bool updateNeeded)

function to get the new comp speed and figure out if an update is needed

Return Values

NameTypeDescription
newCompSpeeduint256the newly calculated compSpeed based on allocation points in the TribalChief
updateNeededboolboolean indicating whether the new compSpeed is not equal to the existing compSpeed

setAutoRewardsDistribution

function setAutoRewardsDistribution() external

function to automatically set the rewards speed on the RewardsDistributor contract through the RewardsDistributorAdmin

setRewardsDistributorAdmin

function setRewardsDistributorAdmin(
contract IRewardsDistributorAdmin _newRewardsDistributorAdmin
) external

API to point to a new rewards distributor admin contract

Parameters

NameTypeDescription
_newRewardsDistributorAdmincontract IRewardsDistributorAdminthe address of the new RewardsDistributorAdmin contract

Events

SpeedChanged

event SpeedChanged(
uint256 newSpeed
)

Parameters

NameTypeDescription
newSpeeduint256

RewardsDistributorAdminChanged

event RewardsDistributorAdminChanged(
contract IRewardsDistributorAdmin oldRewardsDistributorAdmin,
contract IRewardsDistributorAdmin newRewardsDistributorAdmin
)

Parameters

NameTypeDescription
oldRewardsDistributorAdmincontract IRewardsDistributorAdmin
newRewardsDistributorAdmincontract IRewardsDistributorAdmin