ArchonArchon
Public verified reportRun your own audit

Archon public report

MantleMilestoneRegistry

Mantle Mainnet · scan depth quick · generated 6/16/2026, 6:03:12 PM

Risk Score

24

Archon completed a read-only Mantle Mainnet audit of MantleMilestoneRegistry and found 3 deterministic findings. The highest-priority issue is Cache repeated storage read, with risk score 24/100 based on severity-weighted findings. The `hashExists` mapping is read on line 57 to check whether a milestone hash is already registered. The value could be stored in a local variable if it is reused later in the function, but no additional reads are shown. The optimizer flag suggests caching this SLOAD, though the current snippet does not demonstrate a repeated read benefit. If the function were longer and again referenced `hashExists[milestoneHash]`, caching would save gas. Review the recommended fixes and run regression tests before deployment.

Models used: Tencent Cloud TokenHub (deepseek-v4-pro) — AI reasoning served on Tencent Cloud TokenHub.

Findings

low: 0high: 0info: 2medium: 1critical: 0
SeverityFindingLocationConfidence
info

Cache repeated storage read

The `hashExists` mapping is read on line 57 to check whether a milestone hash is already registered. The value could be stored in a local variable if it is reused later in the function, but no additional reads are shown. The optimizer flag suggests caching this SLOAD, though the current snippet does not demonstrate a repeated read benefit. If the function were longer and again referenced `hashExists[milestoneHash]`, caching would save gas.

MantleMilestoneRegistry.sol:5720%
info

Cache repeated storage read

The `milestoneId` state variable is read on line 62 via `nextMilestoneId++`. The post-increment uses the old value after reading. On line 64, `milestones[milestoneId]` re-reads the updated storage slot (`nextMilestoneId` was written). Caching the pre-increment value can avoid a second SLOAD.

MantleMilestoneRegistry.sol:6460%
medium

Bitmap-pack boolean flags

The `hashExists` mapping uses a `bool` value per entry. Each mapping slot occupies a full 32-byte storage slot even though a boolean only needs a single bit. By packing multiple flags into a single `uint256` using bitwise operations or by using a bitmap with `mapping(bytes32 => uint256)`, the contract can store up to 256 flags per slot, significantly reducing storage costs on Mantle.

MantleMilestoneRegistry.sol:2890%