Skip to content

Commit b6bef4e

Browse files
committed
rewrite require(..., error); as if (...) revert error;
1 parent c31ff36 commit b6bef4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contracts/crosschain/axelar/AxelarGatewayBase.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ abstract contract AxelarGatewayBase is Ownable {
3636
/// @dev Returns the equivalent chain given an id that can be either CAIP-2 or an Axelar network identifier.
3737
function getEquivalentChain(string memory input) public view virtual returns (string memory output) {
3838
output = _chainEquivalence[input];
39-
require(bytes(output).length > 0, UnsupportedChain(input));
39+
if (bytes(output).length == 0) revert UnsupportedChain(input);
4040
}
4141

4242
/// @dev Returns the CAIP-10 account address of the remote gateway for a given CAIP-2 chain identifier.
4343
function getRemoteGateway(string memory caip2) public view virtual returns (string memory remoteGateway) {
4444
remoteGateway = _remoteGateways[caip2];
45-
require(bytes(remoteGateway).length > 0, UnsupportedChain(caip2));
45+
if (bytes(remoteGateway).length == 0) revert UnsupportedChain(caip2);
4646
}
4747

4848
/// @dev Registers a chain equivalence between a CAIP-2 chain identifier and an Axelar network identifier.

0 commit comments

Comments
 (0)