Skip to content

Commit

Permalink
Report for issue #117 updated by Sathish9098
Browse files Browse the repository at this point in the history
  • Loading branch information
c4-bot-5 committed Mar 23, 2024
1 parent e8c311d commit 95493fc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion data/Sathish9098-G.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

The instances below point to the second+ access of a state variable within a function. Caching of a state variable replace each Gwarmaccess (100 gas) with a much cheaper stack read. Other less obvious fixes/optimizations include having local memory caches of state variable structs, or having local caches of state variable contracts/addresses. Most of the times this if statement will be true and we will save 100 gas at a small possibility of 3 gas loss

### [G-1.1] ``addressManager`` should be cached . Saves ``100 GAS`` , ``1 SLOD``
### [G-1.1] ``addressManager`` can be cached . Saves ``100 GAS`` , ``1 SLOD``

```diff
FILE: 2024-03-taiko/packages/protocol/contracts/common/AddressResolver.sol

+ address addressManager_= addressManager ;
- if (addressManager == address(0)) revert RESOLVER_INVALID_MANAGER();
+ if (addressManager_== address(0)) revert RESOLVER_INVALID_MANAGER();
Expand All @@ -22,3 +23,14 @@ FILE: 2024-03-taiko/packages/protocol/contracts/common/AddressResolver.sol
```
https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/common/AddressResolver.sol#L81-L83

### [G-1.2] ``gasExcess`` can be cached . Saves ``100 GAS`` , ``1 SLOD``

```diff
FILE

``

##

## [G-]

0 comments on commit 95493fc

Please sign in to comment.