Skip to content

Latest commit

 

History

History
393 lines (334 loc) · 10.7 KB

IStakingPools.md

File metadata and controls

393 lines (334 loc) · 10.7 KB

IStakingPools.sol

View Source: contracts/interfaces/IStakingPools.sol

↗ Extends: IMember ↘ Derived Contracts: StakingPoolBase

IStakingPools

Enums

StakingPoolType

enum StakingPoolType {
 TokenStaking,
 PODStaking
}

Structs

AddOrEditPoolArgs

struct AddOrEditPoolArgs {
 bytes32 key,
 string name,
 enum IStakingPools.StakingPoolType poolType,
 address stakingToken,
 address uniStakingTokenDollarPair,
 address rewardToken,
 address uniRewardTokenDollarPair,
 uint256 stakingTarget,
 uint256 maxStake,
 uint256 platformFee,
 uint256 rewardPerBlock,
 uint256 lockupPeriod,
 uint256 rewardTokenToDeposit
}

StakingPoolInfoType

struct StakingPoolInfoType {
 string name,
 address stakingToken,
 address stakingTokenStablecoinPair,
 address rewardToken,
 address rewardTokenStablecoinPair,
 uint256 totalStaked,
 uint256 target,
 uint256 maximumStake,
 uint256 stakeBalance,
 uint256 cumulativeDeposits,
 uint256 rewardPerBlock,
 uint256 platformFee,
 uint256 lockupPeriod,
 uint256 rewardTokenBalance,
 uint256 accountStakeBalance,
 uint256 totalBlockSinceLastReward,
 uint256 rewards,
 uint256 canWithdrawFromBlockHeight,
 uint256 lastDepositHeight,
 uint256 lastRewardHeight
}

Events

event PoolUpdated(bytes32 indexed key, struct IStakingPools.AddOrEditPoolArgs  args);
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(struct IStakingPools.AddOrEditPoolArgs args) external nonpayable

Arguments

Name Type Description
args struct IStakingPools.AddOrEditPoolArgs
Source Code
function addOrEditPool(AddOrEditPoolArgs calldata args) external;

closePool

function closePool(bytes32 key) external nonpayable

Arguments

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

deposit

function deposit(bytes32 key, uint256 amount) external nonpayable

Arguments

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

withdraw

function withdraw(bytes32 key, uint256 amount) external nonpayable

Arguments

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

withdrawRewards

function withdrawRewards(bytes32 key) external nonpayable

Arguments

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

calculateRewards

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

Arguments

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

getInfo

Gets the info of a given staking pool by key

function getInfo(bytes32 key, address you) external view
returns(info struct IStakingPools.StakingPoolInfoType)

Arguments

Name Type Description
key 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 key, address you) external view returns (StakingPoolInfoType memory info);

Contracts