forked from 0xPolygonHermez/zkevm-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
eda2d5c
commit 00d6ea8
Showing
33 changed files
with
15,897 additions
and
19,362 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity 0.8.20; | ||
import "../PolygonRollupManager.sol"; | ||
|
||
/** | ||
* PolygonRollupManager mock | ||
*/ | ||
contract PolygonRollupManagerMock is PolygonRollupManager { | ||
/** | ||
* @param _globalExitRootManager Global exit root manager address | ||
* @param _pol MATIC token address | ||
* @param _bridgeAddress Bridge address | ||
*/ | ||
constructor( | ||
IPolygonZkEVMGlobalExitRoot _globalExitRootManager, | ||
IERC20Upgradeable _pol, | ||
IPolygonZkEVMBridge _bridgeAddress | ||
) PolygonRollupManager(_globalExitRootManager, _pol, _bridgeAddress) {} | ||
|
||
function initializeMock( | ||
address _trustedAggregator, | ||
uint64 _pendingStateTimeout, | ||
uint64 _trustedAggregatorTimeout, | ||
address admin, | ||
address timelock, | ||
address emergencyCouncil | ||
) external initializer { | ||
trustedAggregator = _trustedAggregator; | ||
pendingStateTimeout = _pendingStateTimeout; | ||
trustedAggregatorTimeout = _trustedAggregatorTimeout; | ||
|
||
// Constant deployment variables | ||
_batchFee = 0.1 ether; // 0.1 Matic | ||
verifyBatchTimeTarget = 30 minutes; | ||
multiplierBatchFee = 1002; | ||
|
||
// Initialize OZ contracts | ||
__AccessControl_init(); | ||
|
||
// setup roles | ||
|
||
// Timelock roles | ||
_setupRole(DEFAULT_ADMIN_ROLE, timelock); | ||
_setupRole(_ADD_ROLLUP_TYPE_ROLE, timelock); | ||
_setupRole(_ADD_EXISTING_ROLLUP_ROLE, timelock); | ||
|
||
// Even this role can only update to an already added verifier/consensus | ||
// Could break the compatibility of them, changing the virtual state | ||
// review | ||
_setupRole(_UPDATE_ROLLUP_ROLE, timelock); | ||
|
||
// Admin roles | ||
_setupRole(_OBSOLETE_ROLLUP_TYPE_ROLE, admin); | ||
_setupRole(_CREATE_ROLLUP_ROLE, admin); | ||
_setupRole(_STOP_EMERGENCY_ROLE, admin); | ||
_setupRole(_TRUSTED_AGGREGATOR_ROLE, admin); | ||
_setupRole(_TWEAK_PARAMETERS_ROLE, admin); | ||
|
||
// review Could be another address?¿ | ||
_setupRole(_SET_FEE_ROLE, admin); | ||
|
||
// Emergency council roles | ||
_setRoleAdmin(_EMERGENCY_COUNCIL_ROLE, _EMERGENCY_COUNCIL_ADMIN); | ||
_setupRole(_EMERGENCY_COUNCIL_ROLE, emergencyCouncil); | ||
_setupRole(_EMERGENCY_COUNCIL_ADMIN, emergencyCouncil); | ||
} | ||
} |
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.