DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

Variable shadowing in the ISTETH interface

Summary

There is a local variable in the ISTETH interface contract called eip712Domain().name that is shadowing (hiding) another function called name() in the same interface contract.

Vulnerability Details

The ISTETH interface contract has a function called name() defined at line 9:

function name() external view returns (string memory);

and it also has a function called eip712Domain() defined at line 22:

function eip712Domain() external view returns (bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions);

The eip712Domain() function returns a struct that contains a field called name.

Since the field name has the same name as the name() function, it is considered a local variable and it shadows the outer function.

Impact

In Solidity, shadowing occurs when a local variable or function parameter has the same name as a variable or function in an outer scope. This can lead to confusion and potential bugs because the local variable or parameter will take precedence over the outer variable or function.

Tools Used

Slither

Recommendations

Rename the name field in the eip712Domain() function to avoid the shadowing.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.