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

[Perennial Self Report] Mutable states set in upgradeable contract constructor #93

Open
prateekdefi opened this issue Sep 27, 2024 · 1 comment
Labels
Sponsor Confirmed The sponsor acknowledged this issue is valid Will Fix The sponsor confirmed this issue will be fixed

Comments

@prateekdefi
Copy link

Issue details

Some upgradeable contracts set mutable states in constructor, which will impact their proxies as proxy storage won't have them and are set to zero on proxies which could not be updated.

Code snippet

contract Controller is Factory, IController {
    /// @inheritdoc IController
    IMarketFactory public marketFactory;

    /// @inheritdoc IController
    IAccountVerifier public verifier;

    /// @dev Creates instance of Controller
    /// @param implementation_ Collateral account contract initialized with stablecoin addresses
    constructor(address implementation_) Factory(implementation_) {
        USDC = Account(implementation_).USDC();
        DSU = Account(implementation_).DSU();
    }
}

https://github.com/sherlock-audit/2024-08-perennial-v2-update-3/blob/main/perennial-v2/packages/perennial-account/contracts/Controller.sol#L26-L65

@sherlock-admin3 sherlock-admin3 added Sponsor Confirmed The sponsor acknowledged this issue is valid Will Fix The sponsor confirmed this issue will be fixed labels Sep 29, 2024
@sherlock-admin2
Copy link

The protocol team fixed this issue in the following PRs/commits:
equilibria-xyz/perennial-v2#449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sponsor Confirmed The sponsor acknowledged this issue is valid Will Fix The sponsor confirmed this issue will be fixed
Projects
None yet
Development

No branches or pull requests

3 participants