Address: 0x0000000000000000000000000000000000001003
Interface: IStaking
ABI: IStaking
use staking v2 precompiled contract to call some functions of the staking module, such as: delegate, undelegate, redelegate, etc.
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
{% hint style="info" %} only can delegate origin token {% endhint %}
{% hint style="info" %} only delegate validator who has participated in block generation, delegate again, will get reward {% endhint %}
delegate event
event DelegateV2(
address indexed delegator,
string validator,
uint256 amount
);
delegator
: the delegator addressvalidator
: the validator address to be delegatedamount
: the amount of the token to be delegated
undelegate token from validator, get result
function undelegateV2(
string memory _val,
uint256 _amount
) external returns (bool _result);
-
_val
: the validator address to be undelegate -
_amount
: the amount to undelegate -
_result_
: the undelegate result
undelegate event
event UndelegateV2(
address indexed sender,
string validator,
uint256 amount,
uint256 completionTime
);
sender
: the sender addressvalidator
: the validator address to be undelegateamount
: the amount to undelegatecompletionTime
: the completion time of undelegate
redelegate token from validator to other validator, get result
function redelegateV2(
string memory _valSrc,
string memory _valDst,
uint256 _amount
) external returns (bool _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
event RedelegateV2(
address indexed sender,
string valSrc,
string valDst,
uint256 amount,
uint256 completionTime
);
sender
: the sender addressvalSrc
: the validator address to be redelegatedvalDst
: the validator address to be redelegated toamount
: the amount to redelegatecompletionTime
: the completion time of redelegate