Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas Optimizations #51

Closed
code423n4 opened this issue May 1, 2022 · 1 comment
Closed

Gas Optimizations #51

code423n4 opened this issue May 1, 2022 · 1 comment
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)

Comments

@code423n4
Copy link
Contributor

[G-01] Immutable variables

Description

3 variables are read many times but set only once in the constructor. They could be set as immutable to save gas.

  IAToken public aToken;
  IRewardsController public rewardsController;
  IPoolAddressesProviderRegistry public poolAddressesProviderRegistry;

https://github.com/pooltogether/aave-v3-yield-source/blob/e63d1b0e396a5bce89f093630c282ca1c6627e44/contracts/AaveV3YieldSource.sol#L126-L133

Recommended Mitigation Steps

Make variables immutable

-----------------------------------------------------------------

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels May 1, 2022
code423n4 added a commit that referenced this issue May 1, 2022
@PierrickGT PierrickGT self-assigned this May 3, 2022
@PierrickGT
Copy link
Member

Duplicate of #1

@PierrickGT PierrickGT marked this as a duplicate of #1 May 3, 2022
@PierrickGT PierrickGT added the duplicate This issue or pull request already exists label May 3, 2022
@JeeberC4 JeeberC4 removed the duplicate This issue or pull request already exists label May 6, 2022
@JeeberC4 JeeberC4 reopened this May 6, 2022
@JeeberC4 JeeberC4 added the duplicate This issue or pull request already exists label May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)
Projects
None yet
Development

No branches or pull requests

3 participants