code-423n4 / 2022-05-sturdy-findings

7 stars 3 forks source link

Gas Optimizations #126

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago
  1. Consider making some constants as non-public to save gas

Reducing from public to private or internal can save gas when a constant isn’t used outside of its contract. I suggest changing the visibility from public to internal or private.

POC : https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/YieldManager.sol#L48 https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/YieldManager.sol#L49