You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function setUpgradeContract(INameWrapperUpgrade _upgradeAddress)
public
onlyOwner
{
if (address(upgradeContract) !=address(0)) {
registrar.setApprovalForAll(address(upgradeContract), false);
ens.setApprovalForAll(address(upgradeContract), false);
}
upgradeContract = _upgradeAddress;
if (address(upgradeContract) !=address(0)) {
registrar.setApprovalForAll(address(upgradeContract), true);
ens.setApprovalForAll(address(upgradeContract), true);
}
}
Recommended Mitigation Steps
Consider introducing memory variable instead of reading storage
function setUpgradeContract(INameWrapperUpgrade _upgradeAddress)
public
onlyOwner
{
+address _upgradeContract =address(upgradeContract);
if (_upgradeContract !=address(0)) {
...
}
The text was updated successfully, but these errors were encountered:
upgradeContract
is a storage variable that is being directly read multiple times:https://github.com/code-423n4/2022-07-ens/blob/ff6e59b9415d0ead7daf31c2ed06e86d9061ae22/contracts/wrapper/NameWrapper.sol#L128-L143
Recommended Mitigation Steps
Consider introducing memory variable instead of reading storage
The text was updated successfully, but these errors were encountered: