MCPcopy Index your code
hub / github.com/Inco-fhevm/confidential-erc20-framework

github.com/Inco-fhevm/confidential-erc20-framework @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
93 symbols 259 edges 29 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Confidential ERC20 Framework

The confidential ERC20 Framework transforms ERC20 tokens into a confidential form that conceals balances and transaction amounts, with optional viewing and transfer rules to meet regulatory obligations or enhance programmatic risk management. While sender-receiver linkage remains, Confidential ERC20 balances privacy with risk management using an encryption-based approach, specifically fully homomorphic encryption (FHE), allowing operations on encrypted data without decryption.

This implementation is based on the collaborative research between Inco and Circle Research. For more information, see the whitepaper.

Note: This repository is not audited and is intended solely as a proof of concept.

Usage

Pre Requisites

Install pnpm

Before being able to run any command, you need to create a .env file and set a BIP-39 compatible mnemonic as an environment variable. You can follow the example in .env.example and start with the following command:

cp .env.example .env

If you don't already have a mnemonic, you can use this website to generate one.

Then, proceed with installing dependencies - please make sure to use Node v20 or more recent or this will fail:

pnpm install

For development on Rivest testnet

After installation run the pre-launch script to setup the environment:

sh pre-launch.sh

this generates the necessary precompile ABI files.

To deploy the contracts on the rivest network, run the following command:

pnpm deploy:contracts --network rivest

To run the tests on the rivest network, run the following command:

pnpm test:rivest

Resources

Extension points exported contracts — how you extend this code

Test (Interface)
(no doc) [1 implementers]
CustomProvider.ts
HardhatRuntimeEnvironment (Interface)
(no doc)
hardhat.env.d.ts
HttpNetworkUserConfig (Interface)
(no doc)
hardhat.config.types.ts
EvmState (Interface)
(no doc)
test/coprocessorUtils.ts
Signers (Interface)
(no doc)
test/signers.ts
Context (Interface)
(no doc)
test/types.ts
HttpNetworkConfig (Interface)
(no doc)
hardhat.config.types.ts
FhevmInstances (Interface)
(no doc)
test/types.ts

Core symbols most depended-on inside this repo

getClearText
called by 53
test/coprocessorUtils.ts
insertSQL
called by 29
test/coprocessorUtils.ts
appendType
called by 27
test/coprocessorUtils.ts
mustGetNumBitsType
called by 19
test/coprocessorUtils.ts
awaitCoprocessor
called by 9
test/coprocessorUtils.ts
checkEncryptedValue
called by 7
test/fhevmjsMocked.ts
getCiphertext
called by 7
test/instance.ts
getDecryptor
called by 7
test/instance.ts

Shape

Function 78
Interface 9
Class 2
Enum 2
Method 2

Languages

TypeScript100%

Modules by API surface

test/fhevmjsMocked.ts21 symbols
test/coprocessorUtils.ts20 symbols
test/instance.ts13 symbols
test/utils.ts9 symbols
test/asyncDecrypt.ts8 symbols
CustomProvider.ts5 symbols
test/signers.ts3 symbols
hardhat.config.types.ts3 symbols
test/types.ts2 symbols
test/ConfidentialWrapperTests/ConfidentialWrapper.fixture.ts1 symbols
test/ConfidentialERC20Tests/confidentialerc20.fixture.ts1 symbols
test/ComplianceTests/CompliantConfidentialERC.fixture.ts1 symbols

For agents

$ claude mcp add confidential-erc20-framework \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact