Closed code423n4 closed 2 years ago
I believe this is a QA issue. Gas cost may or may not increase. In the event it does, the auctioning activity would be routed to a new contract with the correct gas amount. No harm done.
0xean changed the severity to QA (Quality Assurance)
0xean marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2022-11-size/blob/main/src/util/ECCMath.sol#L28
Vulnerability details
Vulnerability details
Description
There is an
ecMul
function in theECCMath
library. The function performs a call to the eponymous precompile. The gas limit for the precompile call is hardcoded.There is no guarantee that the same cost will stay for future EVM updates / Ethereum hardforkes. Over the entire history of the Ethereum development, precompiles calls were recalculated many times. For example, the
ecMul
precompile cost 5000 gas at the Byzantium hardfork, and 6000 gas after. All in all, the cost of calling this precompile may increase.Thereby, the
ecMul
function from theECCMath
may stop working after one of the network upgrades, because hardcoded amount of gas would be not enough.Impact
The
finalize
function from theSizeSealed
smart contract may stop working. That breaks the whole auction logic.Recommended Mitigation Steps
Make a gas limit for precompile call as a user-provided parameter (calldata).