StakingAuRa
Index
Reference
Functions
addPool
function addPool(uint256 _amount, address _miningAddress) external
Adds a new candidate's pool to the list of active pools (see the `getPools` getter) and moves the specified amount of staking tokens from the candidate's staking address to the candidate's pool. A participant calls this function using their staking address when they want to create a pool. This is a wrapper for the `stake` function.
- Modifiers:
- gasPriceIsValid onlyInitialized
- Parameters:
_amount
- The amount of tokens to be staked._miningAddress
- The mining address of the candidate. The mining address is bound to the staking address (msg.sender). This address cannot be equal to `msg.sender`.
addPoolNative
function addPoolNative(address _miningAddress) external payable
Adds a new candidate's pool to the list of active pools (see the `getPools` getter) and moves the specified amount of staking coins from the candidate's staking address to the candidate's pool. A participant calls this function using their staking address when they want to create a pool. This is a wrapper for the `stake` function.
- Modifiers:
- gasPriceIsValid onlyInitialized
- Parameters:
_miningAddress
- The mining address of the candidate. The mining address is bound to the staking address (msg.sender). This address cannot be equal to `msg.sender`.
areStakeAndWithdrawAllowed
function areStakeAndWithdrawAllowed() public view returns (bool)
Determines whether staking/withdrawal operations are allowed at the moment. Used by all staking/withdrawal functions.
- Returns:
- bool
initialize
function initialize(address _validatorSetContract, address[] _initialStakingAddresses, uint256 _delegatorMinStake, uint256 _candidateMinStake, uint256 _stakingEpochDuration, uint256 _stakingEpochStartBlock, uint256 _stakeWithdrawDisallowPeriod, bool _erc20Restricted) external
Initializes the network parameters. Must be called by the constructor of the `InitializerAuRa` contract.
- Parameters:
_validatorSetContract
- The address of the `ValidatorSetAuRa` contract._initialStakingAddresses
- The array of initial validators' staking addresses._delegatorMinStake
- The minimum allowed amount of delegator stake in STAKE_UNITs._candidateMinStake
- The minimum allowed amount of candidate/validator stake in STAKE_UNITs._stakingEpochDuration
- The duration of a staking epoch in blocks (e.g., 120960 = 1 week for 5-seconds blocks in AuRa)._stakingEpochStartBlock
- The number of the first block of initial staking epoch (must be zero if the network is starting from genesis block)._stakeWithdrawDisallowPeriod
- The duration period (in blocks) at the end of a staking epoch during which participants cannot stake or withdraw their staking tokens/coins (e.g., 4320 = 6 hours for 5-seconds blocks in AuRa)._erc20Restricted
- Defines whether this staking contract restricts using ERC20/677 contract. If it's set to `true`, native staking coins are used instead of ERC staking tokens.
setStakingEpochStartBlock
function setStakingEpochStartBlock(uint256 _blockNumber) external
Sets the number of the first block in the upcoming staking epoch. Called by the `ValidatorSetAuRa.newValidatorSet` function at the last block of a staking epoch.
- Modifiers:
- onlyValidatorSetContract
- Parameters:
_blockNumber
- The number of the very first block in the upcoming staking epoch.
stakeWithdrawDisallowPeriod
function stakeWithdrawDisallowPeriod() public view returns (uint256)
Returns the duration period (in blocks) at the end of staking epoch during which participants are not allowed to stake and withdraw their staking tokens/coins.
- Returns:
- uint256
stakingEpochDuration
function stakingEpochDuration() public view returns (uint256)
Returns the duration of a staking epoch in blocks.
- Returns:
- uint256
stakingEpochEndBlock
function stakingEpochEndBlock() public view returns (uint256)
Returns the number of the last block of the current staking epoch.
- Returns:
- uint256
stakingEpochStartBlock
function stakingEpochStartBlock() public view returns (uint256)
Returns the number of the first block of the current staking epoch.
- Returns:
- uint256