Staking-V2 Precompiled

Address: 0x0000000000000000000000000000000000001003

Interface: IStaking

ABI: IStaking

Introduction

use staking v2 precompiled contract to call some functions of the staking module, such as: delegate, undelegate, redelegate, etc.

Method

delegateV2

delegate token to validator, get result

function delegateV2(
    string memory _val,
    uint256 _amount
) external returns (bool _result);
  • _val: the validator address

  • _amount: the amount of the token to be delegate

  • _result_: the delegate result

only can delegate origin token

only delegate validator who has participated in block generation, delegate again, will get reward

delegate event

  • delegator: the delegator address

  • validator: the validator address to be delegated

  • amount: the amount of the token to be delegated

undelegateV2

undelegate token from validator, get result

  • _val: the validator address to be undelegate

  • _amount: the amount to undelegate

  • _result_: the undelegate result

undelegate event

  • sender: the sender address

  • validator: the validator address to be undelegate

  • amount: the amount to undelegate

  • completionTime: the completion time of undelegate

redelegateV2

redelegate token from validator to other validator, get result

  • _valSrc: the validator address to be redelegate

  • _valDst: the validator address to be redelegate to

  • _amount: the amount to redelegate

  • _result_: the undelegate result

redelegate event

  • sender: the sender address

  • valSrc: the validator address to be redelegated

  • valDst: the validator address to be redelegated to

  • amount: the amount to redelegate

  • completionTime: the completion time of redelegate

withdraw

withdraw delegate reward

  • _val: the validator address to be withdraw

  • _reward: reward amount

withdraw event

  • withdrawer: the withdraw address

  • validator: the validator address to be withdraw

  • reward: reward amount

delegation

query delegation

  • _val: the validator address to be query

  • _del: the delegator address to be query

  • _shares: the shares of the delegator in the validator

  • _delegateAmount: the amount of the delegator in the validator

delegationRewards

query delegation rewards

  • _val: the validator address to be query

  • _del: the delegator address to be query

  • _reward: the reward of the delegator in the validator

Last updated