[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"4pWll5xD1Z":3},"# Tamago🍳\n\nTamago is a standard smart contract suite for [Verity](https://veritylang.com), similar to solmate/solady for Solidity.\n\nTamago uses [Tama](https://tama.tools), a modern toolchain for secure-by-construction Ethereum applications.\n\nAll smart contracts in Tamago are **formally verified** via Lean, meaning they're mathematically proven to adhere to the specs. The specs are also double-checked via Foundry mirror tests.\n\nTamago claims the **first ever** formally verified EVM implementations of `sqrt()`, `cbrt()`, `log10()`, `log256()`, as well as the full `ERC4626` standard.\n\n## Components\n\n- `Ownable`: single-owner authorization with ownership transfer and\n  renunciation.\n- `ERC20`: fungible token with allowances, owner-controlled minting and\n  burning, fixed 18-decimal metadata, and overflow-safe accounting.\n- `ERC721`: non-fungible token with ownership, approvals, operator approvals,\n  minting, and transfer behavior.\n- `WETH`: wrapped ETH with ERC20-compatible accounting, deposits, withdrawals,\n  approvals, and transfers.\n- `ERC4626`: tokenized vault accounting with share/asset conversion previews,\n  deposits, minting, withdrawals, redemptions, and ERC20 share behavior.\n- `FixedPointMathLib`: reusable unsigned integer math helpers, including\n  saturating arithmetic, distance, averages, roots, logs, and clamping.\n\nEach component has a Verity implementation, a property spec, a Lean proof file,\nand mirror tests that connect the proved properties to generated EVM artifacts.\n\n## Install\n\nFrom a Tama project, add Tamago as a package dependency:\n\n```sh\ntama install Bacon-labs/tamago\n```\n\nPin a specific revision for reproducible builds:\n\n```sh\ntama install Bacon-labs/tamago@\u003Cgit-revision>\n```\n\nThen refresh and verify the project:\n\n```sh\ntama doctor\ntama check\ntama build --locked\ntama test\n```\n\n## Usage\n\nImport the source bundle from Lean:\n\n```lean\nimport Tamago\n```\n\nOr import only the components you need:\n\n```lean\nimport Tamago.Auth.Ownable\nimport Tamago.Tokens.ERC20\nimport Tamago.Tokens.ERC721\nimport Tamago.Tokens.WETH\nimport Tamago.Tokens.ERC4626\nimport Tamago.Utils.FixedPointMathLib\n```\n\nReference a component's compilation model from your own Verity code or build\nconfiguration:\n\n```lean\n#check Tamago.Auth.Ownable.spec\n#check Tamago.Tokens.ERC20.spec\n#check Tamago.Tokens.ERC721.spec\n#check Tamago.Tokens.WETH.spec\n#check Tamago.Tokens.ERC4626.spec\n#check Tamago.Utils.FixedPointMathLib.spec\n```\n\nUse the generated Solidity deployers from Foundry tests after `tama build`:\n\n```solidity\nimport {ERC20Deployer} from \"tamago/src/generated/verity/ERC20Deployer.sol\";\nimport {ERC20Iface} from \"tamago/src/generated/verity/ERC20Iface.sol\";\n\ncontract ExampleTest {\n    function deployToken(address owner) internal returns (ERC20Iface token) {\n        token = ERC20Deployer.deploy(owner);\n    }\n}\n```\n\nThe same pattern applies to the other generated deployers and interfaces:\n`Ownable`, `ERC721`, `WETH`, `ERC4626`, and `FixedPointMathLib`.\n\n## Repository Layout\n\n```text\n.\n|-- verity/\n|   |-- src/\n|   |   |-- Tamago.lean                  # Source aggregate module\n|   |   `-- Tamago/                      # Contract and library implementations\n|   |-- spec/\n|   |   `-- Tamago/\n|   |       |-- Spec.lean                # Spec aggregate module\n|   |       `-- Spec/                    # Property specs\n|   |-- proof/\n|   |   `-- Tamago/\n|   |       |-- Proof.lean               # Proof aggregate module\n|   |       `-- Proof/                   # Proofs for the specs\n|   `-- common/\n|       `-- Tamago/Common/               # Shared events and helper models\n|-- src/generated/verity/                # Generated Solidity deployers and interfaces\n`-- test/verity/                         # Foundry mirror tests with tama: property links\n```\n\n## Development\n\nFor local development on Tamago itself, clone with submodules:\n\n```sh\ngit clone --recurse-submodules git@github.com:Bacon-labs/tamago.git\ncd tamago\n```\n\nFor an existing checkout:\n\n```sh\ngit submodule update --init --recursive\n```\n\nRun the standard verification workflow:\n\n```sh\ntama doctor\ntama build --locked\ntama test\ntama audit\n```\n\nThe CI workflow in `.github/workflows/ci.yml` runs the same checks on pushes to\n`main` and on pull requests.\n\n## License\n\nTamago is released under the MIT License. See [LICENSE](LICENSE).\n",1780241997513]