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
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
undelegateV2
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
redelegateV2
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
withdraw
withdraw delegate reward
function withdraw(string memory _val) external returns (uint256 _reward);_val: the validator address to be withdraw_reward: reward amount
withdraw event
event Withdraw(address indexed sender, string validator, uint256 reward);withdrawer: the withdraw addressvalidator: the validator address to be withdrawreward: reward amount
delegation
query delegation
function delegation(
string memory _val,
address _del
) external view returns (uint256 _shares, uint256 _delegateAmount);_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
function delegationRewards(
string memory _val,
address _del
) external view returns (uint256 _reward);_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