Skip to content

Commit

Permalink
[OZ][N-13] Unnecessary Assembly Usage (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ authored Jan 31, 2025
1 parent 1bddd87 commit 62144e6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions contracts/sfc/NodeDriverAuth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,11 @@ contract NodeDriverAuth is OwnableUpgradeable, UUPSUpgradeable {
}

function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
return account.code.length > 0;
}

function _getCodeHash(address addr) internal view returns (bytes32) {
bytes32 codeHash;
assembly {
codeHash := extcodehash(addr)
}
return codeHash;
return addr.codehash;
}

uint256[50] private __gap;
Expand Down

0 comments on commit 62144e6

Please sign in to comment.