-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from 0xPolygonHermez/develop
Develop
- Loading branch information
Showing
10 changed files
with
568 additions
and
1,590 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -34,6 +34,7 @@ module.exports = { | |
enabled: true, | ||
runs: 999999, | ||
}, | ||
evmVersion: "shanghai", | ||
}, | ||
}, | ||
{ | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
input.json |
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,33 @@ | ||
# Regenerate upgrade info | ||
|
||
## pre-requisites | ||
- move to the commit where the last upgrade has been done | ||
- delete folder `artifacts` and `cache` folder | ||
|
||
## set project root environment variables | ||
- `cp .env.example .env` in root folder and set your own variables | ||
|
||
## input variables | ||
- copy input.example.json into your input file and fill in with your parameters: | ||
- `cp upgrade/tool-regen-upgrade-info/input.example.json upgrade/tool-regen-upgrade-info/input.json` | ||
|
||
- input parameters: | ||
``` | ||
{ | ||
"proxyAddress": "0x012345", | ||
"implementationName": "PolygonZkEVMUpgraded", | ||
"constructorArgs": [ | ||
"0x6407cf296a27B38fd29c401518504D388F1DFB3d", | ||
"0xF1b13757bcF3EF902a7847f409A6068BA43a89D4", | ||
"0xeDB618947F59FC5caA8bc9c24283807FDdAf6E2c", | ||
"0xcFA773Cc48FBde3CA4D24eeCb19D224d697026b2", | ||
1440, | ||
3 | ||
] | ||
} | ||
``` | ||
|
||
## run the script | ||
- Run the following commands from the root repository: | ||
- command: `npx hardhat run regenerate-upgrade-info.js --network {networkName}` | ||
- output: create `.openzeppelin` folder with `${networkName}.json` |
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,12 @@ | ||
{ | ||
"proxyAddress": "0x012345", | ||
"implementationName": "PolygonZkEVMUpgraded", | ||
"constructorArgs": [ | ||
"0x6407cf296a27B38fd29c401518504D388F1DFB3d", | ||
"0xF1b13757bcF3EF902a7847f409A6068BA43a89D4", | ||
"0xeDB618947F59FC5caA8bc9c24283807FDdAf6E2c", | ||
"0xcFA773Cc48FBde3CA4D24eeCb19D224d697026b2", | ||
1440, | ||
3 | ||
] | ||
} |
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,25 @@ | ||
/* eslint-disable no-await-in-loop */ | ||
/* eslint-disable no-console, no-inner-declarations, no-undef, import/no-unresolved */ | ||
const { ethers, upgrades } = require('hardhat'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
// require('dotenv').config({ path: path.resolve(__dirname, '../.env') }); | ||
|
||
async function main() { | ||
// load input file | ||
const input = JSON.parse(fs.readFileSync(path.resolve(__dirname, './input.json'))); | ||
|
||
// Load implementation contract | ||
const PolygonZkEVMFactory = await ethers.getContractFactory(input.implementationName, ethers.provider); | ||
|
||
// Import OZ upgrades | ||
await upgrades.forceImport(input.proxyAddress, PolygonZkEVMFactory, { | ||
kind: 'transparent', | ||
constructorArgs: input.constructorArgs, | ||
}); | ||
} | ||
|
||
main().catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |