IStaking
Overview
License: Apache 2.0
interface IStakingFunctions info
addPopAddress (0x1f81eb80)
function addPopAddress(address addr) externalAdds a new proof_of_performance address.
Parameters:
addr
address
Address of proof_of_performance contract to add.
createStakingPool (0xbe111af4)
function createStakingPool(
address rigoblockPoolAddress
) external returns (bytes32 poolId)Create a new staking pool. The sender will be the staking pal of this pool.
Note that a staking pal must be payable.
When governance updates registry address, pools must be migrated to new registry, or this contract must query from both.
Parameters:
rigoblockPoolAddress
address
Adds rigoblock pool to the created staking pool for convenience if non-null.
Return values:
poolId
bytes32
The unique pool id generated for this pool.
setStakingPalAddress (0x3a832382)
Allows the operator to update the staking pal address.
Parameters:
poolId
bytes32
Unique id of pool.
newStakingPalAddress
address
Address of the new staking pal.
decreaseStakingPoolOperatorShare (0x5d91121d)
Decreases the operator share for the given pool (i.e. increases pool rewards for members).
Parameters:
poolId
bytes32
Unique Id of pool.
newOperatorShare
uint32
The newly decreased percentage of any rewards owned by the operator.
endEpoch (0x0b9663db)
Begins a new epoch, preparing the prior one for finalization.
Throws if not enough time has passed between epochs or if the
previous epoch was not fully finalized.
Return values:
numPoolsToFinalize
uint256
The number of unfinalized pools.
finalizePool (0xff691b11)
Instantly finalizes a single pool that earned rewards in the previous epoch,
crediting it rewards for members and withdrawing operator's rewards as GRG.
This can be called by internal functions that need to finalize a pool immediately.
Does nothing if the pool is already finalized or did not earn rewards in the previous epoch.
Parameters:
poolId
bytes32
The pool ID to finalize.
init (0xe1c7392a)
Initialize storage owned by this contract.
This function should not be called directly.
The StakingProxy contract will call it in attachStakingContract().
moveStake (0x58f6c7e3)
Moves stake between statuses: 'undelegated' or 'delegated'.
Delegated stake can also be moved between pools.
This change comes into effect next epoch.
Parameters:
from
struct IStructs.StakeInfo
Status to move stake out of.
to
struct IStructs.StakeInfo
Status to move stake into.
amount
uint256
Amount of stake to move.
creditPopReward (0xecc128f2)
Credits the value of a pool's pop reward.
Only a known RigoBlock pop can call this method. See (MixinPopManager).
Parameters:
poolAccount
address
The address of the rigoblock pool account.
popReward
uint256
The pop reward.
removePopAddress (0x36d7dd8e)
Removes an existing proof_of_performance address.
Parameters:
addr
address
Address of proof_of_performance contract to remove.
setParams (0x9c3ccc82)
Set all configurable parameters at once.
Parameters:
_epochDurationInSeconds
uint256
Minimum seconds between epochs.
_rewardDelegatedStakeWeight
uint32
How much delegated stake is weighted vs operator stake, in ppm.
_minimumPoolStake
uint256
Minimum amount of stake required in a pool to collect rewards.
_cobbDouglasAlphaNumerator
uint32
Numerator for cobb douglas alpha factor.
_cobbDouglasAlphaDenominator
uint32
Denominator for cobb douglas alpha factor.
stake (0xa694fc3a)
Stake GRG tokens. Tokens are deposited into the GRG Vault.
Unstake to retrieve the GRG. Stake is in the 'Active' status.
Parameters:
amount
uint256
of GRG to stake.
unstake (0x2e17de78)
Unstake. Tokens are withdrawn from the GRG Vault and returned to the staker.
Stake must be in the 'undelegated' status in both the current and next epoch in order to be unstaked.
Parameters:
amount
uint256
of GRG to unstake.
withdrawDelegatorRewards (0xb510879f)
Withdraws the caller's GRG rewards that have accumulated until the last epoch.
Parameters:
poolId
bytes32
Unique id of pool.
computeRewardBalanceOfDelegator (0xe907f003)
Computes the reward balance in GRG of a specific member of a pool.
Parameters:
poolId
bytes32
Unique id of pool.
member
address
The member of the pool.
Return values:
reward
uint256
Balance in GRG.
computeRewardBalanceOfOperator (0xbb7ef7e0)
Computes the reward balance in GRG of the operator of a pool.
Parameters:
poolId
bytes32
Unique id of pool.
Return values:
reward
uint256
Balance in GRG.
getCurrentEpochEarliestEndTimeInSeconds (0xb2baa33e)
Returns the earliest end time in seconds of this epoch.
The next epoch can begin once this time is reached.
Epoch period = [startTimeInSeconds..endTimeInSeconds)
Return values:
[0]
uint256
Time in seconds.
getGlobalStakeByStatus (0xe804d0a4)
Gets global stake for a given status.
Parameters:
stakeStatus
enum IStructs.StakeStatus
UNDELEGATED or DELEGATED
Return values:
balance
struct IStructs.StoredBalance
Global stake for given status.
getOwnerStakeByStatus (0x44a6958b)
Gets an owner's stake balances by status.
Parameters:
staker
address
Owner of stake.
stakeStatus
enum IStructs.StakeStatus
UNDELEGATED or DELEGATED
Return values:
balance
struct IStructs.StoredBalance
Owner's stake balances for given status.
getTotalStake (0x1e7ff8f6)
Returns the total stake for a given staker.
Parameters:
staker
address
of stake.
Return values:
[0]
uint256
Total GRG staked by staker.
getParams (0x5e615a6b)
Retrieves all configurable parameter values.
Return values:
_epochDurationInSeconds
uint256
Minimum seconds between epochs.
_rewardDelegatedStakeWeight
uint32
How much delegated stake is weighted vs operator stake, in ppm.
_minimumPoolStake
uint256
Minimum amount of stake required in a pool to collect rewards.
_cobbDouglasAlphaNumerator
uint32
Numerator for cobb douglas alpha factor.
_cobbDouglasAlphaDenominator
uint32
Denominator for cobb douglas alpha factor.
getStakeDelegatedToPoolByOwner (0xf252b7a1)
Returns stake delegated to pool by staker.
Parameters:
staker
address
of stake.
poolId
bytes32
Unique Id of pool.
Return values:
balance
struct IStructs.StoredBalance
Stake delegated to pool by staker.
getStakingPool (0x4bcc3f67)
Returns a staking pool
Parameters:
poolId
bytes32
Unique id of pool.
getStakingPoolStatsThisEpoch (0x46b97959)
Get stats on a staking pool in this epoch.
Parameters:
poolId
bytes32
Pool Id to query.
Return values:
[0]
struct IStructs.PoolStats
PoolStats struct for pool id.
getTotalStakeDelegatedToPool (0x3e4ad732)
Returns the total stake delegated to a specific staking pool, across all members.
Parameters:
poolId
bytes32
Unique Id of pool.
Return values:
balance
struct IStructs.StoredBalance
Total stake delegated to pool.
getGrgContract (0xef4ba680)
An overridable way to access the deployed GRG contract.
Must be view to allow overrides to access state.
Return values:
[0]
contract IRigoToken
The GRG contract instance.
getGrgVault (0xe0822db7)
An overridable way to access the deployed grgVault.
Must be view to allow overrides to access state.
Return values:
[0]
contract IGrgVault
The GRG vault contract.
getPoolRegistry (0x7a9bd5e4)
An overridable way to access the deployed rigoblock pool registry.
Must be view to allow overrides to access state.
Return values:
[0]
contract IPoolRegistry
The pool registry contract.
Last updated