Example output: jetton-minter.tolk. The converted contract does not use modern Tolk features such as structures, auto-serialization, or clean message composition. After some manual fixes, it compiles, runs, and passes tests. If a contract does not compile after conversion, refer to the GitHub repository. It contains common issues and provides ways to fix them.
Refactoring
- Use the modern
onInternalMessage. - Extract a
Storagestruct withtoCellandfromCell. - Refactor incoming messages into structs with 32-bit opcodes – incrementally, one message at a time.
- Define a union of possible messages and match it using
lazy. - Extract outgoing messages into structs and send them.
Maintain tests at every stageKeeping tests passing throughout the refactoring process ensures safe, incremental modernization without breaking functionality.