You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Project.homeFi can't be changed after init of the clone
Since ProjectFactory.homeFi can't be changed currently, that means it's also isn't changed across clones (i.e. all clones have the same value).
homeFi is used every tx at the Project contract, since every tx calls isTrustedForwarder()
The cost of reading homeFi from storage is 2.1K
Therefore consider making Project.homeFi immutable. If in the future you decide to make it modifiable, just change ProjectFactory.underlying contract and make it a storage var (or create the contract with a different value and keep it immutable).
Cache storage variable at ProjectFactory.createProject()
Make
ProjectFactory.homeFi
immutableCode: https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Project.sol#L52
Project.homeFi
can't be changed after init of the cloneProjectFactory.homeFi
can't be changed currently, that means it's also isn't changed across clones (i.e. all clones have the same value).homeFi
is used every tx at theProject
contract, since every tx callsisTrustedForwarder()
homeFi
from storage is 2.1KTherefore consider making
Project.homeFi
immutable. If in the future you decide to make it modifiable, just changeProjectFactory.underlying
contract and make it a storage var (or create the contract with a different value and keep it immutable).Cache storage variable at
ProjectFactory.createProject()
Code: https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/ProjectFactory.sol#L78-L93
Instead of reading
homeFi
from storage twice, cache it to memory. This will save ~100 gas units.The text was updated successfully, but these errors were encountered: