Skip to content

Commit 71314dd

Browse files
committed
fix(c4-117-g12): splitting require() statements that use && saves gas
Signed-off-by: Tomás Migone <[email protected]>
1 parent ee5d3cb commit 71314dd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

contracts/gateway/L1GraphTokenGateway.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ contract L1GraphTokenGateway is Initializable, GraphTokenGateway, L1ArbitrumMess
143143
* @param _escrow Address of the BridgeEscrow
144144
*/
145145
function setEscrowAddress(address _escrow) external onlyGovernor {
146-
require(_escrow != address(0) && Address.isContract(_escrow), "INVALID_ESCROW");
146+
require(_escrow != address(0), "INVALID_ESCROW");
147+
require(Address.isContract(_escrow), "MUST_BE_CONTRACT");
147148
escrow = _escrow;
148149
emit EscrowAddressSet(_escrow);
149150
}

contracts/upgrades/GraphProxy.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ contract GraphProxy is GraphProxyStorage {
139139
function _acceptUpgrade() internal {
140140
address _pendingImplementation = _pendingImplementation();
141141
require(Address.isContract(_pendingImplementation), "Impl must be a contract");
142-
require(
143-
_pendingImplementation != address(0) && msg.sender == _pendingImplementation,
144-
"Only pending implementation"
145-
);
142+
require(_pendingImplementation != address(0), "Impl cannot be zero address");
143+
require(msg.sender == _pendingImplementation, "Only pending implementation");
146144

147145
_setImplementation(_pendingImplementation);
148146
_setPendingImplementation(address(0));

0 commit comments

Comments
 (0)