Skip to content

Commit

Permalink
various tweaks while trying to make stuff deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundedgar committed Apr 9, 2024
1 parent b500f67 commit e2e4d82
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 12 deletions.
13 changes: 13 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ module.exports = {
count: 20,
},
},
backstopTestnetAlice: {
url: "https://testnet.rpc.backstop.technology",
accounts: {
mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC,
path: "m/44'/60'/0'/0",
initialIndex: 0,
count: 20,
},
},

},
gasReporter: {
enabled: !!process.env.REPORT_GAS,
Expand All @@ -183,6 +193,9 @@ module.exports = {
zkEVMServices: {
'backstopTestnet0': {
bridgeAPIEndpoint: 'https://api.bridge.testnet.backstop.technology'
},
'backstopTestnetAlice': {
bridgeAPIEndpoint: 'https://testnet.api.bridge.backstop.technology'
}
},
etherscan: {
Expand Down
4 changes: 3 additions & 1 deletion src/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ async function loadProvider(deployParameters, env) {
}
let currentProvider = ethers.provider;
if (deployParameters.multiplierGas || deployParameters.maxFeePerGas) {
if (env.HARDHAT_NETWORK !== 'hardhat') {
if (env.HARDHAT_NETWORK === 'sepolia') {
currentProvider = new ethers.providers.JsonRpcProvider(`https://${env.HARDHAT_NETWORK}.infura.io/v3/${env.INFURA_PROJECT_ID}`);
console.log(currentProvider);

Check failure on line 23 in src/common/common.js

View workflow job for this annotation

GitHub Actions / Code linting (16.x, ubuntu-latest)

Expected indentation of 12 spaces but found 0
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 @@ -62,6 +63,7 @@ async function loadDeployer(currentProvider, deployParameters = {}, idx = '0') {
if (idx > 0) {
throw new Error('Multiple signers only supported with mnemonic');
}
console.log('Using getSigners');
[deployer] = (await ethers.getSigners());
}
return deployer;
Expand Down
6 changes: 5 additions & 1 deletion src/deployment/3_deployContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,9 @@ async function main() {
const proxyAdminFactory = await ethers.getContractFactory('ProxyAdmin', deployer);
const proxyAdminInstance = proxyAdminFactory.attach(proxyAdminAddress);
const proxyAdminOwner = await proxyAdminInstance.owner();

Check failure on line 650 in src/deployment/3_deployContracts.js

View workflow job for this annotation

GitHub Actions / Code linting (16.x, ubuntu-latest)

'proxyAdminOwner' is assigned a value but never used. Allowed unused vars must match /export^/u


Check failure on line 652 in src/deployment/3_deployContracts.js

View workflow job for this annotation

GitHub Actions / Code linting (16.x, ubuntu-latest)

More than 1 blank line not allowed
/*

Check failure on line 653 in src/deployment/3_deployContracts.js

View workflow job for this annotation

GitHub Actions / Code linting (16.x, ubuntu-latest)

Expected indentation of 4 spaces but found 0
const timelockContractFactory = await ethers.getContractFactory('PolygonZkEVMTimelock', deployer);

Check failure on line 654 in src/deployment/3_deployContracts.js

View workflow job for this annotation

GitHub Actions / Code linting (16.x, ubuntu-latest)

Expected a '*' at the start of this line

Check failure on line 655 in src/deployment/3_deployContracts.js

View workflow job for this annotation

GitHub Actions / Code linting (16.x, ubuntu-latest)

Expected a '*' at the start of this line
let timelockContract;

Check failure on line 656 in src/deployment/3_deployContracts.js

View workflow job for this annotation

GitHub Actions / Code linting (16.x, ubuntu-latest)

Expected a '*' at the start of this line
Expand Down Expand Up @@ -692,6 +695,7 @@ async function main() {
console.log('#######################');
console.log('minDelayTimelock:', await timelockContract.getMinDelay());
console.log('polygonZkEVM:', await timelockContract.polygonZkEVM());
*/

const outputJson = {
polygonZkEVMAddress: polygonZkEVMContract.address,
Expand All @@ -704,7 +708,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
4 changes: 2 additions & 2 deletions src/deployment/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fs = require('fs');
const { ethers } = require('hardhat');
require('dotenv').config({ path: path.resolve(__dirname, '../.env') });

const pathGenesisJson = path.join(__dirname, './deployment/genesis.json');
const pathGenesisJson = path.join(__dirname, './../deployment/genesis.json');

async function loadOngoingOrDeploy(deployer, contractName, ongoingName, args, ongoing, pathOngoing, externallyDeployedAddress) {
const contractFactory = await ethers.getContractFactory(contractName, {
Expand Down Expand Up @@ -50,5 +50,5 @@ function genesisAddressForContractName(contractName) {
}

module.exports = {
verifyDeploymentParameters, loadOngoingOrDeploy, genesisAddressForContractName,
loadOngoingOrDeploy, genesisAddressForContractName,
};
2 changes: 1 addition & 1 deletion src/deployment/deploy_parameters.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"trustedAggregator": "0x740a98F8f4fAe0986FB3264Fe4aaCf94ac1EE96f",
"trustedAggregatorTimeout": 604799,
"pendingStateTimeout": 604799,
"forkID": 5,
"forkID": 6,
"admin": "0x25F2d1651B631BE5334e2E5ebf29842b64aca361",
"zkEVMOwner": "0x25F2d1651B631BE5334e2E5ebf29842b64aca361",
"timelockAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
Expand Down
16 changes: 9 additions & 7 deletions src/deployment/verifyContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async function main() {
expect(error.message.toLowerCase().includes('already verified')).to.be.equal(true);
}

/*
// verify timelock
const { minDelayTimelock } = deployParameters;
const { timelockAddress } = deployParameters;
Expand All @@ -70,6 +71,7 @@ async function main() {
} catch (error) {
expect(error.message.toLowerCase().includes('already verified')).to.be.equal(true);
}
*/

// verify proxy admin
try {
Expand Down Expand Up @@ -141,7 +143,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
// expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

// verify global exit root address
Expand All @@ -153,7 +155,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
// expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

// verify global exit implementation address
Expand All @@ -166,7 +168,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
// expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

// verify bridge
Expand All @@ -183,7 +185,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
// expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

// verify bridge implementation address
Expand All @@ -196,7 +198,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
// expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

// verify forking manager
Expand All @@ -208,7 +210,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
// expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}

// verify fork manager implementation address
Expand All @@ -221,7 +223,7 @@ async function main() {
},
);
} catch (error) {
expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
// expect(error.message.toLowerCase().includes('proxyadmin')).to.be.equal(true);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/scripts/activateForcedTransactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ async function main() {
const deployer = await common.loadDeployer(currentProvider, deployParameters);

if (deployerAddress === undefined || deployerAddress.toLowerCase() !== deployer.address.toLowerCase()) {
console.log('Wrong deployer address', deployerAddress, deployer.address);
throw new Error('Wrong deployer address');
}

Expand Down

0 comments on commit e2e4d82

Please sign in to comment.