Unused Named Returns #115
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
wont fix
Handle
ye0lde
Vulnerability details
Impact
Removing unused named return variables can reduce gas usage and improve code clarity.
Proof of Concept
Unused named returns
https://github.com/code-423n4/2021-11-yaxis/blob/146febcb61ae7fe20b0920849c4f4bbe111c6ba7/contracts/v3/alchemix/Transmuter.sol#L394-L397
https://github.com/code-423n4/2021-11-yaxis/blob/146febcb61ae7fe20b0920849c4f4bbe111c6ba7/contracts/v3/alchemix/Transmuter.sol#L424
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Either remove the named variables or
Delete the similar local variables that were created and used instead of the named variables.
The return statement can also be deleted.
For example, refactor the userInfo function
https://github.com/code-423n4/2021-11-yaxis/blob/146febcb61ae7fe20b0920849c4f4bbe111c6ba7/contracts/v3/alchemix/Transmuter.sol#L394-L397
like this:
getMultipleUserInfo can be refactored in the same way.
The text was updated successfully, but these errors were encountered: