add scripts for all deploy

This commit is contained in:
q1q0 2023-08-18 09:01:28 -04:00
parent e3a4f34021
commit 4c61d904b7
5 changed files with 12667 additions and 19 deletions

View File

@ -1,6 +1,6 @@
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-ethers";
import "@tenderly/hardhat-tenderly";
// import "@tenderly/hardhat-tenderly";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-web3";
import "hardhat-deploy";
@ -69,7 +69,7 @@ function getNetworkUrl(networkType: string) {
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const config: HardhatUserConfig = {
const config: any = {
solidity: {
compilers: [
{
@ -124,7 +124,7 @@ const config: HardhatUserConfig = {
arbitrumOne: String(process.env.ARB_ETHSCAN_KEY),
avalanche: String(process.env.AVAX_ETHSCAN_KEY),
opera: String(process.env.FTM_ETHSCAN_KEY),
// base: String(process.env.BASE_ETHSCAN_KEY),
base: String(process.env.BASE_ETHSCAN_KEY),
},
customChains: [
{
@ -132,7 +132,7 @@ const config: HardhatUserConfig = {
chainId: 8453,
urls: {
apiURL: "https://api.basescan.org/api",
browserURL: "https://basescan.org",
browserURL: "https://basescan.org"
}
}
]

View File

@ -8,7 +8,8 @@
"coverage": "./node_modules/.bin/solidity-coverage",
"check": "ts-node status-checks/huskyCheck.ts",
"check-husky": "ts-node status-checks/huskyCheck.ts",
"deploy": "ts-node scripts/deployConnectorsFromCmd.ts",
"deploy": "ts-node --files scripts/deploy.ts",
"deployAll": "hardhat run scripts/deployment/deployConnectorsFromCmdAll.ts",
"test:runner": "NODE_OPTIONS='--max-old-space-size=4096' hardhat run scripts/tests/run-tests.ts",
"typechain": "hardhat typechain",
"compile": "hardhat compile",
@ -43,7 +44,7 @@
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.3",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@nomiclabs/hardhat-web3": "^2.0.0",
"@openzeppelin/test-helpers": "^0.5.15",

View File

@ -28,19 +28,20 @@ export const connectMapping: Record<string, any> = {
export const connectors: Record<string, Array<string>> = {
mainnet: [
"1INCH-A",
"1INCH-B",
"AAVE-V1-A",
"AAVE-V2-A",
"AUTHORITY-A",
"BASIC-A",
"COMP-A",
"COMPOUND-A",
"DYDX-A",
"FEE-A",
"GELATO-A",
"MAKERDAO-A",
"UNISWAP-A",
'ConnectV2ZeroEx',
'ConnectV2ApproveTokens',
'ConnectV2Auth',
'ConnectV2Basic',
'ConnectV2BasicERC721',
'ConnectV2BasicERC1155',
'ConnectV2CompoundV3',
'ConnectV2CompoundV3Rewards',
'ConnectV2InstaDexSimulation',
'ConnectV2DSASpell',
'ConnectV2SwapAggregator',
'ConnectV2UniswapV3',
'ConnectV2UniswapV3AutoRouter',
'ConnectV2UniswapV3Swap',
],
polygon: [
"QUICKSWAP-A",
@ -50,4 +51,20 @@ export const connectors: Record<string, Array<string>> = {
"1INCH-V4",
],
avalanche: ["ZEROEX-A"],
base: [
'ConnectV2ZeroExBase',
'ConnectV2ApproveTokensBase',
'ConnectV2AuthBase',
'ConnectV2BasicBase',
'ConnectV2BasicERC721Base',
'ConnectV2BasicERC1155Base',
'ConnectV2CompoundV3Base',
'ConnectV2CompoundV3RewardsBase',
'ConnectV2InstaDexSimulationBase',
'ConnectV2DSASpellBase',
'ConnectV2SwapAggregatorBase',
'ConnectV2UniswapV3Base',
'ConnectV2UniswapV3AutoRouterBase',
'ConnectV2UniswapV3SwapBase',
],
};

View File

@ -0,0 +1,86 @@
import { execScript } from "../tests/command";
import inquirer from "inquirer";
import { connectors, connectMapping } from "./connectors";
import { join } from "path";
let start: number, end: number, runchain: string;
// async function connectorSelect(chain: string) {
// let { connector } = await inquirer.prompt([
// {
// name: "connector",
// message: "Which connector do you want to deploy?",
// type: "list",
// choices: connectors[chain],
// },
// ]);
// return connector;
// }
async function deployRunner() {
let { chain } = await inquirer.prompt([
{
name: "chain",
message: "What chain do you want to deploy on?",
type: "list",
choices: ["mainnet", "polygon", "avalanche", "arbitrum", "optimism", "fantom", "base"]
}
]);
// let connector = await connectorSelect(chain);
// let { choice } = await inquirer.prompt([
// {
// name: "choice",
// message: "Do you wanna select again?",
// type: "list",
// choices: ["yes", "no"],
// },
// ]);
// if (choice === "yes") {
// connector = await connectorSelect(chain);
// }
// connector = connectMapping[chain][connector];
let { choice } = await inquirer.prompt([
{
name: "choice",
message: "Do you wanna try deploy on hardhat first?",
type: "list",
choices: ["yes", "no"]
}
]);
runchain = choice === "yes" ? "hardhat" : chain;
console.log(`Deploying on ${runchain}, press (ctrl + c) to stop`);
start = Date.now();
for (let i = 0; i < connectors[chain].length; i++) {
try {
await execScript({
cmd: "npx",
args: ["hardhat", "run", "scripts/deployment/deploy.ts", "--network", `${runchain}`],
env: {
connectorName: connectors[chain][i],
networkType: chain
}
});
} catch(e) {
console.error(`Failed of ${connectors[chain][i]} connector`)
}
}
end = Date.now();
}
deployRunner()
.then(() => {
console.log(`Done successfully, total time taken: ${(end - start) / 1000} sec`);
process.exit(0);
})
.catch((err) => {
console.log("error:", err);
process.exit(1);
});

12544
yarn.lock Normal file

File diff suppressed because it is too large Load Diff