Skip to content

Commit

Permalink
chore: update staking interface contract
Browse files Browse the repository at this point in the history
  • Loading branch information
devpavan04 committed Nov 21, 2023
1 parent 1ab7dad commit 1498167
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions precompiles/staking/StakingInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ pragma solidity >=0.8.3;
address constant STAKING_ADDRESS = 0x0000000000000000000000000000000000000800;

/// @dev The Staking contract's instance.
Staking constant STAKING_CONTRACT = Staking(
STAKING_ADDRESS
);
Staking constant STAKING_CONTRACT = Staking(STAKING_ADDRESS);

/// @title Pallet Staking Interface
/// @dev The interface through which solidity contracts will interact with Staking pALLET
Expand All @@ -16,19 +14,19 @@ Staking constant STAKING_CONTRACT = Staking(
/// @custom:address 0x0000000000000000000000000000000000000800
interface Staking {
/// @dev Get current era
/// @return era
/// @return era
function currentEra() external view returns (uint32);

/// @dev Get min nominator bond
/// @return min nominator bond
/// @return min nominator bond
function minNominatorBond() external view returns (uint256);

/// @dev Get min validator bond
/// @return min validator bond
/// @return min validator bond
function minValidatorBond() external view returns (uint256);

/// @dev Min Active stake
/// @return min active stake
/// @return min active stake
function minActiveStake() external view returns (uint256);

/// @dev Validator count
Expand Down Expand Up @@ -58,4 +56,43 @@ interface Staking {
/// @return Total stake in era.
function erasTotalStake(uint32 eraIndex) external view returns (uint256);

/// @dev Nominate a set of validators.
/// @param targets Array of validators' addresses to nominate.
function nominate(bytes32[] calldata targets) external;

/// @dev Bond tokens for staking.
/// @param value Amount of tokens to bond.
/// @param payee Address to receive staking rewards.
function bond(uint256 value, bytes32 payee) external;

/// @dev Bond additional tokens for staking.
/// @param maxAdditional Amount of additional tokens to bond.
function bondExtra(uint256 maxAdditional) external;

/// @dev Unbond a portion of the staked tokens.
/// @param value Amount of tokens to unbond.
function unbond(uint256 value) external;

/// @dev Withdraw unbonded tokens after the unbonding period.
/// @param numSlashingSpans Number of slashing spans for a validator.
function withdrawUnbonded(uint32 numSlashingSpans) external;

/// @dev Stop nominating and become inactive in staking.
function chill() external;

/// @dev Set the reward destination for staking rewards.
/// @param payee The reward destination type (0-Staked, 1-Stash, 2-Controller).
function setPayee(uint8 payee) external;

/// @dev (Re-)set the controller to the stash.
function setController() external;

/// @dev Trigger payout for a validator and era.
/// @param validatorStash The stash address of the validator.
/// @param era The era index for which to trigger the payout.
function payoutStakers(bytes32 validatorStash, uint32 era) external;

/// @dev Rebond a portion of the unbonded tokens.
/// @param value Amount of tokens to rebond.
function rebond(uint256 value) external;
}

0 comments on commit 1498167

Please sign in to comment.