code-423n4 / 2022-01-sherlock-findings

0 stars 0 forks source link

Name collision in `SherlockProtocolManager` #239

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

gzeon

Vulnerability details

Impact

premium is defined as a function name https://github.com/code-423n4/2022-01-sherlock/blob/c763f10c4b5fe2127677d6c25b83adcf3bcec212/contracts/managers/SherlockProtocolManager.sol#L118

  function premium(bytes32 _protocol)

but also as a uint256 in various other place https://github.com/code-423n4/2022-01-sherlock/blob/c763f10c4b5fe2127677d6c25b83adcf3bcec212/contracts/managers/SherlockProtocolManager.sol#L194 https://github.com/code-423n4/2022-01-sherlock/blob/c763f10c4b5fe2127677d6c25b83adcf3bcec212/contracts/managers/SherlockProtocolManager.sol#L575

    uint256 premium = premiums_[_protocol];

which might cause confusion and mix-up

Evert0x commented 2 years ago

0 non criticial