vyper Agent Skills & AI Rules

GitHub

Pythonic Smart Contract Language for the EVM

5,174 stars Python Python 1 file ยท ~28,371 tokens #ethereum#ethereum-dapp#language#python#vyper
RAW Rules
7 Discovered Rules โ€ข ~5,360 Estimated Tokens
Quick:
Loading skill content...

Skills Skill

skills/codegen.md anthropic-skill ~290 tokens
Raw
# Code Generation

## Experimental Pipeline: Direct-to-Venom

AST โ†’ `vyper/codegen_venom/` โ†’ Venom IR โ†’ optimization passes โ†’ assembly โ†’ bytecode.

### `vyper/codegen_venom/`

Translates annotated Vyper AST directly to Venom SSA IR.

- `module.py` โ€” entry point, module-level codegen
- `expr.py` โ€” expression translation
- `stmt.py` โ€” statement translation
- `arithmetic.py` โ€” numeric operations
- `builtins/` โ€” built-in function codegen
- `abi/` โ€” ABI encoding/decoding
- `context.py` โ€” codegen context (variable tracking, etc.)

### Venom โ†’ Assembly

After Venom IR is constructed, `vyper/venom/` runs optimization passes then
`venom/venom_to_assembly.py` emits EVM assembly. The assembler in `vyper/evm/assembler/`
produces final bytecode.

## Default Production Pipeline: Legacy IR

AST โ†’ `vyper/codegen/` โ†’ s-expression IR (`IRnode`) โ†’ `vyper/ir/compile_ir.py` โ†’ assembly โ†’ bytecode.

This is the current default. See [vyper/ir/README.md](../vyper/ir/README.md) for IR grammar and structure.

Key difference: legacy IR is tree-shaped s-expressions, Venom is SSA basic blocks.