Skip to content

zama-ai/fhevm-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fhEVM Workshop

Welcome to this workshop on building an encrypted ERC20 token!

See more of our examples at https://dapps.zama.ai.

Getting started

Install Zama Devnet in MetaMask:

Encrypted ERC20

Set env variable WORKSHOP_PRIVATE_KEY to private key that was used to deploy the contract (as copied from MetaMask, i.e. without 0x prefix):

export WORKSHOP_PRIVATE_KEY=<private key>

When a contract have been deployed to the devnet, the Python files can be used to interact with it by set env variable CONTRACT to the address (as copied from Remix) and saving the ABI to abi.json.

Nodejs with fhevmjs

Go in fhevmjs directory and npm install. Be sure you set WORKSHOP_PRIVATE_KEY and CONTRACT

Mint new tokens:

CONTRACT=<address> npm run mint 100

Get your current balance:

CONTRACT=<address> npm run balanceOf

Make a transfer:

CONTRACT=<address> npm run transfer 0x56c836D1d7c9f64b9654B433dCa16f1014429DC5 100

Python

Use Python3.10 or earlier:

python3.10 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt

For now we also need to installed the fhEVM cli:

git clone https://github.com/zama-ai/fhevm-tfhe-cli
cd fhevm-tfhe-cli
cargo install --path .

Mint new tokens:

python mint.py --amount 100 --contract <address>

Get your current balance:

python get_balance.py --contract <address>

Make a transfer:

python transfer.py --amount 5 --to <address> --contract <address>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published