tact-lang/dex-tolk — reverse-engineered prompt
Reverse engineered prompt
Build me an open source decentralized exchange for TON in Tolk, mainly as a clean reference project that shows how to build serious smart contracts in Tolk.
I want a constant product AMM, similar in behavior to Uniswap V2, with low transaction costs and only liquidity provider fees, no protocol fee for now. It should support Jetton based trading, adding and removing liquidity, normal swaps, exact output swaps, and routing through multiple pools. Please keep the design extensible so the asset model could later support more than just Jettons.
Use this as both a working Dex and a learning resource, so the code should be readable and follow safe patterns for Jetton handling and multi contract interactions. Include the core contracts plus tests that cover pools, liquidity flows, swap payloads, and liquidity payloads. Also add practical dev docs for how to swap and manage liquidity, and make sure the project builds, lints, and tests cleanly.
If anything is unclear, look up current TON and Tolk docs online and make sensible choices.
Want more depth? Deep Reverse