# How to make USDC deposit

**URL:** <https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593>\
**Category:** Developers\
**Tags:** Discussing\
**Created:** [September 27, 2024, 10:46am UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593 "2024-09-27T10:46:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AliSci](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alisci/32/33799_2.png) [@AliSci](https://forum.dfinity.org/u/AliSci)\
**Post date:** [September 27, 2024, 10:46am UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/1 "2024-09-27T10:46:39Z")

</div>

How to make USDC transactions on icp ?

i made this [https://codesandbox.io/p/sandbox/holy-microservice-37khqy](https://codesandbox.io/p/sandbox/holy-microservice-37khqy)  
Trying to use ercEath canister

Can anyone help build ling the minimal code

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [September 27, 2024, 11:35am UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/2 "2024-09-27T11:35:07Z")

</div>

In the title you ask about _USDC deposits_. I assume you want to deposit USDC so that you get ckUSDC, correct? In that case, you can follow the instructions [here](https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/docs/ckerc20.adoc).

If you want to make _ckUSDC transactions_, you simply interact with the [ckUSDC ledger](https://dashboard.internetcomputer.org/canister/xevnm-gaaaa-aaaar-qafnq-cai), using the standard [ICRC-1](https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/README.md) and [ICRC-2](https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md) endpoints.

---

<div class="post-metadata">

**Author:** ![AliSci](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alisci/32/33799_2.png) [@AliSci](https://forum.dfinity.org/u/AliSci)\
**Post date:** [September 28, 2024, 3:51am UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/3 "2024-09-28T03:51:11Z")

</div>

I know this [here](https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/docs/ckerc20.adoc) but how to use it? I have no idea what does it says? I already read it but can’t make a code out of it. can you help me do it from the sandbox.

---

<div class="post-metadata">

**Author:** ![dantol29](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dantol29/32/20601_2.png) [@dantol29](https://forum.dfinity.org/u/dantol29)\
**Post date:** [September 29, 2024, 7:40am UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/4 "2024-09-29T07:40:01Z")

</div>

You have to call smart contract twice - approve and deposit methods.

1. Create smart contract data

```rust
let method_selector = "0x095ea7b3"; // approve(address spender,uint256 value)
let helper_contract = erc20_helper_contract_address; // smart contract address
// -----method params------
let encoded_contract = helper_contract; // bytes32 format
let encoded_value = 10; // bytes32 format
// ---------------------------
let encoded_data = format!("{}{}{}", method_selector, encoded_contract, encoded_value);

```

1. Create transaction data

```auto
let transaction = TxEip1559 {
        chain_id,
        nonce,
        gas_limit,
        max_fee_per_gas,
        max_priority_fee_per_gas,
        to: TxKind::Call(erc20_contract),
        value: 10,
        access_list: Default::default(),
        input: hex::decode(&encoded_data[2..]) // pass smart contract data
            .map_err(|e| format!("Invalid input data: {}", e))?.into(),
    };

```

1. Sign transaction with ECDSA and send it with EVM RPC 😁

In case you wanna get ckUSDC you can use Plug Wallet. They recently integrated all ERC-20 and BTC. There is a chance that their canister code gonna be open-source 😉

---

<div class="post-metadata">

**Author:** ![AliSci](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alisci/32/33799_2.png) [@AliSci](https://forum.dfinity.org/u/AliSci)\
**Post date:** [September 29, 2024, 8:11am UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/5 "2024-09-29T08:11:40Z")

</div>

I think i have to

```tsx
const actor = Actor.createActor(idlFactory, {
  agent: new HttpAgent({
    identity,
  }),
  canisterId,
});

```

but where the idlFactory come from ?

---

<div class="post-metadata">

**Author:** ![AliSci](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/alisci/32/33799_2.png) [@AliSci](https://forum.dfinity.org/u/AliSci)\
**Post date:** [September 29, 2024, 10:23am UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/6 "2024-09-29T10:23:44Z")

</div>

Can you write it in the sandbox because I understand no words of what you said. I am total new to this.

---

<div class="post-metadata">

**Author:** ![dantol29](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dantol29/32/20601_2.png) [@dantol29](https://forum.dfinity.org/u/dantol29)\
**Post date:** [September 29, 2024, 1:49pm UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/7 "2024-09-29T13:49:11Z")

</div>

I would suggest you to spend some time on researching ERC-20 and ckERC-20 tokens. It’s hard to explain everything from scratch

---

<div class="post-metadata">

**Author:** ![ICPSwap](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpswap/32/11193_2.png) [@ICPSwap](https://forum.dfinity.org/u/ICPSwap)\
**Post date:** [September 29, 2024, 3:35pm UTC](https://forum.dfinity.org/t/how-to-make-usdc-deposit/35593/8 "2024-09-29T15:35:27Z")

</div>

Hi sir.

If you’re just looking to deposit USDC and receive ckUSDC, you might be interested in ICPSwap’s ck-bridge feature. You can check it out here:

> **[ICPSwap - ICP](https://app.icpswap.com/ck-bridge)**
>
> The Hub of Future Decentralized Finance on Internet Computer

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/1/b/1bb6b69b7caee4f46fc3c3d7177dd14907fc5bd7.jpeg)
