All pages
Powered by GitBook
1 of 1

Loading...

Prime liquidity provider

PrimeLiquidityProvider

PrimeLiquidityProvider is used to fund Prime

Solidity API

DEFAULT_MAX_DISTRIBUTION_SPEED

The default max token distribution speed


prime

Address of the Prime contract


tokenDistributionSpeeds

The rate at which token is distributed (per block)


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


initialize

PrimeLiquidityProvider initializer

Parameters

Name
Type
Description

❌ Errors

  • Throw InvalidArguments on different length of tokens and speeds array


initializeTokens

Initialize the distribution of the token

Parameters

Name
Type
Description

⛔️ Access Requirements

  • Only Governance


pauseFundsTransfer

Pause fund transfer of tokens to Prime contract

⛔️ Access Requirements

  • Controlled by ACM


resumeFundsTransfer

Resume fund transfer of tokens to Prime contract

⛔️ Access Requirements

  • Controlled by ACM


setTokensDistributionSpeed

Set distribution speed (amount of token distribute per block)

Parameters

Name
Type
Description

⛔️ Access Requirements

  • Controlled by ACM

❌ 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

Name
Type
Description

⛔️ Access Requirements

  • Controlled by ACM

❌ Errors

  • Throw InvalidArguments on different length of tokens and speeds array


setPrimeToken

Set the prime token contract address

Parameters

Name
Type
Description

📅 Events

  • Emits PrimeTokenUpdated event

⛔️ Access Requirements

  • Only owner


setMaxLoopsLimit

Set the limit for the loops can iterate to avoid the DOS

Parameters

Name
Type
Description

📅 Events

  • Emits MaxLoopsLimitUpdated event on success

⛔️ Access Requirements

  • Controlled by ACM


releaseFunds

Claim all the token accrued till last block

Parameters

Name
Type
Description

📅 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


sweepToken

A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to user

Parameters

Name
Type
Description

📅 Events

  • Emits SweepToken event

⛔️ Access Requirements

  • Only Governance

❌ 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

Name
Type
Description

Return Values

Name
Type
Description

accrueTokens

Accrue token by updating the distribution state

Parameters

Name
Type
Description

📅 Events

  • Emits TokensAccrued event


getBlockNumber

Get the latest block number

Return Values

Name
Type
Description

loopsLimit_

uint256

Maximum number of loops allowed in a single transaction

accessControlManager_

address

AccessControlManager contract address

tokens_

address[]

Array of addresses of the tokens

distributionSpeeds_

uint256[]

New distribution speeds for tokens

maxDistributionSpeeds_

uint256[]

tokens_

address[]

Array of addresses of the tokens to be intialized

tokens_

address[]

Array of addresses of the tokens

distributionSpeeds_

uint256[]

New distribution speeds for tokens

tokens_

address[]

Array of addresses of the tokens

maxDistributionSpeeds_

uint256[]

New distribution speeds for tokens

prime_

address

The new address of the prime token contract

loopsLimit

uint256

Limit for the max loops can execute at a time

token_

address

The token to release to the Prime contract

token_

contract IERC20Upgradeable

The address of the ERC-20 token to sweep

to_

address

The address of the recipient

amount_

uint256

The amount of tokens needs to transfer

token_

address

Address of the token

[0]

uint256

speed returns the per block reward

token_

address

Address of the token

[0]

uint256

blockNumber returns the block number

uint256 DEFAULT_MAX_DISTRIBUTION_SPEED
address prime
mapping(address => uint256) tokenDistributionSpeeds
mapping(address => uint256) maxTokenDistributionSpeeds
mapping(address => uint256) lastAccruedBlock
mapping(address => uint256) tokenAmountAccrued
function initialize(address accessControlManager_, address[] tokens_, uint256[] distributionSpeeds_, uint256[] maxDistributionSpeeds_, uint256 loopsLimit_) external
function initializeTokens(address[] tokens_) external
function pauseFundsTransfer() external
function resumeFundsTransfer() external
function setTokensDistributionSpeed(address[] tokens_, uint256[] distributionSpeeds_) external
function setMaxTokensDistributionSpeed(address[] tokens_, uint256[] maxDistributionSpeeds_) external
function setPrimeToken(address prime_) external
function setMaxLoopsLimit(uint256 loopsLimit) external
function releaseFunds(address token_) external
function sweepToken(contract IERC20Upgradeable token_, address to_, uint256 amount_) external
function getEffectiveDistributionSpeed(address token_) external view returns (uint256)
function accrueTokens(address token_) public
function getBlockNumber() public view virtual returns (uint256)