Developers Forum for XinFin XDC Network

Abdullah Alam
Abdullah Alam

Posted on • Updated on

[Closed]What do the parameters in XDC Validator Contract withdraw function refer to?

We are working on a contract that will interface with the XDC Validator contract at xdc0000000000000000000000000000000000000088. So far we have been able to programmatically call every function of the staking lifecycle except withdraw(). This is what the function definition in the Validator contract at the aforementioned address looks like:

function withdraw(uint256 _blockNumber, uint _index) public onlyValidWithdraw(_blockNumber, _index) {
        ...
    }
Enter fullscreen mode Exit fullscreen mode

What do uint256 _blockNumber and uint _index refer to in the context of withdrawing funds from the Validator contract?

Discussion (5)

Collapse
ivan_blocksscan profile image
Ivan_BlocksScan

Hello @theabdullahalam

_blockNumber: There are 1296000 blocks cooling off period after you successfully RESIGN MasterNode/StandBy from XDC Validator.

_index: Each Owner can host multiple MasterNode from single account hence index params added to define withdrawal from multiple resign of MasterNode.

Here are few transactions where withdrawal function executed for multiple MasterNode.

xdc.blocksscan.io/txs/0x03a7b89184...

xdc.blocksscan.io/txs/0x57f05858b0...

Collapse
theabdullahalam profile image
Abdullah Alam Author

Thank you so much for the response.

For a typical scenario of a single node, what values would be needed to be passed to this method to withdraw funds programmatically? I would guess _index will be 0 given that it would be the only node, and _blockNumber would be the resignation transaction block number + 1296000. Is that correct?

Collapse
ivan_blocksscan profile image
Ivan_BlocksScan

Yes. That is correct.

Collapse
jay_kulkarni_842b41d81b23 profile image
Jay_Blocksscan

Hello,

We hope that the above issue is resolved, if the issue is still persist then please let us know about the it so that the team can resolve it on priority. It will be grateful to get an update within 72 hours or else it will be considered resolved.

Thank You

Collapse
ivan_blocksscan profile image
Ivan_BlocksScan

We are discussing your concern with the XDC Network team, and we'll let you know more specifically as soon as possible.