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

Magic Numbers used in Admin._stake() When Constant Defined Above Can Be Used Instead #71

Open
code423n4 opened this issue Apr 7, 2021 · 0 comments
Labels
1 (Low Risk) bug Something isn't working

Comments

@code423n4
Copy link
Collaborator

Handle

jvaqa

Vulnerability details

Impact

Magic Numbers are used in Admin._stake(), which both obscure the purpose of the function and unnecessarily lead to potential error if the constants are changed during development. Since they are used to refer to a constant defined in RoleAware, and Admin inherits from RoleAware, then Admin can simply call that constant.

Recommended Mitigation Steps

In Admin._stake(), change this:

IncentiveDistribution(incentiveDistributor()).addToClaimAmount(
1,
holder,
amount
);

to this:

IncentiveDistribution(incentiveDistributor()).addToClaimAmount(
FUND_TRANSFERER,
holder,
amount
);

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Apr 7, 2021
code423n4 added a commit that referenced this issue Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant