Skip to main content

RewardsDistributorAdmin

this contract has its own internal ACL. The reasons for doing this and not leveraging core are twofold. One, it simplifies devops operations around adding and removing users, and two, by being self contained, it is more efficient as it does not need to make external calls to figure out who has a particular role.

Functions

constructor

function constructor(
address coreAddress,
contract IRewardsDistributorAdmin _rewardsDistributorContract,
address[] _autoRewardDistributors
) public

Parameters

NameTypeDescription
coreAddressaddressaddress of core contract
_rewardsDistributorContractcontract IRewardsDistributorAdminadmin rewards distributor contract
_autoRewardDistributorsaddress[]list of auto rewards distributor contracts that can call this contract

_setPendingAdmin

function _setPendingAdmin(
address newPendingAdmin
) external

Begins transfer of admin rights. The newPendingAdmin must call _acceptAdmin to finalize the transfer.

Admin function to begin change of admin. The newPendingAdmin must call _acceptAdmin to finalize the transfer.

Parameters

NameTypeDescription
newPendingAdminaddressNew pending admin.

_acceptAdmin

function _acceptAdmin() external

Accepts transfer of admin rights. msg.sender must be pendingAdmin

Admin function for pending admin to accept role and update admin

_grantComp

function _grantComp(
address recipient,
uint256 amount
) external

Transfer COMP to the recipient

Note: If there is not enough COMP, we do not perform the transfer all.

Parameters

NameTypeDescription
recipientaddressThe address of the recipient to transfer COMP to
amountuint256The amount of COMP to (possibly) transfer

_setCompSupplySpeed

function _setCompSupplySpeed(
address cToken,
uint256 compSpeed
) external

Set COMP speed for a single market. Callable only by users with auto rewards distributor role

Parameters

NameTypeDescription
cTokenaddressThe market whose COMP speed to update
compSpeeduint256

_setCompBorrowSpeed

function _setCompBorrowSpeed(
address cToken,
uint256 compSpeed
) external

Set COMP speed for a single market Callable only by users with auto rewards distributor role

Parameters

NameTypeDescription
cTokenaddressThe market whose COMP speed to update
compSpeeduint256

guardianDisableSupplySpeed

function guardianDisableSupplySpeed(
address cToken
) external

Set COMP supply speed for a single market to 0 Callable only by the guardian or governor

Parameters

NameTypeDescription
cTokenaddressThe market whose COMP speed to set to 0

guardianDisableBorrowSpeed

function guardianDisableBorrowSpeed(
address cToken
) external

Set COMP borrow speed for a single market to 0 Callable only by the guardian or governor

Parameters

NameTypeDescription
cTokenaddressThe market whose COMP speed to set to 0

_setContributorCompSpeed

function _setContributorCompSpeed(
address contributor,
uint256 compSpeed
) external

Set COMP speed for a single contributor

Parameters

NameTypeDescription
contributoraddressThe contributor whose COMP speed to update
compSpeeduint256New COMP speed for contributor

_addMarket

function _addMarket(
address cToken
) external

Add a default market to claim rewards for in claimRewards()

Parameters

NameTypeDescription
cTokenaddressThe market to add

_setImplementation

function _setImplementation(
address implementation_
) external

Set the implementation contract the RewardsDistributorDelegator delegate calls

Parameters

NameTypeDescription
implementation_addressthe logic contract address

compSupplySpeeds

function compSupplySpeeds(
address cToken
) external returns (uint256)

view function to get the comp supply speeds from the rewards distributor contract

Parameters

NameTypeDescription
cTokenaddressThe market to view

compBorrowSpeeds

function compBorrowSpeeds(
address cToken
) external returns (uint256)

view function to get the comp borrow speeds from the rewards distributor contract

Parameters

NameTypeDescription
cTokenaddressThe market to view

becomeAdmin

function becomeAdmin() public

allow admin or governor to assume auto reward distributor admin role