57931 sc insight consumes more gas than intended in getstandardizedprice function in helper library
Submitted on Oct 29th 2025 at 14:03:36 UTC by @iehnnkta for Audit Comp | Belong
Report ID: #57931
Report Type: Smart Contract
Report severity: Insight
Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/utils/Helper.sol
Impacts: (not specified in the original report)
Description
getStandardPrice uses standardize, which internally calls _standardise (or _standardize) where the actual operation happens. The extra indirection through the public standardize mediator function causes slightly higher gas usage. While this is a small overhead, the protocol is intended to be deployed on Ethereum mainnet where gas costs are significant.
A gas composition comparison is provided in the Proof of Concept section.
Vulnerability Details
The gas overhead arises because
getStandardizedPriceis calling a public functionstandardizewhich in turn calls the internal/private_standardizefunction, instead of calling the internal function directly.This indirection results in a small but measurable increase in gas consumption for the operation.
Reference location in the target repository: https://github.com/immunefi-team/audit-comp-belong/blob/a17f775dcc4c125704ce85d4e18b744daece65af/contracts/v2/utils/Helper.sol#L106
Proof of Concept
The following minimal contract reproduces the observed difference:
Observed results when running in RemixIDE:
With
standardize(indirect call) — gas consumption: 2690 Execution logs: https://ibb.co/tMn2YChgWith direct call to
_standardize— gas consumption: 2642 Execution logs: https://ibb.co/dwYdfbth
References
Contract location referenced: https://github.com/immunefi-team/audit-comp-belong/blob/a17f775dcc4c125704ce85d4e18b744daece65af/contracts/v2/utils/Helper.sol#L106
Was this helpful?