---
title: "Discussion on \"Auditing an AMM That Pays Swappers Tokens for Free\" | Hashnode"
description: "Discussion on \"Auditing an AMM That Pays Swappers Tokens for Free\". And every tenth swap paid out 1e18 tokens for free. Two bugs, one 489 line Uniswap fork."
url: "https://hashnode.com/posts/auditing-an-amm-that-pays-swappers-tokens-for-free/6b131bd2752798c146916a0e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Auditing an AMM That Pays Swappers Tokens for Free](https://blog.moayaan.com/auditing-an-amm-that-pays-swappers-tokens-for-free?utm_source=hashnode&utm_medium=feed)

And every tenth swap paid out 1e18 tokens for free. Two bugs, one 489 line Uniswap fork.

1d ago · 21 min read · blog.moayaan.com  
Read the article

-   [#smart-contracts](https://hashnode.com/tag/smart-contracts)
-   [#smart-contract-security-audit](https://hashnode.com/tag/smart-contract-security-audit)
-   [#ethereum](https://hashnode.com/tag/ethereum)
-   [#bugbounty](https://hashnode.com/tag/bugbounty)

## Written by

[Mohammad Ayaan Siddiqui](https://hashnode.com/@ayaaneth)

@ayaaneth · India

  
[View profile](https://hashnode.com/@ayaaneth)

moayaan.eth

Crypto &amp; AI MAXI

## Responses 1

Markdown supported · ⌘↵ to post

[Olivia](https://hashnode.com/@oliviacreates)

[1d ago](https://hashnode.com/posts/auditing-an-amm-that-pays-swappers-tokens-for-free/6b131bd2752798c146916a0e/comment/6b13255eb2385214c75120bc)

The part that stuck with me is that the invariant suite caught H-1 without asserting anything — just by forcing the two pricing functions onto the same screen, where one divides by 1000 and the other multiplies by 10000. That's a strong argument for writing the invariant tests before the manual review, like you said you'd do differently next time.
