Smart Contract Interface Generator for Ethereum Developers
Automatically generates type-safe Go bindings, event topics, method selectors, and documentation from smart contract ABIs. Designed for Foundry/Go Ethereum projects to prevent signature mismatches and accelerate development.
Key features:
- 🎯 Event topic hashes with full signatures
- 🔑 Method selectors with ABI encoding
- 📘 CLI-friendly lowercase method names
- 📖 Auto-generated contract documentation
- 🔄 Initialization helpers for Go code
- Event Topic Generation - Precise keccak256 hashes for all events
- Method Selectors - Pre-computed 4-byte signatures with full function signatures
- Multi-Contract Support - Processes all sub folders that contain an ABI
- Documentation Generation - Creates
_help.mdwith event/view details - Type Safety - Generates Go structs with proper types
- Version Control - Maintains consistency across contract versions
- abigen Go Ethereum
- jq jqlang
- cast Foundry
- Go 1.20+ Go
brew install jq go-ethereum foundry- Copy
abisiggen.shto your project. - Copy your contract ABIs to
pkg/contracts/[ContractName]/[Contract].abi
Tip
You can edit the CONTRACT_SOURCES_DIR:
# Find all directories in the contract sources directory
# you can edit this to hardcode the contracts you want to process
PROJECT_ROOT="$(dirname "$(dirname "$(realpath "$0")")")"
CONTRACT_SOURCES_DIR="$PROJECT_ROOT/pkg/contracts"Follow this structure, or ensure
PROJECT_ROOTis set correctly:
.sh/
├── abisiggen.sh # Main generator script
└── pkg/contracts/
└── [ContractName]/
└── [Contract].abi # Contract ABIchmod +x sh/abisiggen.sh./sh/abisiggen.sh.sh/
├── abisiggen.sh # Main generator script
└── pkg/contracts/
└── [ContractName]/
├── [Contract].abi # Contract ABI
├── [Contract].go # Go bindings (abigen)
├── [Contract]_extra.go # Generated topics/methods
└── [Contract]_help.md # Generated documentationExample console:
See the generated output for Sablier contract in example
sh .sh/abisiggen.sh
Processing SablierV2LockupLinear with abigen
✓ Generated SablierV2LockupLinear bindings
✓ Generated SablierV2LockupLinear_extra.go
Created SablierV2LockupLinear_help.md
Processing SablierV2LockupDynamic with abigen
✓ Generated SablierV2LockupDynamic bindings
✓ Generated SablierV2LockupDynamic_extra.go
Created SablierV2LockupDynamic_help.md