Skip to content
Back to skills

Eerc Deposit Withdraw

ASecurity

Use when the agent needs converter-mode eERC operations — deposit (wrap an existing ERC-20 into encrypted form) and withdraw (unwrap back to the public ERC-20). Converter-only operations.

  • 30 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 8, 2026
ai-agentsgo

Security analysis

A100/100

Scanned November 8, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill eerc-deposit-withdraw --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Eerc Deposit Withdraw?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Eerc Deposit Withdraw
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-eerc-deposit-withdraw/badge)](https://www.skillsdirectory.com/skills/majiayu000-eerc-deposit-withdraw)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: eerc-deposit-withdraw
description: Use when the agent needs converter-mode eERC operations — deposit (wrap an existing ERC-20 into encrypted form) and withdraw (unwrap back to the public ERC-20). Converter-only operations.
category: eERC
difficulty: Intermediate
version: "0.1.0"
---

# eERC — Deposit & Withdraw (Converter)

## Overview
In **converter mode** ([[eerc-deployment-modes]]), users move value between the public ERC-20 and its encrypted eERC form:
- **`deposit`** — wrap public ERC-20 → encrypted eERC (enter privacy).
- **`withdraw`** — unwrap eERC → public ERC-20 (exit privacy).

These replace mint/burn. They require the wrapped token's address.

## Deposit (wrap)
```ts
const balance = eerc.useEncryptedBalance(WRAPPED_TOKEN_ADDRESS);
const { deposit } = balance;

// 1) approve the EncryptedERC to pull the ERC-20 (standard ERC-20 approve)
await erc20.write.approve([EERC_ADDRESS, amount]);
// 2) deposit -> mints encrypted balance to the user
const { transactionHash } = await deposit(amount /* bigint, base units */);
await balance.refetchBalance();
```
Under the hood the SDK uses the token `decimals` and the deposit verifier; the public ERC-20 is transferred into the contract and an equivalent encrypted balance is credited.

## Withdraw (unwrap)
```ts
const { withdraw } = eerc.useEncryptedBalance(WRAPPED_TOKEN_ADDRESS);
const { transactionHash } = await withdraw(amount /* bigint, <= decryptedBalance */);
```
Generates a withdraw proof, debits the encrypted balance, and releases the public ERC-20 back to the user.

## Gas (C-Chain reference)
- `deposit` ≈ 0.56M gas avg, `withdraw` ≈ 0.80M gas avg.

## Common Pitfalls
- **No approval before deposit.** Standard ERC-20 `approve` is required first.
- **Missing `tokenAddress`.** Converter ops need the wrapped token address passed to `useEncryptedBalance`.
- **Using deposit/withdraw in standalone mode.** They revert; standalone uses `privateMint`/`privateBurn` ([[eerc-mint-burn]]).
- **Decimals mismatch.** `amount` is base units of the underlying ERC-20.

## AI Agent Prompt
> "Act as an eERC engineer. Implement converter flows: approve + `deposit` to wrap an ERC-20 into encrypted form, and `withdraw` to unwrap, refetching the decrypted balance after each."

## References
See `references/README.md` (ac-eerc-sdk `useEncryptedBalance.tsx` deposit/withdraw, `EERC.ts`, academy contracts flow).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.