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

Various Non-Conformance to Solidity naming conventions #60

Open
code423n4 opened this issue Jan 5, 2022 · 2 comments
Open

Various Non-Conformance to Solidity naming conventions #60

code423n4 opened this issue Jan 5, 2022 · 2 comments
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Handle

Dravee

Vulnerability details

Impact

Solidity defines a naming convention that should be followed.

Proof of Concept

Variable XDEFIDistribution.MAX_TOTAL_XDEFI_SUPPLY (contracts/XDEFIDistribution.sol#14) is not in mixedCase
Constant XDEFIDistribution._pointsMultiplier (contracts/XDEFIDistribution.sol#17) is not in UPPER_CASE_WITH_UNDERSCORES
Variable XDEFIDistribution._pointsPerUnit (contracts/XDEFIDistribution.sol#18) is not in mixedCase
Variable XDEFIDistribution.XDEFI (contracts/XDEFIDistribution.sol#20) is not in mixedCase
Variable XDEFIDistribution._zeroDurationPointBase (contracts/XDEFIDistribution.sol#30) is not in mixedCase
Variable XDEFIDistribution._locked (contracts/XDEFIDistribution.sol#37) is not in mixedCase
Function IXDEFIDistribution.XDEFI() (contracts/interfaces/IXDEFIDistribution.sol#37) is not in mixedCase

Tools Used

Slither

Recommended Mitigation Steps

Follow the Solidity naming convention: https://docs.soliditylang.org/en/v0.4.25/style-guide.html#naming-conventions

@code423n4 code423n4 added 0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working labels Jan 5, 2022
code423n4 added a commit that referenced this issue Jan 5, 2022
@deluca-mike deluca-mike added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Jan 5, 2022
@deluca-mike
Copy link
Collaborator

MAX_TOTAL_XDEFI_SUPPLY is being removed.
_pointsMultiplier will be renamed to POINTS_MULTIPLIER.
_pointsPerUnit, _pointsPerUnit, and _locked will remain as it is an internal variable and that is the standard we use to distinguish between exposed and non-exposed variables and functions.
XDEFI will be renamed to xdefi.
_zeroDurationPointBase, despite being immutable, is actually not considered constant by Solidity developers themselves, sadly. See this and this.

@deluca-mike
Copy link
Collaborator

deluca-mike commented Jan 14, 2022

MAX_TOTAL_XDEFI_SUPPLY and _zeroDurationPointBase was removed from the release candidate contract.

_pointsMultiplier was renamed to POINTS_MULTIPLIER, but then to POINTS_MULTIPLIER_BITS since another issue correctly suggested we shift rather than multiply.

XDEFI was renamed to xdefi.

@deluca-mike deluca-mike added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label Jan 14, 2022
@Ivshti Ivshti closed this as completed Jan 16, 2022
@CloudEllie CloudEllie reopened this Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

4 participants