# DKA Deposit

The **d**eposit process refers to transferring ERC-20 DKA from Arbitrum Chain (L2) to dKargo Chain (L3).

This process is executed in multiple steps through the collaboration of the [bridge contract](https://sepolia.arbiscan.io/address/0xC7e932238A2d9fccFa33FF5e8Deed966F0460Ea7) deployed on Arbitrum and the dKargo sequencer.

## STEP 1 - Approve L2 ERC-20 DKA

Before transferring ERC-20 DKA from L2 to L3, the Inbox Contract must be granted approval to access the user's DKA tokens.

```jsx
const depositAmount = parseEther('1');
const res = await dkaBridge.approveGasToken({
  parentSigner,
  amount:depositAmount
});
const receipt = await res.wait();
console.log(`approve DKA token to Inbox Contract tx hash: ${receipt.transactionHash}`)

const allowance = await dkaBridge.allowanceGasTokenToInbox(
  parentSigner.address,
  parentProvider
);

console.log(`allowance amount: ${allowance}`
```

{% hint style="info" %}
If <mark style="color:blue;">`null`</mark>is entered instead of <mark style="color:blue;">`depositAmount`</mark>, the maximum available amount will be approved.

Normally, an approval is required each time a deposit is made through the bridge. However, by setting it this way, a one-time approval is sufficient, eliminating the need for additional approvals in future transactions.
{% endhint %}

## STEP 2 - Depositing DKA

Once approval is complete, the <mark style="color:blue;">`depositEth()`</mark> method of the Inbox Contract is called to initiate the deposit.

The Inbox Contract transfers the L2 DKA to the bridge contract..

```jsx
const res = await dkaBridge.deposit({
  parentSigner,
  amount: depositAmount,
});
const receipt = await res.wait();
console.log(`deposit DKA L2 tx hash: ${receipt.transactionHash}`)
```

The deposited DKA is then locked in the bridge contract deployed on Arbitrum.

## STEP 3 - Checking Deposit Status

Transferring **L2 DKA** to the bridge contract does not result in an **immediate deposit** on **L3**.

The **deposit status** will initially be marked as **"Pending"**. After approximately **10 minutes**, the **DKA balance** will be **finalized and transferred** to the user's account on **dKargo Chain (L3)**.

```jsx
// Wait until the message is executed on the dKargo chain.
await receipt.waitForChildTransactionReceipt(childProvider);
```
