An erc20 token with EIP7503 (zkwormholes) style private transfers, and a new nullifier scheme to enable partial spends and reusable burn addresses.
More info in docs/notes.md
Try it out here: https://scrollzkwormholes.jimjim.dev/
https://sepolia.scrollscan.com/address/0x6A0e54612253d97Fd2c3dbb73BDdBAFfca531A9B
The code here in barely tested and has 3 inflation bugs.
These are: anyone can call setTrustedStorageRoot
and mint
.
Also EOA<->zkwormhole address collisions can be created.
More info in docs/notes.md
yarn install;
yarn install-submodules && yarn install-vite;
nargo
https://noir-lang.org/docs/getting_started/quick_start#noir
noirup -v 1.0.0-beta.1;
barretenberg
https://noir-lang.org/docs/getting_started/quick_start#proving-backend
bbup -v 0.66.0
yarn dev
yarn build
yarn hardhat vars set PRIVATE_KEY; #<=deployment key
yarn hardhat vars set SEPOLIA_SCROLL_ETHERSCAN_KEY;
yarn compile-contracts;
rm -fr ignition/deployments;
yarn hardhat run scripts/deploy.cjs --network scrollSepolia;
cp artifacts/contracts/Token.sol/Token.json website/abis/Token.json;
yarn hardhat ignition deploy ignition/modules/Token.cjs --network scrollSepolia --verify
you need to manually change the contract address:
ui: website/main.js at line 22
ui: scripts/proofAndRemint.js at line 213
(can be same as deployer)
yarn hardhat vars set RECIPIENT_PRIVATE_KEY;
yarn hardhat run scripts/proofAndRemint.js
cd circuits/remintProver;
nargo test;
cd circuits/storageRootProver;
nargo test;
yarn compile-circuits
forge inspect contracts/Token.sol:Token storage --pretty > contracts/storagelayouts/Token.txt