Skip to content

Commit

Permalink
fix: updated bridge hub spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
sendra committed Jul 25, 2024
1 parent 5a3f07d commit 2eed733
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/contracts/adapters/zkSync/IZkSyncAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions src/contracts/adapters/zkSync/ZkSyncAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -86,7 +86,7 @@ contract ZkSyncAdapter is IZkSyncAdapter, BaseAdapter {
})
);

return (address(BRIDGEHUB), uint256(canonicalTxHash));
return (address(BRIDGE_HUB), uint256(canonicalTxHash));
}

/// @inheritdoc IZkSyncAdapter
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/libs/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion tests/adapters/ZkSyncAdapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 2eed733

Please sign in to comment.