View Source: contracts/RewardControl.sol
↗ Extends: RewardControlStorage, RewardControlInterface, ExponentialNoError
Events
event AlkSpeedUpdated(address indexed market, uint256 newSpeed, bool isVerified);
event DistributedSupplierAlk(address indexed market, address indexed supplier, uint256 supplierDelta, uint256 supplierAccruedAlk, uint256 supplyIndexMantissa, bool isVerified);
event DistributedBorrowerAlk(address indexed market, address indexed borrower, uint256 borrowerDelta, uint256 borrowerAccruedAlk, uint256 borrowIndexMantissa, bool isVerified);
event TransferredAlk(address indexed participant, uint256 participantAccrued, address market, bool isVerified);
event OwnerUpdate(address indexed owner, address indexed newOwner);
event MarketAdded(address indexed market, uint256 numberOfMarkets, bool isVerified);
event MarketRemoved(address indexed market, uint256 numberOfMarkets, bool isVerified);
Make sure that the sender is only the owner of the contract
modifier onlyOwner() internal
Arguments
initializer(address _owner, address _alkemiEarnVerified, address _alkemiEarnPublic, address _alkAddress)
refreshAlkSupplyIndex(address market, address supplier, bool isVerified)
refreshAlkBorrowIndex(address market, address borrower, bool isVerified)
claimAlk(address holder, address market, bool isVerified)
updateAlkSupplyIndex(address market, bool isVerified)
updateAlkBorrowIndex(address market, bool isVerified)
distributeSupplierAlk(address market, address supplier, bool isVerified)
distributeBorrowerAlk(address market, address borrower, bool isVerified)
claimAlk(address holder, address[] markets, bool isVerified)
transferAlk(address participant, uint256 participantAccrued, address market, bool isVerified)
getAlkAccrued(address participant)
getMarketStats(address market, bool isVerified)
getMarketTotalSupply(address market, bool isVerified)
getMarketTotalBorrows(address market, bool isVerified)
getSupplyBalance(address market, address supplier, bool isVerified)
getBorrowBalance(address market, address borrower, bool isVerified)
transferOwnership(address _newOwner)
addMarket(address market, bool isVerified)
removeMarket(uint256 id, bool isVerified)
setAlkAddress(address _alkAddress)
setAlkemiEarnVerifiedAddress(address _alkemiEarnVerified)
setAlkemiEarnPublicAddress(address _alkemiEarnPublic)
setAlkRate(uint256 _alkRate)
getAlkRewards(address user)
getSupplyAlkRewards(struct ExponentialNoError.Exp totalLiquidity, struct ExponentialNoError.Exp[] marketTotalLiquidity, address user, uint256 i, uint256 j, bool isVerified)
getBorrowAlkRewards(struct ExponentialNoError.Exp totalLiquidity, struct ExponentialNoError.Exp[] marketTotalLiquidity, address user, uint256 i, uint256 j, bool isVerified)
RewardControl is the contract to calculate and distribute reward tokens
Arguments
refreshAlkSupplyIndex
⤾ overrides RewardControlInterface.refreshAlkSupplyIndex
Refresh ALK supply index for the specified market and supplier
Arguments
The market whose supply index to update
The address of the supplier to distribute ALK to
Specifies if the market is from verified or public protocol
refreshAlkBorrowIndex
⤾ overrides RewardControlInterface.refreshAlkBorrowIndex
Refresh ALK borrow index for the specified market and borrower
Arguments
The market whose borrow index to update
The address of the borrower to distribute ALK to
Specifies if the market is from verified or public protocol
⤾ overrides RewardControlInterface.claimAlk
Claim all the ALK accrued by holder in all markets
Arguments
The address to claim ALK for
⤾ overrides RewardControlInterface.claimAlk
Claim all the ALK accrued by holder by refreshing the indexes on the specified market only
Arguments
The address to claim ALK for
The address of the market to refresh the indexes for
Specifies if the market is from verified or public protocol
refreshMarketLiquidity
Recalculate and update ALK speeds for all markets
Arguments
refreshAlkSpeeds
Recalculate and update ALK speeds for all markets
Arguments
updateAlkSupplyIndex
Accrue ALK to the market by updating the supply index
Arguments
The market whose supply index to update
Verified / Public protocol
updateAlkBorrowIndex
Accrue ALK to the market by updating the borrow index
Arguments
The market whose borrow index to update
Verified / Public protocol
distributeSupplierAlk
Calculate ALK accrued by a supplier and add it on top of alkAccrued[supplier]
Arguments
The market in which the supplier is interacting
The address of the supplier to distribute ALK to
Verified / Public protocol
distributeBorrowerAlk
Calculate ALK accrued by a borrower and add it on top of alkAccrued[borrower]
Arguments
The market in which the borrower is interacting
The address of the borrower to distribute ALK to
Verified / Public protocol
Claim all the ALK accrued by holder in the specified markets
Arguments
The address to claim ALK for
The list of markets to claim ALK in
Verified / Public protocol
Transfer ALK to the participant
Returns
The amount of ALK which was NOT transferred to the participant
Arguments
The address of the participant to transfer ALK to
The amount of ALK to (possibly) transfer
Market for which ALK is transferred
Verified / Public Protocol
Get the current block number
Returns
The current block number
Arguments
Get the current accrued ALK for a participant
Returns
The amount of accrued ALK for the participant
Arguments
The address of the participant
Get the address of the ALK token
Returns
The address of ALK token
Arguments
getAlkemiEarnAddress
Get the address of the underlying AlkemiEarnVerified and AlkemiEarnPublic contract
Returns
The address of the underlying AlkemiEarnVerified and AlkemiEarnPublic contract
Arguments
Get market statistics from the AlkemiEarnVerified contract
Returns
Market statistics for the given market
Arguments
The address of the market
Verified / Public protocol
getMarketTotalSupply
Get market total supply from the AlkemiEarnVerified / AlkemiEarnPublic contract
Returns
Market total supply for the given market
Arguments
The address of the market
Verified / Public protocol
getMarketTotalBorrows
Get market total borrows from the AlkemiEarnVerified contract
Returns
Market total borrows for the given market
Arguments
The address of the market
Verified / Public protocol
getSupplyBalance
Get supply balance of the specified market and supplier
Returns
Supply balance of the specified market and supplier
Arguments
The address of the market
The address of the supplier
Verified / Public protocol
getBorrowBalance
Get borrow balance of the specified market and borrower
Returns
Borrow balance of the specified market and borrower
Arguments
The address of the market
The address of the borrower
Verified / Public protocol
transferOwnership
Transfer the ownership of this contract to the new owner. The ownership will not be transferred until the new owner accept it.
Arguments
The address of the new owner
acceptOwnership
Accept the ownership of this contract by the new owner
Arguments
Add new market to the reward program
Arguments
The address of the new market to be added to the reward program
Verified / Public protocol
Remove a market from the reward program based on array index
Arguments
The index of the allMarkets array to be removed
Verified / Public protocol
Set ALK token address
Arguments
setAlkemiEarnVerifiedAddress
Set AlkemiEarnVerified contract address
Arguments
The AlkemiEarnVerified contract address
setAlkemiEarnPublicAddress
Set AlkemiEarnPublic contract address
Arguments
The AlkemiEarnVerified contract address
Set ALK rate
Arguments
Get latest ALK rewards
Arguments
getSupplyAlkRewards
Get latest Supply ALK rewards
Arguments
struct ExponentialNoError.Exp
Total Liquidity of all markets
struct ExponentialNoError.Exp[]
Array of individual market liquidity
index of the market in marketTotalLiquidity array
index of the market in the verified/public allMarkets array
Verified / Public protocol
getBorrowAlkRewards
Get latest Borrow ALK rewards
Arguments
struct ExponentialNoError.Exp
Total Liquidity of all markets
struct ExponentialNoError.Exp[]
Array of individual market liquidity
index of the market in marketTotalLiquidity array
index of the market in the verified/public allMarkets array
Verified / Public protocol