# DKA 입금

입금(Deposit)은 아비트럼 체인(L2)에 보유 중인 ERC-20 DKA를 디카르고 체인(L3)으로 전송하는 과정을 의미합니다.

이 과정은 아비트럼에 배포된 [bridge 컨트랙트](https://sepolia.arbiscan.io/address/0xC7e932238A2d9fccFa33FF5e8Deed966F0460Ea7)와 디카르고 시퀀서의 협력을 통해 단계별로 수행됩니다.

## STEP 1 - L2 ERC-20 DKA 승인

L2에 보유 중인 ERC-20 DKA를 디카르고 체인으로 전송하려면, 먼저 인박스 (Inbox)컨트랙트가 사용자의 DKA 토큰에 접근할 수 있는 승인 작업이 필요합니다.

```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" %}
파라미터에 <mark style="color:blue;">`depositAmount`</mark> 대신 <mark style="color:blue;">`null`</mark>을 입력하면, 최대 가능한 수량을 승인하게 됩니다.&#x20;

브리지를 사용할 때마다 매번 입금 금액을 개별적으로 승인해야 하지만, 이렇게 설정하면 최초 한 번만 승인하면 되고 이후에는 추가 승인이 필요 없습니다.
{% endhint %}

## STEP 2 - DKA 입금

승인이 완료되면, 인박스 컨트랙트의 <mark style="color:blue;">`depositEth()`</mark> 메서드를 호출하여 입금을 진행합니다.&#x20;

인박스는 사용자의 L2 DKA를 브릿지 컨트랙트로 전송합니다.

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

입금된 DKA은 아비트럼에 배포된 브릿지 컨트랙트에 보관되며, 해당 자산은 잠기게(lock) 됩니다.

## STEP 3 - 입금 상태

브릿지 컨트랙트로 L2 DKA를 전송했다고 해서 L3에 DKA가 즉시 입금되지는 않습니다.&#x20;

입금 상태는 "대기"로 표시되며, 약 10분의 시간이 지난 후 최종적으로 디카르고 체인 계정으로 잔액이 전송됩니다.

```jsx
// 메시지가 디카르고 체인에서 호출될 때 까지 대기합니다.
await receipt.waitForChildTransactionReceipt(childProvider);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dkargo.io/dka/dka-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
