Facilitation of rollup transactions with basic zk-rollups by gnark.
First bind local path, so that docker container has the repo to work with the files.
docker run -v .\:/sources ethereum/solc:stable -o /sources/bindings --abi --bin /sources/contracts/Rollup.sol --overwrite
Move the abi
and .bin
files to bindings/
and then to create the contract binding:
abigen --abi .\bindings\Rollup.abi --pkg main --type Rollup --out .\src\Rollup.go
To then inject the contract binding Verifier.go
for deployment:
abigen --abi .\bindings\Rollup.abi --pkg main --type Rollup --out .\src\Rollup.go --bin .\bindings\Rollup.bin
docker run -v ${PWD}:/sources ethereum/solc:stable --combined-json abi,bin,bin-runtime /sources/contracts/Rollup.sol -o /sources/bindings/RollupCombined.json
abigen --abi .\bindings\Rollup.abi --pkg main --type Rollup --out .\src\Rollup.go
abigen --combined-json ./bindings/RollupCombined.json/combined.json --pkg main --type Rollup --out ./src/Rollup.go
C:\Users\docla\go\pkg\mod\github.com\ethereum\g[email protected]\cmd\abigen
Deploy all contracts from scratch
truffle migrate --reset
go run .\src\.
.sol
files should be UTF-8, not UTF-8 with BOM!
The automaticly created gnark_verifier.sol
comes with some issues:
- the
error
keyword was introduced in solidity v0.8.4 thereforepragma solidity ^0.8.4;
is needed - memory-safe keyword does not exist for the
assembly
instructions, i.e., it needs to be removed