-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
181 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import {IArbitrator} from "../interfaces/IArbitrator.sol"; | ||
import {IL1Gateway} from "../interfaces/IL1Gateway.sol"; | ||
|
||
abstract contract L1BaseGateway is IL1Gateway, UUPSUpgradeable { | ||
abstract contract L1BaseGateway is IL1Gateway { | ||
/// @notice The arbitrator to confirm synchronization | ||
IArbitrator public arbitrator; | ||
IArbitrator public immutable arbitrator; | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[49] private __gap; | ||
uint256[50] private __gap; | ||
|
||
/// @dev Modifier to make sure the caller is the known arbitrator. | ||
modifier onlyArbitrator() { | ||
require(msg.sender == address(arbitrator), "Not arbitrator"); | ||
_; | ||
} | ||
|
||
function __L1BaseGateway_init(IArbitrator _arbitrator) internal onlyInitializing { | ||
__UUPSUpgradeable_init(); | ||
__L1BaseGateway_init_unchained(_arbitrator); | ||
} | ||
|
||
function __L1BaseGateway_init_unchained(IArbitrator _arbitrator) internal onlyInitializing { | ||
constructor(IArbitrator _arbitrator) { | ||
arbitrator = _arbitrator; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,26 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import {IL2Gateway} from "../interfaces/IL2Gateway.sol"; | ||
|
||
abstract contract L2BaseGateway is IL2Gateway, UUPSUpgradeable { | ||
abstract contract L2BaseGateway is IL2Gateway { | ||
/// @notice The zkLink contract | ||
address public zkLink; | ||
address public immutable zkLink; | ||
|
||
/** | ||
* @dev This empty reserved space is put in place to allow future versions to add new | ||
* variables without shifting down storage in the inheritance chain. | ||
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps | ||
*/ | ||
uint256[49] private __gap; | ||
uint256[50] private __gap; | ||
|
||
/// @dev Ensure withdraw come from zkLink | ||
modifier onlyZkLink() { | ||
require(msg.sender == zkLink, "Not zkLink contract"); | ||
_; | ||
} | ||
|
||
function __L2BaseGateway_init(address _zkLink) internal onlyInitializing { | ||
__UUPSUpgradeable_init(); | ||
__L2BaseGateway_init_unchained(_zkLink); | ||
} | ||
|
||
function __L2BaseGateway_init_unchained(address _zkLink) internal onlyInitializing { | ||
constructor(address _zkLink) { | ||
zkLink = _zkLink; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.