Microchain · Smart Contract Security AssessmentMicrochain Client Hub

Microchain DEX (Mira Binned Liquidity)

Zealynx co-audited Microchain's Mira Binned Liquidity AMM on Fuel alongside Codespect and Braniac, coordinated through Immunefi. Over 15 days the team reviewed the binned-liquidity contracts covering mint, burn, swap, fee collection, and LP token handling, identifying 10 issues including 2 High (LP token tainting and protocol-fee reserves accounting), 4 Medium, 3 Low, and 1 Informational. 9 issues were fixed; the LFJ V2 share calculation finding was acknowledged.

FuelSwaySmart Contract Code Review2025-09-17github.com/mira-amm/mira-binned-liquidityZealynx methodology
Total findings
10
9 fixed · 1 acknowledged
Critical
00
High
02
Medium
04
Low + Info
04
02

Scope

5 files
Repository
Initial commit
8800f00c7a8f
Platform
Fuel · Sway
Methodology
File
libraries/burn_utils/src/lib.sw
libraries/mint_utils/src/lib.sw
libraries/swap_utils/src/lib.sw
libraries/bin_helper/src/lib.sw
main contract
03

Findings

click any row for the full write-up
04

Key Findings

  • LP token tainting via empty pool reserves check (IMM-HIGH-01). The guard against burning LP tokens that are part of pool reserves checks contract_reserves for None, but a pool that once held an LP token and has since been emptied returns a non-None value. A malicious user can deposit an LP token into a pool, withdraw it, and the token becomes permanently unredeemable while still appearing valid for transfer or sale on third-party systems.

  • Incorrect reserves accounting on protocol fee collection (IMM-HIGH-02). When collect_protocol_fees(...) is called, the collected amount is not deducted from contract_reserves. Subsequent LPs and swappers experience direct losses proportional to the fees collected, since the accounting difference is silently absorbed into their input amounts. Larger fee collections produce larger losses for the next interacting user.

  • Reduced shares for active-bin LPs (IMM-MED-01). Minting liquidity to an active bin uses bin_reserves topped up with non-protocol fees in the share calculation, overestimating bin liquidity and producing reduced shares for the LP. The behaviour follows the LFJ V2 formula but materially diminishes LP value, which is why the team acknowledged rather than fixed it.

  • Functionality vs spec mismatch in burn_liquidity() (IMM-MED-03). The comment spec claims LP tokens from different pools can be burned in a single call, but the implementation locks required_pool_id from the first asset and reverts on any mismatch. Integrators sending mixed LP tokens into the curve state can be frontrun, with attackers burning the residual shares.

05

Team & approval

Co-Auditor
Zealynx Security
Co-Auditor
CODESPECT
Co-Auditor
Braniac
06

Disclaimer

This audit is not an endorsement and does not constitute investment advice. Zealynx reviewed the codebase at the commits listed in section 02 over the engagement window. Findings are limited to issues identified within that scope and do not preclude the existence of other vulnerabilities. Subsequent code changes are not covered by this report unless the engagement is explicitly extended.

Download PDF (24p)
ZEALYNX SECURITY · published 2025-09-17
10 findings · Sway

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx