StakeManager

Contents

Globals

Modifiers

onlyRouterOrFeePool

No description

Declaration:

  modifier onlyRouterOrFeePool

Functions

constructor

No description

Declaration:

  function constructor(
  ) public Only

Modifiers:

indexedValidatorsLength

Get the indexed validators length.

Declaration:

  function indexedValidatorsLength(
  ) external returns (uint256)

Modifiers: No modifiers

indexedValidatorsExists

Determine whether the index validator exists by id.

Declaration:

  function indexedValidatorsExists(
    uint256 id
  ) external returns (bool)

Modifiers: No modifiers

Args:

indexedValidatorsByIndex

Get indexed validator address by index.

Declaration:

  function indexedValidatorsByIndex(
    uint256 index
  ) external returns (address validator)

Modifiers: No modifiers

Args:

indexedValidatorsById

Get indexed validator address by id.

Declaration:

  function indexedValidatorsById(
    uint256 id
  ) external returns (address)

Modifiers: No modifiers

Args:

getVotingPowerByIndex

Get the voting power by validator index, if index is out of range or validator doesn't exist, return 0.

Declaration:

  function getVotingPowerByIndex(
    uint256 index
  ) external returns (uint256)

Modifiers: No modifiers

Args:

getVotingPowerById

Get the voting power by validator id, if doesn't exist, return 0.

Declaration:

  function getVotingPowerById(
    uint256 id
  ) external returns (uint256)

Modifiers: No modifiers

Args:

getVotingPowerByAddress

Get the voting power by validator address, if the validator doesn't exist, return 0.

Declaration:

  function getVotingPowerByAddress(
    address validator
  ) public returns (uint256)

Modifiers: No modifiers

Args:

getTotalLockedAmountAndValidatorCount

Get the total locked amount and the validator count, but no including the excludes.

Declaration:

  function getTotalLockedAmountAndValidatorCount(
    address[] excludes
  ) external returns (uint256 _totalLockedAmount, uint256 validatorCount)

Modifiers: No modifiers

Args:

activeValidatorsLength

Get the active validators list length.

Declaration:

  function activeValidatorsLength(
  ) external returns (uint256)

Modifiers: No modifiers

estimateSharesToAmount

Estimate how much GXC should be stake, if user wants to get the number of shares, Or estimate how much GXC can be obtained, if user unstake the amount of GXC.

Declaration:

  function estimateSharesToAmount(
    address validator,
    uint256 shares
  ) public returns (uint256 amount)

Modifiers: No modifiers

Args:

estimateAmountToShares

Estimate how much shares should be unstake, if user wants to get the amount of GXC. Or estimate how much shares can be obtained, if user stake the amount of GXC. If the validator doesn't exist, return 0.

Declaration:

  function estimateAmountToShares(
    address validator,
    uint256 amount
  ) public returns (uint256 shares)

Modifiers: No modifiers

Args:

estimateUnstakeAmount

Estimate how much GXC can be claim, if unstake the number of shares(when unstake timeout). If the validator doesn't exist, return 0.

Declaration:

  function estimateUnstakeAmount(
    address validator,
    uint256 shares
  ) external returns (uint256 amount)

Modifiers: No modifiers

Args:

receive

No description

Declaration:

  function receive(
  ) external

Modifiers: No modifiers

stake

Stake for validator and mint share token to to address. It will emit Stake event.

Declaration:

  function stake(
    address validator,
    address to
  ) external nonReentrant returns (uint256 shares)

Modifiers:

Args:

startUnstake

Start unstake shares for validator. Stake manager will burn the shares immediately, but return GXC to to address after config.unstakeDelay. It will emit StartUnstake event.

Declaration:

  function startUnstake(
    address validator,
    address payable to,
    uint256 shares
  ) external nonReentrant returns (uint256)

Modifiers:

Args:

Returns:

Declaration:

  function startClaim(
    address payable to,
    uint256 amount
  ) external nonReentrant returns (uint256)

Modifiers:

Args:

Returns:

Declaration:

  function setCommissionRate(
    uint256 rate
  ) external nonReentrant

Modifiers:

Args:

unstake

Unstake by id, return unstake amount.

Declaration:

  function unstake(
    uint256 id
  ) external nonReentrant returns (uint256 amount)

Modifiers:

Args:

removeIndexedValidator

Remove the validator from indexedValidators if the voting power is less than minIndexVotingPower This can be called by anyone.

Declaration:

  function removeIndexedValidator(
    address validator
  ) external nonReentrant

Modifiers:

Args:

addIndexedValidator

Add the validator to indexedValidators if the voting power is greater than minIndexVotingPower This can be called by anyone.

Declaration:

  function addIndexedValidator(
    address validator
  ) external nonReentrant

Modifiers:

Args:

reward

Reward validator, only can be called by system caller

Declaration:

  function reward(
    address validator
  ) external nonReentrant onlyRouterOrFeePool

Modifiers:

Args:

slash

Slash validator, only can be called by system caller

Declaration:

  function slash(
    address validator,
    uint8 reason
  ) external nonReentrant onlyRouter returns (uint256 amount)

Modifiers:

Args:

onAfterBlock

After block callback, it will be called by system caller after each block is processed

Declaration:

  function onAfterBlock(
    address _proposer,
    address[] acValidators,
    int256[] priorities
  ) external nonReentrant onlyRouter

Modifiers:

Args:

Events

Reward

Emitted when a validator gets a reward NOTE: this event is never shown in the block, because the reward function is only called by the system caller

Params:

  because the `slash` function is only called by the system caller

Params:

Params:

Params:

Params:

Params:

Params:

Params:

Last updated