Skip to content

Commit

Permalink
test: added registerValidatorsWithKeystore
Browse files Browse the repository at this point in the history
- integrated ssv-keys
- added a new folder named keystore, encompass the test-keystore.json, operatorIds.json, operatorKeys.json
- added new function registerValidatorsWithKeystore in contract-helpers.ts
- added test case in register.ts
- used Prettier plugin to beautify and format Solidity & Typescript
  • Loading branch information
Mohsen-T committed Nov 8, 2023
1 parent f7e59b9 commit 8479582
Show file tree
Hide file tree
Showing 9 changed files with 12,181 additions and 5,744 deletions.
65 changes: 35 additions & 30 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dotenv/config';

import { HardhatUserConfig } from 'hardhat/config';
import { NetworkUserConfig } from "hardhat/types";
import { NetworkUserConfig } from 'hardhat/types';
import '@nomicfoundation/hardhat-toolbox';
import '@openzeppelin/hardhat-upgrades';
import 'hardhat-tracer';
Expand All @@ -14,60 +14,65 @@ import './tasks/upgrade';

type SSVNetworkConfig = NetworkUserConfig & {
ssvToken: string;
}

};

const config: HardhatUserConfig = {
// Your type-safe config goes here
mocha: {
timeout: 40000000000000000
timeout: 40000000000000000,
},
solidity: {
compilers: [
{
version: "0.8.4",
version: '0.8.4',
},
{
version: '0.8.18',
settings: {
optimizer: {
enabled: true,
runs: 10000
}
}
}
runs: 10000,
},
},
},
],
},
networks: {
ganache: {
chainId: 1337,
url: "http://127.0.0.1:8585",
ssvToken: process.env.SSVTOKEN_ADDRESS // if empty, deploy SSV mock token
url: 'http://127.0.0.1:8585',
ssvToken: process.env.SSVTOKEN_ADDRESS, // if empty, deploy SSV mock token
} as SSVNetworkConfig,
hardhat: {
allowUnlimitedContractSize: true
}
allowUnlimitedContractSize: true,
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: process.env.ETHERSCAN_KEY,
customChains: [
{
network: "holesky",
network: 'holesky',
chainId: 17000,
urls: {
apiURL: "https://api-holesky.etherscan.io/api",
browserURL: "https://holesky.etherscan.io"
}
}
]
apiURL: 'https://api-holesky.etherscan.io/api',
browserURL: 'https://holesky.etherscan.io',
},
},
],
},
gasReporter: {
enabled: true,
currency: 'USD',
gasPrice: 0.3
}
gasPrice: 0.3,
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
strict: false,
},
};

if (process.env.GOERLI_ETH_NODE_URL) {
Expand All @@ -82,13 +87,13 @@ if (process.env.GOERLI_ETH_NODE_URL) {
...config.networks,
goerli_development: {
...sharedConfig,
ssvToken: '0x6471F70b932390f527c6403773D082A0Db8e8A9F'
ssvToken: '0x6471F70b932390f527c6403773D082A0Db8e8A9F',
} as SSVNetworkConfig,
goerli_testnet: {
...sharedConfig,
ssvToken: '0x3a9f01091C446bdE031E39ea8354647AFef091E7'
ssvToken: '0x3a9f01091C446bdE031E39ea8354647AFef091E7',
} as SSVNetworkConfig,
}
};
}

if (process.env.HOLESKY_ETH_NODE_URL) {
Expand All @@ -103,13 +108,13 @@ if (process.env.HOLESKY_ETH_NODE_URL) {
...config.networks,
holesky_development: {
...sharedConfig,
ssvToken: '0x68A8DDD7a59A900E0657e9f8bbE02B70c947f25F'
ssvToken: '0x68A8DDD7a59A900E0657e9f8bbE02B70c947f25F',
} as SSVNetworkConfig,
holesky_testnet: {
...sharedConfig,
ssvToken: '0xad45A78180961079BFaeEe349704F411dfF947C6'
ssvToken: '0xad45A78180961079BFaeEe349704F411dfF947C6',
} as SSVNetworkConfig,
}
};
}

if (process.env.MAINNET_ETH_NODE_URL) {
Expand All @@ -121,9 +126,9 @@ if (process.env.MAINNET_ETH_NODE_URL) {
accounts: [`0x${process.env.MAINNET_OWNER_PRIVATE_KEY}`],
gasPrice: +(process.env.GAS_PRICE || ''),
gas: +(process.env.GAS || ''),
ssvToken: '0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54'
} as SSVNetworkConfig
}
ssvToken: '0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54',
} as SSVNetworkConfig,
};
}

export default config;
Loading

0 comments on commit 8479582

Please sign in to comment.