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

Feature/update upgrade script #79

Merged
merged 4 commits into from
Jan 9, 2023
Merged

Conversation

invocamanman
Copy link
Collaborator

  • Upgrade script hackmd updated

Copy link
Contributor

@ignasirv ignasirv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯


## Notes

- `gensis.json` has been generated using the tool: `https://github.com/0xPolygonHermez/zkevm-commonjs/blob/main/tools/fill-genesis/create-genesis.js` using as generator file: `genesis-gen.json`
- `gensis.json` has been generated using the tool: `src/create-genesis.js` using as generator file: `genesis-gen.json`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `gensis.json` has been generated using the tool: `src/create-genesis.js` using as generator file: `genesis-gen.json`
- `genesis.json` has been generated using the tool: `src/create-genesis.js` using as generator file: `genesis-gen.json`

- Update the `polygonZkEVMFactory` with the new implementation contract you want to upgrade
- Run the script

Otherwise, inc ase of timelock use `timeLockUpgrade.js`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Otherwise, inc ase of timelock use `timeLockUpgrade.js`
Otherwise, in case of timelock use `timeLockUpgrade.js`

- Update the `minDelay` with the delay that you want to use
- Run the script
- Now the necessary transactions to interact with the timelock are printed in the screen `schedule` and `execute`
- With the owner of the timelock ( multisig or account), send the data printed by `schedule` to the `Timelock` contract.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- With the owner of the timelock ( multisig or account), send the data printed by `schedule` to the `Timelock` contract.
- With the owner of the timelock (multisig or account), send the data printed by `schedule` to the `Timelock` contract.

- Run the script
- Now the necessary transactions to interact with the timelock are printed in the screen `schedule` and `execute`
- With the owner of the timelock ( multisig or account), send the data printed by `schedule` to the `Timelock` contract.
- Once the necessary timeout has pass, with the same account you can now send the data printed by `execute` to the `Timelock` contract and the contracts will be upgraded.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Once the necessary timeout has pass, with the same account you can now send the data printed by `execute` to the `Timelock` contract and the contracts will be upgraded.
- Once the necessary timeout has expired, with the same account you can now send the data printed by `execute` to the `Timelock` contract and the contracts will be upgraded.

@@ -27,24 +27,15 @@ async function main() {
// compìle contracts
await hre.run('compile');

const polygonZkEVMProxyAddress = '0xfefefefefefefefefefefefee';
const polygonZkEVMFactory = await ethers.getContractFactory('PolygonZkEVMMock');
const proxyPolygonAddress = '0xfefefefefefefefefefefefee';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter should be loaded by cli or input-upgrade.json

@@ -27,23 +27,26 @@ async function main() {
// compìle contracts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output with upgrade information should be provided as well in json format

@krlosMata krlosMata self-requested a review January 9, 2023 08:13
minDelay,
],
);
// Executre operation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Executre operation
// Execute operation

const output = [];

// Upgrade zkevm
for (const upgrade of upgradeParameters.upgrades) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would check in advance upgrade.contractName existence

Copy link
Contributor

@krlosMata krlosMata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😸

@krlosMata krlosMata merged commit 2f01a03 into develop Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants