Skip to content

Commit

Permalink
Replace assembly with high-level constructs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ committed Dec 13, 2024
1 parent e86e5db commit 7afed4a
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 @@ -171,19 +171,10 @@ 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;
}
}

0 comments on commit 7afed4a

Please sign in to comment.