Skip to content

Commit

Permalink
[Certora Audit] G-05. Use iszero instead of eq(*, 0) (#892)
Browse files Browse the repository at this point in the history
This pull request includes a critical update to the `SafeProxyFactory`
contract in the `contracts/proxies/SafeProxyFactory.sol` file. The
change improves the gas cost of the assembly code by replacing the `eq`
function with the `iszero` function.

Key change:

*
[`contracts/proxies/SafeProxyFactory.sol`](diffhunk://#diff-53aac98a01e16743466b00bdcb233208f95e1113cc90b95181187d9862b4ad6eL43-R43):
Replaced the `eq` function with the `iszero` function in the assembly
block to improve code readability and reliability.
  • Loading branch information
remedcu authored Jan 9, 2025
1 parent 25365fc commit 0e061e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/proxies/SafeProxyFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract SafeProxyFactory {
/* solhint-disable no-inline-assembly */
/// @solidity memory-safe-assembly
assembly {
if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {
if iszero(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0)) {
revert(0, 0)
}
}
Expand Down

0 comments on commit 0e061e2

Please sign in to comment.