-
Notifications
You must be signed in to change notification settings - Fork 385
Expand file tree
/
Copy pathIAgglayerBridgeL2.sol
More file actions
173 lines (144 loc) · 4.8 KB
/
IAgglayerBridgeL2.sol
File metadata and controls
173 lines (144 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.20;
import "./IBaseLegacyAgglayerGER.sol";
import "./IAgglayerBridge.sol";
interface IAgglayerBridgeL2 is IAgglayerBridge {
/**
* @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 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 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();
/**
* @dev Thrown when trying to unset a not setted claim
*/
error ClaimNotSet();
/**
* @dev Thrown when trying to activate emergency state in a not allowed bridge context (e.g. sovereign chains)
*/
error EmergencyStateNotAllowed();
/**
* @dev Thrown when trying to initialize a sovereign bridge with a zero network ID, reserved for mainnet
*/
error InvalidZeroNetworkID();
/**
* @dev Thrown when an invalid deposit count is provided for LET operations
*/
error InvalidDepositCount();
/**
* @dev Thrown when the leaves array length doesn't match the expected deposit count
*/
error InvalidLeavesLength();
/**
* @dev Thrown when a leaf has an invalid leafType (must be _LEAF_TYPE_ASSET or _LEAF_TYPE_MESSAGE)
*/
error InvalidLeafType();
/**
* @dev Thrown when the expected Local Exit Root doesn't match the computed root
*/
error InvalidExpectedLER();
/**
* @dev Thrown when the subtree frontier doesn't match the parent tree structure
*/
error InvalidSubtreeFrontier();
/**
* @dev Thrown when trying set a LBT leaf with same origin network than chain network ID
*/
error InvalidLBTLeaf();
/**
@dev Thrown when trying to subtract more rather than available balance
*/
error LocalBalanceTreeUnderflow(
uint32 originNetwork,
address originTokenAddress,
uint256 amount,
uint256 localBalanceTreeAmount
);
/**
@dev Thrown when trying to add an amount over the maximum allowed balance
*/
error LocalBalanceTreeOverflow(
uint32 originNetwork,
address originTokenAddress,
uint256 amount,
uint256 localBalanceTreeAmount
);
/**
* @dev Thrown when the caller is not the globalExitRootRemover
*/
error OnlyGlobalExitRootRemover();
/**
* @dev Thrown when the caller is not the emergencyBridgePauser address
*/
error OnlyEmergencyBridgePauser();
/**
* @dev Thrown when trying to call a function that only the pending bridge pauser can call.
*/
error OnlyPendingEmergencyBridgePauser();
/**
* @dev Thrown when the caller is not the emergencyBridgeUnpauser address
*/
error OnlyEmergencyBridgeUnpauser();
/**
* @dev Thrown when trying to call a function that only pending bridge unpauser can call.
*/
error OnlyPendingEmergencyBridgeUnpauser();
/**
* @dev Thrown when the caller is not the deployer
*/
error OnlyDeployer();
/**
* @dev Thrown when the caller is not phantom claim manager
*/
error OnlyPhantomClaimManager();
/**
* @dev Thrown when attempting to set a phantom claim for a globalIndex that already maps to a different leaf
* and the override flag is not set to true
*/
error PhantomGlobalIndexInvalid();
function initialize(
uint32 _networkID,
address _gasTokenAddress,
uint32 _gasTokenNetwork,
IBaseLegacyAgglayerGER _globalExitRootManager,
address _polygonRollupManager,
bytes memory _gasTokenMetadata,
address _bridgeManager,
address sovereignWETHAddress,
bool _sovereignWETHAddressIsNotMintable,
address _emergencyBridgePauser,
address _emergencyBridgeUnpauser,
address _proxiedTokensManager
) external;
}