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

State variables not explicitly initialized #16

Closed
code423n4 opened this issue Apr 16, 2021 · 2 comments
Closed

State variables not explicitly initialized #16

code423n4 opened this issue Apr 16, 2021 · 2 comments
Labels
bug Something isn't working invalid sponsor disputed

Comments

@code423n4
Copy link
Contributor

Handle

gpersoon

Vulnerability details

Impact

The "State" variables not explicitly initialized, in Loan.sol and Pool.sol.
This could be tricky if states are added to the, especially in the beginning.
It's also not clear for the casual reviewer what the initial state is.

Proof of Concept

Loan.sol: enum State { Ready, Active, Matured, Expired, Liquidated }
Loan.sol: State public loanState; // The current state of this loan, as defined in the State enum below

Pool.sol: enum State { Initialized, Finalized, Deactivated }
Pool.sol: State public poolState;

Tools Used

Review of the code

Recommended Mitigation Steps

Explicitly initialize enum type variables or add a comment indicating the initial state.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Apr 16, 2021
code423n4 added a commit that referenced this issue Apr 16, 2021
@lucas-manuel
Copy link
Collaborator

Not a bug

@Arachnid
Copy link
Collaborator

Agreed that it's not a bug, but it would be wise to be explicit here instead of depending on the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid sponsor disputed
Projects
None yet
Development

No branches or pull requests

3 participants