For more information on the EVM protocol adapter, find the related
Warning
This repo features a prototype and is work in progress. Do NOT use in production.
.
├── bindings
├── contracts
├── LICENSE
└── README.mdThe contracts folder contains the contracts written in Solidity contracts as well
as Foundry forge tests and deploy scripts.
The bindings folder contains bindings in Rust to
convert Rust and RISC Zero types into EVM types using the
alloy-rs library.
-
Get an up-to-date version of Rust with
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Clone this repo
Change the directory to the contracts folder with cd contracts and run
forge installBuild the contracts with following flags: //TODO! confirm this is needed
forge build --astRun
forge testAs a pre-requisite, install solhint with
bun install solhintor
bun install solhintand slither
via
python3 -m pip install slither-analyzerRun the linter and analysis with
bunx --bun solhint --config .solhint.json 'src/**/*.sol' && \
bunx --bun solhint --config .solhint.other.json 'script/**/*.sol' 'test/**/*.sol' && \
slither .or
npx solhint --config .solhint.json 'src/**/*.sol' && \
npx solhint --config .solhint.other.json 'script/**/*.sol' 'test/**/*.sol' && \
slither .To simulate deployment on sepolia, run
forge script script/DeployProtocolAdapter.s.sol:DeployProtocolAdapter --rpc-url sepoliaAppend the
--broadcastflag to deploy on sepolia--verify --slowflags for subsequent contract verification on Etherscan (--slowadds 15 seconds of waiting time between verification attempts)--account <ACCOUNT_NAME>flag to use a previously imported keystore (seecast wallet --helpfor more info)
For post-deployment verification on Etherscan run
forge verify-contract \
<ADDRESS> \
src/ProtocolAdapter.sol:ProtocolAdapter \
--chain sepolia \
--constructor-args-path script/constructor-args.txtafter replacing <ADDRESS> with the respective contract address.
Parameters:
- Commitment accumulator
treeDepth = 32
Change the directory to the bindings folder with cd bindings and run
-
Install
rzupby running the following command:curl -L https://risczero.com/install | bash -
Run
rzupto install RISC Zero:rzup install
-
Go to the
bindingsdirectory withcd bindingsand runcargo build
Print a test transaction with
cargo test -- conversion::tests::print_tx --exact --show-output --ignored
