Skip to content

Commit

Permalink
(fix): merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Raid Ateir committed Oct 30, 2024
1 parent 93d4bb9 commit 633b3d0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 57 deletions.
6 changes: 3 additions & 3 deletions l1-contracts/contracts/bridgehub/IMessageRoot.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ pragma solidity 0.8.24;
import {IBridgehub} from "./IBridgehub.sol";

/**
* @author Matter Labs
* @notice MessageRoot contract is responsible for storing and aggregating the roots of the batches from different chains into the MessageRoot.
* @custom:security-contact [email protected]
* @author Matter Labs
* @notice MessageRoot contract is responsible for storing and aggregating the roots of the batches from different chains into the MessageRoot.
* @custom:security-contact [email protected]
*/
interface IMessageRoot {
function BRIDGE_HUB() external view returns (IBridgehub);
Expand Down
33 changes: 0 additions & 33 deletions l1-contracts/contracts/common/interfaces/IL2ContractDeployer.sol

This file was deleted.

2 changes: 1 addition & 1 deletion l1-contracts/contracts/governance/PermanentRestriction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ contract PermanentRestriction is IRestriction, IPermanentRestriction, Ownable2St

// Note, that we do not use an explicit call here to ensure that the function does not panic in case of
// incorrect `_chain` address.
(bool success, bytes memory data) = _chain.staticcall(abi.encodeCall(IGetters.getChainId));
(bool success, bytes memory data) = _chain.staticcall(abi.encodeCall(IGetters.getChainId, ()));
if (!success || data.length < 32) {
revert NotAHyperchain(_chain);
}
Expand Down
4 changes: 1 addition & 3 deletions l1-contracts/contracts/upgrades/GatewayUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ contract GatewayUpgrade is BaseZkSyncUpgrade {
l2TxDataFinish
);
// slither-disable-next-line controlled-delegatecall
(bool success, ) = THIS_ADDRESS.delegatecall(
abi.encodeCall(IGatewayUpgrade.upgradeExternal, proposedUpgrade)
);
(bool success, ) = THIS_ADDRESS.delegatecall(abi.encodeCall(IGatewayUpgrade.upgradeExternal, proposedUpgrade));
// solhint-disable-next-line gas-custom-errors
require(success, "GatewayUpgrade: upgrade failed");
return Diamond.DIAMOND_INIT_SUCCESS_RETURN_VALUE;
Expand Down
10 changes: 1 addition & 9 deletions l1-contracts/contracts/upgrades/L1GenesisUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,13 @@ import {L2ContractHelper} from "../common/libraries/L2ContractHelper.sol";
/// @author Matter Labs
/// @custom:security-contact [email protected]
contract L1GenesisUpgrade is IL1GenesisUpgrade, BaseZkSyncUpgradeGenesis {
<<<<<<< HEAD
<<<<<<< HEAD
/// @notice The main function that will be called by the Admin facet.
/// @notice The main function that will be delegate-called by the chain Admin facet.
/// @param _l1GenesisUpgrade the address of the l1 genesis upgrade
/// @param _chainId the chain id
/// @param _protocolVersion the current protocol version
/// @param _l1CtmDeployerAddress the address of the l1 ctm deployer
/// @param _forceDeploymentsData the force deployments data
/// @param _factoryDeps the factory dependencies
=======
/// @notice The main function that will be delegate called by the upgrade proxy.
>>>>>>> origin/kl/n04-library
=======
/// @notice The main function that will be delegate-called by the chain.
>>>>>>> origin/sb-n07-library-fix-review
function genesisUpgrade(
address _l1GenesisUpgrade,
uint256 _chainId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import {AlreadyWhitelisted, InvalidSelector, NotWhitelisted} from "contracts/com

contract CheckTransactionTest is GatewayTransactionFiltererTest {
function test_TransactionAllowedOnlyFromWhitelistedSenderWhichIsNotAssetRouter() public {
bytes memory txCalladata = abi.encodeCall(IAssetRouterBase.finalizeDeposit, (uint256(10), bytes32("0x12345"), bytes("0x23456")));
bytes memory txCalladata = abi.encodeCall(
IAssetRouterBase.finalizeDeposit,
(uint256(10), bytes32("0x12345"), bytes("0x23456"))
);
vm.startPrank(owner);
vm.mockCall(
bridgehub,
Expand Down Expand Up @@ -50,7 +53,10 @@ contract CheckTransactionTest is GatewayTransactionFiltererTest {

function test_TransactionAllowedFromWhitelistedSenderForChainBridging() public {
address stm = address(0x6060606);
bytes memory txCalladata = abi.encodeCall(IAssetRouterBase.finalizeDeposit, (uint256(10), bytes32("0x12345"), bytes("0x23456")));
bytes memory txCalladata = abi.encodeCall(
IAssetRouterBase.finalizeDeposit,
(uint256(10), bytes32("0x12345"), bytes("0x23456"))
);
vm.startPrank(owner);
vm.mockCall(
bridgehub,
Expand All @@ -74,9 +80,14 @@ contract CheckTransactionTest is GatewayTransactionFiltererTest {
}

function test_TransactionFailsWithInvalidSelectorEvenIfTheSenderIsAR() public {
bytes memory txCalladata = abi.encodeCall(IAssetRouterBase.setAssetHandlerAddressThisChain, (bytes32("0x12345"), address(0x01234567890123456789)));
bytes memory txCalladata = abi.encodeCall(
IAssetRouterBase.setAssetHandlerAddressThisChain,
(bytes32("0x12345"), address(0x01234567890123456789))
);
vm.prank(owner);
vm.expectRevert(abi.encodeWithSelector(InvalidSelector.selector, IAssetRouterBase.setAssetHandlerAddressThisChain.selector));
vm.expectRevert(
abi.encodeWithSelector(InvalidSelector.selector, IAssetRouterBase.setAssetHandlerAddressThisChain.selector)
);
bool isTxAllowed = transactionFiltererProxy.isTransactionAllowed(
assetRouter,
address(0),
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/contracts/L2GenesisUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {IL2GenesisUpgrade} from "./interfaces/IL2GenesisUpgrade.sol";
/// @author Matter Labs
/// @notice The l2 component of the genesis upgrade.
contract L2GenesisUpgrade is IL2GenesisUpgrade {
/// @notice The funciton that is delegateCalled from the complex upgrader.
/// @notice The function that is delegateCalled from the complex upgrader.
/// @dev It is used to set the chainId and to deploy the force deployments.
/// @param _chainId the chain id
/// @param _ctmDeployer the address of the ctm deployer
Expand Down
6 changes: 3 additions & 3 deletions system-contracts/contracts/interfaces/IMessageRoot.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
pragma solidity ^0.8.20;

/**
* @author Matter Labs
* @notice MessageRoot contract is responsible for storing and aggregating the roots of the batches from different chains into the MessageRoot.
* @custom:security-contact [email protected]
* @author Matter Labs
* @notice MessageRoot contract is responsible for storing and aggregating the roots of the batches from different chains into the MessageRoot.
* @custom:security-contact [email protected]
*/
interface IMessageRoot {
/// @notice The aggregated root of the batches from different chains.
Expand Down

0 comments on commit 633b3d0

Please sign in to comment.