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

Function poolDelegate does not have a named return (DebtLocker.sol) #25

Open
code423n4 opened this issue Dec 6, 2021 · 2 comments
Open
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working 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

ye0lde

Vulnerability details

Impact

Code clarity or possibly gas savings if all the other named returns are in error.

Proof of Concept

Function poolDelegate does not have a named return even though its interface definition does.
The named return isn't used so the fact that it's missing doesn't matter.

Function pool and tens of other functions do have a named return. Most of these named returns are not used and could be deleted. I'm assuming this is a project convention and may be used in off-chain reporting, etc.

https://github.com/maple-labs/debt-locker/blob/81f55907db7b23d27e839b9f9f73282184ed4744/contracts/DebtLocker.sol#L279-L285

Tools Used

Visual Studio Code, Remix

Recommended Mitigation Steps

Add a named return to function `poolDelegate' for consistency/reporting.

Or if all those other named returns are in error, remove the unused named returns and kick this ticket over to gas optimization.

@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 Dec 6, 2021
code423n4 added a commit that referenced this issue Dec 6, 2021
@lucas-manuel
Copy link
Collaborator

Good catch will fix

@lucas-manuel lucas-manuel added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Dec 8, 2021
@pauliax
Copy link
Collaborator

pauliax commented Dec 19, 2021

Valid suggestion.

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 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

3 participants