ArchonArchon
Public verified reportRun your own audit

Archon public report

MantleMessageRegistry

Mantle Mainnet · scan depth full-report · generated 6/16/2026, 5:43:56 PM

Risk Score

39

Archon completed a read-only Mantle Mainnet audit of MantleMessageRegistry and found 6 deterministic findings. The highest-priority issue is Immutable States, with risk score 39/100 based on severity-weighted findings. The 'owner' state variable is immutable and can be set only once during contract deployment. Review the recommended fixes and run regression tests before deployment.

Models used: OpenAI (gpt-4o-mini), Tencent Cloud TokenHub (deepseek-v4-pro) — AI reasoning served on Tencent Cloud TokenHub.

Findings

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

Immutable States

The 'owner' state variable is immutable and can be set only once during contract deployment.

MantleMessageRegistry.sol:1850%
medium

Pack small storage variables into fewer slots

The contract has separate storage slots for the 'owner' address and 'nextMessageId' uint256 variable, which can lead to inefficient storage usage.

MantleMessageRegistry.sol:1870%
info

Mark never-changing value constant or immutable

The `owner` state variable is set once during contract deployment and never modified. Marking it `immutable` eliminates an `SLOAD` on every read, replacing it with a cheaper `PUSH` from bytecode.

MantleMessageRegistry.sol:1895%
info

Cache repeated storage read

The `hashExists[messageHash]` storage read is performed twice: first implicitly in the conditional check and possibly again later if the function continues. Caching the value in a local variable avoids a redundant `SLOAD`.

MantleMessageRegistry.sol:4990%
info

Cache repeated storage read

The `nextMessageId` storage variable is read multiple times (increment on line 55 and then used on line 56) but a single cached SLOAD could suffice, saving gas.

MantleMessageRegistry.sol:5690%
medium

Bitmap-pack boolean flags

The `hashExists` mapping stores individual booleans per `bytes32` key. Bitmap-packing multiple flags into a `mapping(bytes32 => uint256)` reduces SSTORE costs when multiple flags are written in the same storage slot.

MantleMessageRegistry.sol:2880%