• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-smart-account / 12708907151
94%

Build:
DEFAULT BRANCH: main
Ran 10 Jan 2025 11:47AM UTC
Jobs 1
Files 42
Run time 51min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Jan 2025 11:46AM UTC coverage: 93.957%. Remained the same
12708907151

push

github

web-flow
[Certora Audit] G-10. ++i costs less gas compared to i++ or i+=1 (#897)

This pull request includes several changes to increment and decrement
operations in various Solidity contract files. The primary goal is to
decrease gas usage.

Pre-increments and pre-decrements are cheaper.
For a uint256 i variable, the following is true with the Optimizer
enabled at 10k:
Increment:
- i += 1 is the most expensive form
- i++ costs 6 gas less than i += 1
- ++i costs 5 gas less than i++ (11 gas less than i += 1)

Decrement:
- i -= 1 is the most expensive form
- i-- costs 11 gas less than i -= 1
- --i costs 5 gas less than i-- (16 gas less than i -= 1)

Changes to increment and decrement operations:

*
[`contracts/Safe.sol`](diffhunk://#diff-587b494ea16e1163b26e39de24e9483deL296-R296):
Updated the for loop to use the prefix increment operator in the `Safe`
contract.
*
[`contracts/base/ModuleManager.sol`](diffhunk://#diff-82762908bf938d454d8a207aad1ec3839L215-R215):
Changed the increment operation to use the prefix increment operator in
the `ModuleManager` contract.
*
[`contracts/base/OwnerManager.sol`](diffhunk://#diff-<a class=hub.com/safe-global/safe-smart-account/commit/<a class="double-link" href="https://git"><a class=hub.com/safe-global/safe-smart-account/commit/<a class="double-link" href="https://git"><a class=hub.com/safe-global/safe-smart-account/commit/<a class="double-link" href="https://git"><a class=hub.com/safe-global/safe-smart-account/commit/795fb06764b4c2d991707584a31509badf0b036c">795fb06769401bfbcb82d6bc9fdebab82L38-R38):
Multiple updates to use prefix increment and decrement operators in the
`OwnerManager` contract.
[[1]](diffhunk://#diff-795fb06764b4c2d991707584a31509badf0b036c9401bfbcb82d6bc9fdebab82L38-R38)
[[2]](diffhunk://#diff-795fb06764b4c2d991707584a31509badf0b036c9401bfbcb82d6bc9fdebab82L63-R63)
[[3]](diffhunk://#diff-795fb06764b4c2d991707584a31509badf0b036c9401bfbcb82d6bc9fdebab82L80-R80)
[[4]](diffhunk://#diff-795fb06764b4c2d991707584a31509badf0b036c9401bfbcb82d6bc9fdebab82L142-R142)
*
[`contracts/common/StorageAccessible.sol`](diffhunk://#diff-a7dd65d90752ccf309800fad93fba354eL19-R19):
Modified the for loop to use the prefix increment operator in the
`StorageAccessible` contract.
*
[`contract... (continued)

325 of 366 branches covered (88.8%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 6 files covered. (100.0%)

499 of 511 relevant lines covered (97.65%)

100.88 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-$ - 12708907151.1 10 Jan 2025 11:47AM UTC 42
93.96
GitHub Action Run
Source Files on build 12708907151
  • Tree
  • List 42
  • Changed 6
  • Source Changed 6
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #12708907151
  • 8137b689 on github
  • Prev Build on main (#12695215555)
  • Next Build on main (#12708911388)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc