DKA Withdraw

The withdrawal refers to transferring DKA from dKargo Chain (L3) to Arbitrum Chain (L2).

This process is executed in multiple steps through the collaboration of the bridge contract deployed on Arbitrum and the dKargo sequencer.

STEP 1 - Withdrawing DKA

The DKA withdrawal process is executed using the withdrawEth() method of the ArbSys precompile contract.

The DKA withdrawn from dKargo Chain (L3) is burned, and the corresponding L2 DKA in the bridge contract is processed through the next steps before being sent to the user.

const res = await dkaBridge.withdraw({
  childSigner,
  amount,
  destinationAddress: parentSigner.address,
  from: childSigner.address,
});

const receipt = await res.wait();
console.log(`withdraw DKA L3 tx hash: ${receipt.transactionHash}`)

STEP 2: Checking Withdrawal Status

After submitting a withdrawal request, the DKA on L2 can only be claimed after a dispute period of approximately 6.4 days. During this period, the withdrawal status remains pending.

const timeToWaitMs = 1000 * 60
const message = await receipt.getChildToParentMessages(parentProvider);

// Waiting until the 6.4-day dispute period passes.
await message[0].waitUntilReadyToExecute(childProvider, timeToWaitMs);

The withdrawal status can be checked on dScanner's L3 ➔ L2 Transactions page..

STEP 3: Claiming DKA

Once the dispute period ends, the user becomes eligible to claim the withdrawn DKA from the bridge contract.

The user can then finalize the withdrawal by claiming the requested DKA through the Outbox contract.

const message = await receipt.getChildToParentMessages(parentSigner);
const res = await message[0].execute(childProvider);
const executeReceipt = await res.wait();
console.log(`claim DKA L2 tx hash: ${executeReceipt.transactionHash}`)

Last updated