gas

>= costs less gas than >

Reward

Total

26.44 USDC

11.02 USDC
Selected
15.43 USDC
Selected Submission

>= costs less gas than >

Severity

Gas Optimization / Informational

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/libraries/OracleLib.sol#L30

Summary

[G-19] >= costs less gas than >

The compiler uses opcodes GT and ISZERO for solidity code that uses >, but only requires LT for >=, which saves 3 gas Reference: https://gist.github.com/IllIllI000/3dc79d25acccfa16dee4e83ffdc6ffde

file: /src/libraries/OracleLib.sol

30        if (secondsSince > TIMEOUT) revert OracleLib__StalePrice();

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/libraries/OracleLib.sol#L30