Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundedgar committed Apr 25, 2024
1 parent 7d97113 commit e189c0a
Showing 1 changed file with 59 additions and 55 deletions.
114 changes: 59 additions & 55 deletions src/deployment/3_deployContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ async function main() {
pendingStateTimeout,
forkID,
zkEVMOwner,
timelockAddress,
minDelayTimelock,
/*
* timelockAddress,
* minDelayTimelock,
*/
salt,
zkEVMDeployerAddress,
maticTokenAddress,
Expand All @@ -101,7 +103,8 @@ async function main() {
} else {
if (deployParameters.multiplierGas || deployParameters.maxFeePerGas) {
if (process.env.HARDHAT_NETWORK !== 'hardhat') {
currentProvider = new ethers.providers.JsonRpcProvider(`https://${process.env.HARDHAT_NETWORK}.infura.io/v3/${process.env.INFURA_PROJECT_ID}`);
// currentProvider = new ethers.providers.JsonRpcProvider(`https://${process.env.HARDHAT_NETWORK}.infura.io/v3/${process.env.INFURA_PROJECT_ID}`);
currentProvider = new ethers.providers.JsonRpcProvider('http://sepolia.backstop.technology');
if (deployParameters.maxPriorityFeePerGas && deployParameters.maxFeePerGas) {
console.log(`Hardcoded gas used: MaxPriority${deployParameters.maxPriorityFeePerGas} gwei, MaxFee${deployParameters.maxFeePerGas} gwei`);
const FEE_DATA = {
Expand Down Expand Up @@ -608,7 +611,7 @@ async function main() {
parentContract,
minter,
'Forkonomic Token',
'FORK',
'ZBS',
);
}
} catch (e) {
Expand Down Expand Up @@ -645,57 +648,58 @@ async function main() {
* expect(await upgrades.erc1967.getAdminAddress(forkingManagerContract.address)).to.be.equal(proxyAdminAddress);
*/

const proxyAdminFactory = await ethers.getContractFactory('ProxyAdmin', deployer);
const proxyAdminInstance = proxyAdminFactory.attach(proxyAdminAddress);
const proxyAdminOwner = await proxyAdminInstance.owner();


/*
const timelockContractFactory = await ethers.getContractFactory('PolygonZkEVMTimelock', deployer);
let timelockContract;
if (proxyAdminOwner !== deployer.address) {
// Check if there's a timelock deployed there that match the current deployment
timelockContract = timelockContractFactory.attach(proxyAdminOwner);
expect(precalculateZkevmAddress).to.be.equal(await timelockContract.polygonZkEVM());
console.log('#######################\n');
console.log(
'Polygon timelockContract already deployed to:',
timelockContract.address,
);
} else {
// deploy timelock
console.log('\n#######################');
console.log('##### Deployment TimelockContract #####');
console.log('#######################');
console.log('minDelayTimelock:', minDelayTimelock);
console.log('timelockAddress:', timelockAddress);
console.log('zkEVMAddress:', polygonZkEVMContract.address);
timelockContract = await timelockContractFactory.deploy(
minDelayTimelock,
[timelockAddress],
[timelockAddress],
timelockAddress,
polygonZkEVMContract.address,
);
await timelockContract.deployed();
console.log('#######################\n');
console.log(
'Polygon timelockContract deployed to:',
timelockContract.address,
);
// Transfer ownership of the proxyAdmin to timelock
await upgrades.admin.transferProxyAdminOwnership(timelockContract.address);
}
/*
* const proxyAdminFactory = await ethers.getContractFactory('ProxyAdmin', deployer);
* const proxyAdminInstance = proxyAdminFactory.attach(proxyAdminAddress);
* const proxyAdminOwner = await proxyAdminInstance.owner();
*/

console.log('\n#######################');
console.log('##### Checks TimelockContract #####');
console.log('#######################');
console.log('minDelayTimelock:', await timelockContract.getMinDelay());
console.log('polygonZkEVM:', await timelockContract.polygonZkEVM());
*/
/*
*const timelockContractFactory = await ethers.getContractFactory('PolygonZkEVMTimelock', deployer);
*
*let timelockContract;
*if (proxyAdminOwner !== deployer.address) {
* // Check if there's a timelock deployed there that match the current deployment
* timelockContract = timelockContractFactory.attach(proxyAdminOwner);
* expect(precalculateZkevmAddress).to.be.equal(await timelockContract.polygonZkEVM());
*
* console.log('#######################\n');
* console.log(
* 'Polygon timelockContract already deployed to:',
* timelockContract.address,
* );
*} else {
* // deploy timelock
* console.log('\n#######################');
* console.log('##### Deployment TimelockContract #####');
* console.log('#######################');
* console.log('minDelayTimelock:', minDelayTimelock);
* console.log('timelockAddress:', timelockAddress);
* console.log('zkEVMAddress:', polygonZkEVMContract.address);
* timelockContract = await timelockContractFactory.deploy(
* minDelayTimelock,
* [timelockAddress],
* [timelockAddress],
* timelockAddress,
* polygonZkEVMContract.address,
* );
* await timelockContract.deployed();
* console.log('#######################\n');
* console.log(
* 'Polygon timelockContract deployed to:',
* timelockContract.address,
* );
*
* // Transfer ownership of the proxyAdmin to timelock
* await upgrades.admin.transferProxyAdminOwnership(timelockContract.address);
*}
*
*console.log('\n#######################');
*console.log('##### Checks TimelockContract #####');
*console.log('#######################');
*console.log('minDelayTimelock:', await timelockContract.getMinDelay());
*console.log('polygonZkEVM:', await timelockContract.polygonZkEVM());
*/

const outputJson = {
polygonZkEVMAddress: polygonZkEVMContract.address,
Expand All @@ -708,7 +712,7 @@ async function main() {
verifierAddress: verifierContract.address,
zkEVMDeployerContract: zkEVMDeployerContract.address,
deployerAddress: deployer.address,
//timelockContractAddress: timelockContract.address,
// timelockContractAddress: timelockContract.address,
deploymentBlockNumber,
genesisRoot: genesisRootHex,
trustedSequencer,
Expand Down

0 comments on commit e189c0a

Please sign in to comment.