Skip to content
Back to skills

Eerc Architecture Contracts

ASecurity

Use when the agent needs the on-chain contract architecture of eERC — EncryptedERC, Registrar, EncryptedUserBalances, TokenTracker, AuditorManager, and the ZK verifiers — and how they interact. Reference this when reading, extending, or auditing the contracts.

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

Security analysis

A100/100

Scanned November 8, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill eerc-architecture-contracts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Eerc Architecture Contracts?

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

Security grade badge for Eerc Architecture Contracts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-eerc-architecture-contracts/badge)](https://www.skillsdirectory.com/skills/majiayu000-eerc-architecture-contracts)

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-architecture-contracts
description: Use when the agent needs the on-chain contract architecture of eERC — EncryptedERC, Registrar, EncryptedUserBalances, TokenTracker, AuditorManager, and the ZK verifiers — and how they interact. Reference this when reading, extending, or auditing the contracts.
category: eERC
difficulty: Advanced
version: "0.1.0"
---

# eERC — Contract Architecture

## Overview
The eERC protocol is a small set of cooperating contracts. The main `EncryptedERC` orchestrates private operations and delegates registration, balance storage, auditing, and proof verification.

## Core contracts (`EncryptedERC/contracts/`)
- **`EncryptedERC.sol`** — the main contract. Implements private `privateMint`, `privateBurn`, `transfer`, `deposit`, `withdraw`; verifies ZK proofs; manages encrypted balances and auditor integration. Holds `name`, `symbol`, `decimals`, `isConverter`, `registrar`, `auditor`, `auditorPublicKey`.
- **`Registrar.sol`** — user registration + public key association. `register(proof)` stores a user's BabyJubJub public key; `getUserPublicKey(addr)` returns it (zero point = not registered).
- **`EncryptedUserBalances.sol`** — encrypted balance storage and homomorphic updates (the ElGamal ciphertext `EGCT` + amount PCTs + balance PCT).
- **`tokens/TokenTracker.sol`** — tracks registered tokens (converter mode), metadata, and blacklisting.
- **`auditor/AuditorManager.sol`** — auditor address + public key; permissions for selective decryption.
- **`types/Types.sol`** — shared structs (proofs, ciphertext points, PCTs).
- **`libraries/BabyJubJub.sol`** — curve operations (deployed as a linked library).

## Verifiers (`contracts/verifiers/` and `contracts/prod/`)
Five Groth16 verifiers, one per circuit:
`RegistrationCircuitGroth16Verifier`, `MintCircuitGroth16Verifier`, `TransferCircuitGroth16Verifier`, `WithdrawCircuitGroth16Verifier`, `BurnCircuitGroth16Verifier`.
`contracts/prod/*` are the production verifiers (proper trusted setup) — use these for mainnet ([[eerc-circuits-proofs]]).

## Interaction flow
```mermaid
flowchart TD
  SDK -->|register proof| Registrar
  SDK -->|op + proof| EERC[EncryptedERC]
  EERC -->|verify| Verifiers[Groth16 Verifiers]
  EERC -->|update ciphertext| Balances[EncryptedUserBalances]
  EERC -->|auditor PCT| Auditor[AuditorManager]
  EERC -->|wrapped token| TokenTracker
```

## Key reads (used by the SDK)
`name()`, `symbol()`, `decimals()`, `registrar()`, `isConverter()`, `owner()`, `auditor()`, `auditorPublicKey()`, `balanceOf(user, tokenId)`, `getBalanceFromTokenAddress(user, token)`.

## Common Pitfalls
- **Forgetting to link BabyJubJub.** `EncryptedERC` must be deployed with the `BabyJubJub` library linked (see deploy scripts).
- **Wrong verifier set.** Mint/transfer/withdraw/burn/registration verifiers are distinct; mismatched verifiers reject valid proofs.

## AI Agent Prompt
> "Act as a Solidity auditor. Walk through the eERC contract suite (EncryptedERC, Registrar, EncryptedUserBalances, AuditorManager, TokenTracker, verifiers) and explain the call flow for a private transfer."

## References
See `references/README.md` (EncryptedERC `contracts/` + README architecture section).

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.