Skip to content

Commit

Permalink
Merge pull request #314 from 0xPolygonHermez/feature/rm-versioning
Browse files Browse the repository at this point in the history
Add rollupManager initializer versioning
  • Loading branch information
ignasirv authored Aug 29, 2024
2 parents 47b8920 + 86f3c01 commit c263786
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 75 deletions.
15 changes: 15 additions & 0 deletions contracts/v2/PolygonRollupManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ contract PolygonRollupManager is
bytes32 internal constant _EMERGENCY_COUNCIL_ADMIN =
keccak256("EMERGENCY_COUNCIL_ADMIN");

// Current rollup manager version
string public constant ROLLUP_MANAGER_VERSION = "pessimistic";

// Global Exit Root address
IPolygonZkEVMGlobalExitRootV2 public immutable globalExitRootManager;

Expand Down Expand Up @@ -382,6 +385,11 @@ contract PolygonRollupManager is
*/
event SetBatchFee(uint256 newBatchFee);

/**
* @dev Emitted when rollup manager is upgraded
*/
event UpdateRollupManagerVersion(string rollupManagerVersion);

/**
* @param _globalExitRootManager Global exit root manager address
* @param _pol POL token address
Expand All @@ -400,6 +408,13 @@ contract PolygonRollupManager is
_disableInitializers();
}

/**
* Initializer function to set new rollup manager version
*/
function initialize() external virtual reinitializer(3) {
emit UpdateRollupManagerVersion(ROLLUP_MANAGER_VERSION);
}

///////////////////////////////////////
// Rollups management functions
///////////////////////////////////////
Expand Down
75 changes: 0 additions & 75 deletions contracts/v2/mocks/PolygonRollupManagerMockInternalTest.sol

This file was deleted.

2 changes: 2 additions & 0 deletions test/contractsv2/PolygonRollupManager-Pessimistic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ describe("Polygon Rollup Manager with Polygon Pessimistic Consensus", () => {
emergencyCouncil.address
);

await expect(rollupManagerContract.initialize()).to.emit(rollupManagerContract, "UpdateRollupManagerVersion")

// fund sequencer address with Matic tokens
await polTokenContract.transfer(trustedSequencer.address, ethers.parseEther("1000"));
});
Expand Down

0 comments on commit c263786

Please sign in to comment.