Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundedgar committed Jun 13, 2024
1 parent bb8a0e2 commit da307d4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/deployment/2_creategenesis.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ async function main() {
const deployerInfo = await getAddressInfo(deployer.address);
genesis.push({
accountName: 'deployer',
balance: '0',
balance: '200000000000000000000000000',
nonce: deployerInfo.nonce.toString(),
address: deployer.address,
});
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/3_deployContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ async function main() {
proxyBridgeAddress,
ethers.constants.HashZero,
ethers.constants.HashZero,
{ gasLimit: 300000}, // required as native gas limit estimation would return a too low result
{ gasLimit: 300000 }, // required as native gas limit estimation would return a too low result
);
} catch (error) {
console.error('polygonZkEVMGlobalExitRoot initialization error', error.message);
Expand Down
6 changes: 2 additions & 4 deletions src/scripts/clearNextNonce.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* eslint-disable no-await-in-loop, no-use-before-define, no-lonely-if, import/no-dynamic-require, global-require */
/* eslint-disable no-console, no-inner-declarations, no-undef, import/no-unresolved, no-restricted-syntax */
const path = require('path');
const { ethers } = require('hardhat');
require('dotenv').config({ path: path.resolve(__dirname, '../.env') });
const common = require('../common/common');


async function main() {
const args = process.argv.slice(2);
const deploymentName = args[0];
Expand All @@ -17,7 +15,7 @@ async function main() {
const pendingTxCount = await currentProvider.getTransactionCount(deployer.address, 'pending');
const txCount = await currentProvider.getTransactionCount(deployer.address);

if (pendingTxCount == txCount) {
if (pendingTxCount === txCount) {
console.log('Nothing to clear');
return;
}
Expand All @@ -31,7 +29,7 @@ async function main() {
value: 0,
nonce: txCount,
// gasPrice: gasPrice,
gasLimit: 21000
gasLimit: 21000,
});

console.log('sending tx', tx);
Expand Down
19 changes: 11 additions & 8 deletions src/scripts/exportPK.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
var keythereum = require("keythereum");
/* eslint-disable no-console */

// Specify a data directory (optional; defaults to ~/.ethereum)
var datadir = "/home/ubuntu/zkevm/zkevm-config";
var file = datadir + "/" + "aggregator.keystore";
const keythereum = require('keythereum');

Check failure on line 3 in src/scripts/exportPK.js

View workflow job for this annotation

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

Unable to resolve path to module 'keythereum'

var addr = "0x5669c63e3b461cf50696ad0378fe2e66b982d4a7";
/*
* Specify a data directory (optional; defaults to ~/.ethereum)
* const datadir = '/home/ubuntu/zkevm/zkevm-config';
* const file = datadir + '/' + 'aggregator.keystore';
*/

const addr = '0x5669c63e3b461cf50696ad0378fe2e66b982d4a7';
// Synchronous
var keyObject = keythereum.importFromFile(addr);
const keyObject = keythereum.importFromFile(addr);

var privateKey = keythereum.recover("password", keyObject);
const privateKey = keythereum.recover('password', keyObject);
console.log(privateKey.toString('hex'));

12 changes: 7 additions & 5 deletions src/scripts/prepareSequencer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function main() {
}
const {
polygonZkEVMAddress,
polygonZkEVMBridgeAddress,
// polygonZkEVMBridgeAddress,
maticTokenAddress,
trustedSequencer,
} = deploymentOutput;
Expand All @@ -51,10 +51,12 @@ async function main() {
console.log('Approved zkevm by the sequencer to spend forkonomic tokens');
console.log('by the following tx: ', tx1.hash);

// const tx2 = await forkonomicToken.approve(polygonZkEVMBridgeAddress, ethers.constants.MaxUint256, { gasLimit: 100000 });
// await tx2.wait();
// console.log('Bridge also approved zkevm by the sequencer to spend forkonomic tokens');
// console.log('by the following tx: ', tx2.hash);
/*
* const tx2 = await forkonomicToken.approve(polygonZkEVMBridgeAddress, ethers.constants.MaxUint256, { gasLimit: 100000 });
* await tx2.wait();
* console.log('Bridge also approved zkevm by the sequencer to spend forkonomic tokens');
* console.log('by the following tx: ', tx2.hash);
*/
}

main().catch((e) => {
Expand Down

0 comments on commit da307d4

Please sign in to comment.