-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from 0xPolygonHermez/feature/sovereign-bridge
Sovereign bridge implementation
- Loading branch information
Showing
28 changed files
with
8,448 additions
and
1,636 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ typechain-types/ | |
create_rollup_parameters.json | ||
|
||
docker/deploymentOutput | ||
|
||
.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
|
||
pragma solidity ^0.8.20; | ||
import "../../interfaces/IBasePolygonZkEVMGlobalExitRoot.sol"; | ||
import "./IPolygonZkEVMBridgeV2.sol"; | ||
|
||
interface IBridgeL2SovereignChains is IPolygonZkEVMBridgeV2 { | ||
/** | ||
* @dev Thrown when try to set a zero address to a non valid zero address field | ||
*/ | ||
error InvalidZeroAddress(); | ||
|
||
/** | ||
* @dev Thrown when the origin network is invalid | ||
*/ | ||
error OriginNetworkInvalid(); | ||
|
||
/** | ||
* @dev Thrown when sender is not the bridge manager | ||
* @notice Bridge manager can set custom mapping for any token | ||
*/ | ||
error OnlyBridgeManager(); | ||
|
||
/** | ||
* @dev Thrown when bridge manager address is invalid | ||
*/ | ||
error NotValidBridgeManager(); | ||
|
||
/** | ||
* @dev Thrown when trying to remove a token mapping that has not been updated by a new one | ||
*/ | ||
error TokenNotMapped(); | ||
|
||
/** | ||
* @dev Thrown when trying to migrate a legacy token that is already the current token | ||
*/ | ||
error TokenAlreadyUpdated(); | ||
|
||
/** | ||
* @dev Thrown when initializing sovereign bridge with invalid sovereign WETH token params | ||
*/ | ||
error InvalidSovereignWETHAddressParams(); | ||
|
||
/** | ||
* @dev Thrown when initializing sovereign bridge with invalid sovereign WETH token params | ||
*/ | ||
error InvalidInitializeFunction(); | ||
|
||
/** | ||
* @dev Thrown when initializing calling a function with invalid arrays length | ||
*/ | ||
error InputArraysLengthMismatch(); | ||
|
||
/** | ||
* @dev Thrown when trying to map a token that is already mapped | ||
*/ | ||
error TokenAlreadyMapped(); | ||
|
||
/** | ||
* @dev Thrown when trying to remove a legacy mapped token that has nor previously been remapped | ||
*/ | ||
error TokenNotRemapped(); | ||
|
||
/** | ||
* @dev Thrown when trying to set a custom wrapper for weth on a gas token network | ||
*/ | ||
error WETHRemappingNotSupportedOnGasTokenNetworks(); | ||
|
||
|
||
function initialize( | ||
uint32 _networkID, | ||
address _gasTokenAddress, | ||
uint32 _gasTokenNetwork, | ||
IBasePolygonZkEVMGlobalExitRoot _globalExitRootManager, | ||
address _polygonRollupManager, | ||
bytes memory _gasTokenMetadata, | ||
address _bridgeManager, | ||
address sovereignWETHAddress, | ||
bool _sovereignWETHAddressIsNotMintable | ||
) external; | ||
} |
Oops, something went wrong.