bitwrap 1.0
Write Petri net models in .btw, get validated Solidity smart contracts.
.btw DSL
./bitwrap -validate examples/erc20.btw parse examples/erc20.btw
schema ERC20 (3 states, 5 actions, 10 arcs)
solidity ERC20.sol (5023 bytes), tests (2125 bytes), genesis (1083 bytes)
compile ok
test 10 passed
deploy 0x5FbDB2315678afecb367f032d93F642f64180aa3
PASS
- Full syntax: registers, functions, guards, events, arcs, nested maps
map[address,address]uint256shorthand for nested mappings#and//comments--output dirsaves generated Foundry project- Human-readable errors: type mismatches, unknown identifiers, reserved names, duplicate declarations
Validated Pipeline
Every generated contract is proven to compile, deploy, and pass tests:
| Template | Forge Tests | On-Chain |
|---|---|---|
| ERC20 | 10/10 ✅ | 5/5 ✅ |
| ERC721 | 10/10 ✅ | 5/5 ✅ |
| ERC1155 | 12/12 ✅ | 7/7 ✅ |
| ERC4626 | 10/10 ✅ | 1/5 |
| ERC5725 | 10/10 ✅ | 4/6 |
| Vote | 6/6 ✅ | 2/3 |
Three-Way Execution Parity
Go runtime, JavaScript runtime, and generated Solidity produce identical state for the same inputs. Tested in CI.
Dev Wallet
Test the full poll flow without MetaMask:
./bitwrap -port 8088 -dev
# open http://localhost:8088/poll?dev-wallet10 anvil accounts available via /api/dev/sign for multi-signer testing.
CI Pipeline
5 parallel jobs: lint, build, test, js-parity, playwright (19 browser tests).
What's New Since v0.9.0
.btwDSL with nested map support (map[k1,k2]v)- DSL guardrails: type checking, reserved names, guard validation, arc validation
bitwrap -validatecommand with--outputflag#comment supportGenerateProduction()strips test backdoors- Go/JS/Solidity execution parity (arc weights, read-arc detection)
- Fix secp256k1 signature recovery for Go 1.25
- Built-in dev wallet with 10 anvil accounts
- 19 Playwright e2e tests in CI
- 4 example .btw files with syntax reference