Skip to content

Latest commit

 

History

History
360 lines (305 loc) · 10.7 KB

IStakingPools.md

File metadata and controls

360 lines (305 loc) · 10.7 KB

IStakingPools.sol

View Source: contracts/interfaces/IStakingPools.sol

↗ Extends: IMember ↘ Derived Contracts: StakingPoolBase

IStakingPools

Enums

StakingPoolType

enum StakingPoolType {
 TokenStaking,
 PODStaking
}

Events

event PoolUpdated(bytes32 indexed key, string  name, enum IStakingPools.StakingPoolType  poolType, address indexed stakingToken, address  uniStakingTokenDollarPair, address indexed rewardToken, address  uniRewardTokenDollarPair, uint256  rewardTokenDeposit, uint256  maxStake, uint256  rewardPerBlock, uint256  lockupPeriodInBlocks, uint256  platformFee);
event PoolClosed(bytes32 indexed key, string  name);
event Deposited(bytes32 indexed key, address indexed account, address indexed token, uint256  amount);
event Withdrawn(bytes32 indexed key, address indexed account, address indexed token, uint256  amount);
event RewardsWithdrawn(bytes32 indexed key, address indexed account, address indexed token, uint256  rewards, uint256  platformFee);

Functions

addOrEditPool

Adds or edits the pool by key

function addOrEditPool(bytes32 coverKey, string name, enum IStakingPools.StakingPoolType poolType, address[] addresses, uint256[] values) external nonpayable

Arguments

Name Type Description
coverKey bytes32 Enter the key of the pool you want to create or edit
name string Enter a name for this pool
poolType enum IStakingPools.StakingPoolType Specify the pool type: TokenStaking or PODStaking
addresses address[] [0] stakingToken The token which is staked in this pool
values uint256[] [0] stakingTarget Specify the target amount in the staking token. You can not exceed the target.
Source Code
function addOrEditPool(
    bytes32 coverKey,
    string calldata name,
    StakingPoolType poolType,
    address[] calldata addresses,
    uint256[] calldata values
  ) external;

closePool

function closePool(bytes32 coverKey) external nonpayable

Arguments

Name Type Description
coverKey bytes32
Source Code
function closePool(bytes32 coverKey) external;

deposit

function deposit(bytes32 coverKey, uint256 amount) external nonpayable

Arguments

Name Type Description
coverKey bytes32
amount uint256
Source Code
function deposit(bytes32 coverKey, uint256 amount) external;

withdraw

function withdraw(bytes32 coverKey, uint256 amount) external nonpayable

Arguments

Name Type Description
coverKey bytes32
amount uint256
Source Code
function withdraw(bytes32 coverKey, uint256 amount) external;

withdrawRewards

function withdrawRewards(bytes32 coverKey) external nonpayable

Arguments

Name Type Description
coverKey bytes32
Source Code
function withdrawRewards(bytes32 coverKey) external;

calculateRewards

function calculateRewards(bytes32 coverKey, address account) external view
returns(uint256)

Arguments

Name Type Description
coverKey bytes32
account address
Source Code
function calculateRewards(bytes32 coverKey, address account) external view returns (uint256);

getInfo

Gets the info of a given staking pool by key

function getInfo(bytes32 coverKey, address you) external view
returns(name string, addresses address[], values uint256[])

Arguments

Name Type Description
coverKey bytes32 Provide the staking pool key to fetch info for
you address Specify the address to customize the info for
Source Code
function getInfo(bytes32 coverKey, address you)
    external
    view
    returns (
      string memory name,
      address[] memory addresses,
      uint256[] memory values
    );

Contracts