Skip to content

audit/H01: hardcoded LOG_TABLES_ADDRESS mismatches deployed Zoltu address #189

@thedavidmeister

Description

@thedavidmeister

Audit reference

Protofire, March 2026, finding H01 — Mismatched Log-Table Addresses Leads to Silent Numeric Corruption. Severity: High. Status at audit (19a65ffa): New.

What

LibDecimalFloat.LOG_TABLES_ADDRESS is hardcoded to 0x6421E8a23cdEe2E6E579b2cDebc8C2A514843593 (src/lib/LibDecimalFloat.sol:50). The deployment script targets a different address: ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS = 0xc51a14251b0dcF0ae24A96b7153991378938f5F5 (src/lib/deploy/LibDecimalFloatDeploy.sol:18).

pow10, log10, pow, sqrt all extcodecopy from the hardcoded 0x6421... address. That address has no deployed code on any of the supported networks (Arbitrum, Base, Base Sepolia, Flare, Polygon). EVM extcodecopy on an address with no code copies zeros into memory and does NOT revert.

Impact

Every transcendental call against the production DecimalFloat contract returns garbage: log/exp lookups operate on a zeroed table. Silent — no revert, no event, just wrong numbers.

Recommendation

Remove the hardcoded 0x6421... constant in LibDecimalFloat.sol. Either:

  1. Re-export the deployed address from LibDecimalFloatDeploy and use that single source of truth, or
  2. Refactor the concrete contract to take the table address as a constructor argument.

After fixing, redeploy and update LibDecimalFloatDeploy constants per the existing release process.

Verification

Add a fork test that calls log10/pow10/sqrt/pow against the deployed DecimalFloat on a real chain and asserts the result matches the off-chain LibDecimalFloatSlow reference. The test must fail before the fix and pass after.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions