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

Use immutable keyword #7

Open
code423n4 opened this issue Jun 20, 2021 · 0 comments
Open

Use immutable keyword #7

code423n4 opened this issue Jun 20, 2021 · 0 comments
Assignees
Labels

Comments

@code423n4
Copy link
Contributor

Handle

gpersoon

Vulnerability details

Impact

Most of the contracts set variables in the initialize function that are never changed. See for examples in the "proof of concept" section.
Here the solidity keyword "immutable" could be added to the variables as an extra security measure.

Proof of Concept

ControlledToken.sol: TokenControllerInterface public override controller;
StakePricePools.sol: IERC20Upgradeable private stakeToken;
YieldSourcePrizePool.sol: IYieldSource public yieldSource;
PrizePool.sol: RegistryInterface public reserveRegistry;
PrizePool.sol: uint256 public maxExitFeeMantissa;
PrizePool.sol: uint256 public maxTimelockDuration;
BadgerYieldSource.sol IBadgerSett private immutable badgerSett;
BadgerYieldSource.sol IBadger private immutable badger;
YearnV2YieldSource.sol IYVaultV2 public vault;
YearnV2YieldSource.sol IERC20Upgradeable internal token;
IdleYieldSource.sol address public idleToken;
IdleYieldSource.sol address public underlyingAsset;
ATokenYieldSource.sol ATokenInterface public aToken;
ATokenYieldSource.sol ILendingPoolAddressesProviderRegistry public lendingPoolAddressesProviderRegistry;
SushiYieldSource.sol ISushiBar public immutable sushiBar;
SushiYieldSource.sol ISushi public immutable sushiAddr;

Tools Used

Recommended Mitigation Steps

Add immutable where possible

@code423n4 code423n4 added 0 (Non-critical) bug Something isn't working labels Jun 20, 2021
code423n4 added a commit that referenced this issue Jun 20, 2021
@kamescg kamescg self-assigned this Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants