PrimeLiquidityProvider
PrimeLiquidityProvider is used to fund Prime
DEFAULT_MAX_DISTRIBUTION_SPEED
The default max token distribution speed
uint256 DEFAULT_MAX_DISTRIBUTION_SPEED
Address of the Prime contract
tokenDistributionSpeeds
The rate at which token is distributed (per block)
mapping(address => uint256) tokenDistributionSpeeds
maxTokenDistributionSpeeds
The max token distribution speed for token
lastAccruedBlock
The rate at which token is distributed to the Prime contract
tokenAmountAccrued
The token accrued but not yet transferred to prime contract
PrimeLiquidityProvider initializer
Parameters
AccessControlManager contract address
Array of addresses of the tokens
New distribution speeds for tokens
Maximum number of loops allowed in a single transaction
❌ Errors
Throw InvalidArguments on different length of tokens and speeds array
initializeTokens
Initialize the distribution of the token
Parameters
Array of addresses of the tokens to be intialized
⛔️ Access Requirements
pauseFundsTransfer
Pause fund transfer of tokens to Prime contract
⛔️ Access Requirements
resumeFundsTransfer
Resume fund transfer of tokens to Prime contract
⛔️ Access Requirements
setTokensDistributionSpeed
Set distribution speed (amount of token distribute per block)
Parameters
Array of addresses of the tokens
New distribution speeds for tokens
⛔️ Access Requirements
❌ Errors
Throw InvalidArguments on different length of tokens and speeds array
setMaxTokensDistributionSpeed
Set max distribution speed for token (amount of maximum token distribute per block)
Parameters
Array of addresses of the tokens
New distribution speeds for tokens
⛔️ Access Requirements
❌ Errors
Throw InvalidArguments on different length of tokens and speeds array
Set the prime token contract address
Parameters
The new address of the prime token contract
📅 Events
Emits PrimeTokenUpdated event
⛔️ Access Requirements
setMaxLoopsLimit
Set the limit for the loops can iterate to avoid the DOS
Parameters
Limit for the max loops can execute at a time
📅 Events
Emits MaxLoopsLimitUpdated event on success
⛔️ Access Requirements
Claim all the token accrued till last block
Parameters
The token to release to the Prime contract
📅 Events
Emits TokenTransferredToPrime event
❌ Errors
Throw InvalidArguments on Zero address(token)
Throw FundsTransferIsPaused is paused
Throw InvalidCaller if the sender is not the Prime contract
A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to user
Parameters
contract IERC20Upgradeable
The address of the ERC-20 token to sweep
The address of the recipient
The amount of tokens needs to transfer
📅 Events
⛔️ Access Requirements
❌ Errors
Throw InsufficientBalance if amount_ is greater than the available balance of the token in the contract
getEffectiveDistributionSpeed
Get rewards per block for token
Parameters
Return Values
speed returns the per block reward
Accrue token by updating the distribution state
Parameters
📅 Events
Emits TokensAccrued event
Get the latest block number
Return Values
blockNumber returns the block number