Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deployment script to consider forkPreparationTime #121

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ cache/
out/
.env
deployment/deploy_parameters.json
/src/deployment/genesis.json
artifacts/*
cache_hardhat/
.openzeppelin/
deployment/genesis.json
deployment/deploy_output.json

13 changes: 12 additions & 1 deletion contracts/interfaces/IForkingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ interface IForkingManager is IForkableStructure {
AddressPair globalExitRoot;
}

/**
* @notice Function to initialize the forking manager
* @param _zkEVM Address of the zkEVM contract
* @param _bridge Address of the bridge contract
* @param _forkonomicToken Address of the forkonomic token contract
* @param _parentContract Address of the parent contract
* @param _globalExitRoot Address of the global exit root contract
* @param _arbitrationFee Arbitration fee for the dispute
* @param _chainIdManager Address of the chainIdManager contract
* @param _forkPreparationTime Time to wait before the fork is initiated
*/
function initialize(
address _zkEVM,
address _bridge,
Expand All @@ -68,7 +79,7 @@ interface IForkingManager is IForkableStructure {
address _globalExitRoot,
uint256 _arbitrationFee,
address _chainIdManager,
uint256 _executionTimeForProposal
uint256 _forkPreparationTime
) external;

function initiateFork(
Expand Down
7 changes: 5 additions & 2 deletions src/deployment/3_deployContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async function main() {
'trustedSequencerURL',
'networkName',
'version',
'forkPreparationTime',
'trustedSequencer',
'chainID',
'admin',
Expand Down Expand Up @@ -72,6 +73,7 @@ async function main() {
trustedSequencerURL,
networkName,
version,
forkPreparationTime,
trustedSequencer,
chainID,
admin,
Expand Down Expand Up @@ -634,10 +636,10 @@ async function main() {
*/

const ifaceForkingManager = new ethers.utils.Interface([
'function initialize(address,address,address,address,address,uint256,address)',
'function initialize(address,address,address,address,address,uint256,address,uint256)',
]);
const dataCallInitializeForkingManager = ifaceForkingManager.encodeFunctionData(
'initialize(address,address,address,address,address,uint256,address)',
'initialize(address,address,address,address,address,uint256,address,uint256)',
[
polygonZkEVMContract.address,
polygonZkEVMBridgeContract.address,
Expand All @@ -646,6 +648,7 @@ async function main() {
polygonZkEVMGlobalExitRoot.address,
arbitrationFee,
chainIdManagerContract.address,
forkPreparationTime,
],
);
const forkingManagerInitializationTx = await deployer.sendTransaction({
Expand Down
1 change: 1 addition & 0 deletions src/deployment/deploy_parameters.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"trustedSequencerURL": "http://zkevm-json-rpc:8123",
"networkName": "fzkevm",
"version": "0.0.1",
"forkPreparationTime": "604800",
"trustedSequencer": "0x740a98F8f4fAe0986FB3264Fe4aaCf94ac1EE96f",
"chainID": 10101012,
"trustedAggregator": "0x740a98F8f4fAe0986FB3264Fe4aaCf94ac1EE96f",
Expand Down
96 changes: 0 additions & 96 deletions src/deployment/genesis.json

This file was deleted.