Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Mar 1, 2024
1 parent 6aab488 commit 9618bcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contracts/proxy/Clones.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ library Clones {
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation, uint256 value) internal returns (address instance) {
if (value > 0 && address(this).balance < value) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
/// @solidity memory-safe-assembly
Expand Down Expand Up @@ -72,7 +72,7 @@ library Clones {
bytes32 salt,
uint256 value
) internal returns (address instance) {
if (value > 0 && address(this).balance < value) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
/// @solidity memory-safe-assembly
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/Create2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ library Create2 {
* - if `amount` is non-zero, `bytecode` must have a `payable` constructor.
*/
function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {
if (amount > 0 && address(this).balance < amount) {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
if (bytecode.length == 0) {
Expand Down

0 comments on commit 9618bcd

Please sign in to comment.