diff --git a/src/contracts/adapters/zkSync/IZkSyncAdapter.sol b/src/contracts/adapters/zkSync/IZkSyncAdapter.sol index 9d81098c..747024c7 100644 --- a/src/contracts/adapters/zkSync/IZkSyncAdapter.sol +++ b/src/contracts/adapters/zkSync/IZkSyncAdapter.sol @@ -10,10 +10,10 @@ import {IBridgehub} from './interfaces/IBridgehub.sol'; */ interface IZkSyncAdapter { /** - * @notice method to get the BRIDGEHUB address - * @return address of the BRIDGEHUB + * @notice method to get the bridge hub address + * @return address of the bridge hub */ - function BRIDGEHUB() external view returns (IBridgehub); + function BRIDGE_HUB() external view returns (IBridgehub); /** * @notice method to get the required l1 to l2 gas per pubdata. diff --git a/src/contracts/adapters/zkSync/ZkSyncAdapter.sol b/src/contracts/adapters/zkSync/ZkSyncAdapter.sol index 20a42fe1..3611864a 100644 --- a/src/contracts/adapters/zkSync/ZkSyncAdapter.sol +++ b/src/contracts/adapters/zkSync/ZkSyncAdapter.sol @@ -18,7 +18,7 @@ import {IZkSyncAdapter, IBridgehub} from './IZkSyncAdapter.sol'; */ contract ZkSyncAdapter is IZkSyncAdapter, BaseAdapter { /// @inheritdoc IZkSyncAdapter - IBridgehub public immutable BRIDGEHUB; + IBridgehub public immutable BRIDGE_HUB; /// @inheritdoc IZkSyncAdapter uint256 public constant REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT = 800; @@ -33,13 +33,13 @@ contract ZkSyncAdapter is IZkSyncAdapter, BaseAdapter { */ constructor( address crossChainController, - address bridgehub, + address bridgeHub, address refundAddress, uint256 providerGasLimit, TrustedRemotesConfig[] memory trustedRemotes ) BaseAdapter(crossChainController, providerGasLimit, 'ZkSync native adapter', trustedRemotes) { - require(bridgehub != address(0), Errors.ZK_SYNC_BRIDGEHUB_CANT_BE_ADDRESS_0); - BRIDGEHUB = IBridgehub(bridgehub); + require(bridgeHub != address(0), Errors.ZK_SYNC_BRIDGE_HUB_CANT_BE_ADDRESS_0); + BRIDGE_HUB = IBridgehub(bridgeHub); REFUND_ADDRESS_L2 = refundAddress; } @@ -58,7 +58,7 @@ contract ZkSyncAdapter is IZkSyncAdapter, BaseAdapter { uint256 totalGasLimit = executionGasLimit + BASE_GAS_LIMIT; - uint256 cost = BRIDGEHUB.l2TransactionBaseCost( + uint256 cost = BRIDGE_HUB.l2TransactionBaseCost( destinationChainId, uint256(tx.gasprice), totalGasLimit, @@ -72,7 +72,7 @@ contract ZkSyncAdapter is IZkSyncAdapter, BaseAdapter { message ); - bytes32 canonicalTxHash = BRIDGEHUB.requestL2TransactionDirect{value: cost}( + bytes32 canonicalTxHash = BRIDGE_HUB.requestL2TransactionDirect{value: cost}( IBridgehub.L2TransactionRequestDirect({ chainId: destinationChainId, mintValue: cost, @@ -86,7 +86,7 @@ contract ZkSyncAdapter is IZkSyncAdapter, BaseAdapter { }) ); - return (address(BRIDGEHUB), uint256(canonicalTxHash)); + return (address(BRIDGE_HUB), uint256(canonicalTxHash)); } /// @inheritdoc IZkSyncAdapter diff --git a/src/contracts/libs/Errors.sol b/src/contracts/libs/Errors.sol index cdeff0a3..7ca6c1c9 100644 --- a/src/contracts/libs/Errors.sol +++ b/src/contracts/libs/Errors.sol @@ -49,6 +49,6 @@ library Errors { string public constant INVALID_HL_MAILBOX = '40'; // the Hyperlane mailbox address can not be 0 string public constant WORMHOLE_RELAYER_CANT_BE_ADDRESS_0 = '41'; // Wormhole relayer can not be address 0 string public constant CALLER_NOT_WORMHOLE_RELAYER = '42'; // caller must be the Wormhole relayer - string public constant ZK_SYNC_BRIDGEHUB_CANT_BE_ADDRESS_0 = '43'; // ZkSync Bridgehub can not be address 0 + string public constant ZK_SYNC_BRIDGE_HUB_CANT_BE_ADDRESS_0 = '43'; // ZkSync Bridgehub can not be address 0 string public constant CL_GAS_PRICE_ORACLE_CANT_BE_ADDRESS_0 = '44'; // ChainLink gas price oracle can not be address 0 } diff --git a/tests/adapters/ZkSyncAdapter.t.sol b/tests/adapters/ZkSyncAdapter.t.sol index 1c8e466a..878d5821 100644 --- a/tests/adapters/ZkSyncAdapter.t.sol +++ b/tests/adapters/ZkSyncAdapter.t.sol @@ -74,7 +74,7 @@ contract ZkSyncAdapterTest is BaseAdapterTest { IBaseAdapter.TrustedRemotesConfig[] memory originConfigs = new IBaseAdapter.TrustedRemotesConfig[](1); originConfigs[0] = originConfig; - vm.expectRevert(bytes(Errors.ZK_SYNC_BRIDGEHUB_CANT_BE_ADDRESS_0)); + vm.expectRevert(bytes(Errors.ZK_SYNC_BRIDGE_HUB_CANT_BE_ADDRESS_0)); new ZkSyncAdapter(crossChainController, address(0), refundAddress, baseGasLimit, originConfigs); }