@matterlabs/hardhat-zksync-deploy
Version:
Hardhat plugin to deploy smart contracts into the ZKsync network
71 lines • 4.46 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = require("hardhat/config");
const chalk_1 = __importDefault(require("chalk"));
const argumentTypes_1 = require("hardhat/internal/core/params/argumentTypes");
const task_names_1 = require("./task-names");
require("./type-extensions");
const task_actions_1 = require("./task-actions");
const constants_1 = require("./constants");
const deployer_extension_1 = require("./deployer-extension");
const config_env_1 = require("./core/config-env");
__exportStar(require("./deployer"), exports);
require("@matterlabs/hardhat-zksync-telemetry");
(0, config_1.extendConfig)((config, userConfig) => {
config.paths.deployPaths = userConfig.paths?.deployPaths ?? constants_1.DEFAULT_DEPLOY_SCRIPTS_PATH;
config.deployerAccounts = { ...constants_1.defaultAccountDeployerSettings, ...userConfig?.deployerAccounts };
});
(0, config_1.extendEnvironment)((hre) => {
hre.network.zksync = hre.network.config.zksync ?? false;
hre.network.forceDeploy = hre.network.config.forceDeploy ?? true;
hre.network.deployPaths = hre.network.config.deployPaths
? typeof hre.network.config.deployPaths === 'string'
? [hre.network.config.deployPaths]
: hre.network.config.deployPaths
: typeof hre.config.paths.deployPaths === 'string'
? [hre.config.paths.deployPaths]
: hre.config.paths.deployPaths;
hre.deployer = new deployer_extension_1.DeployerExtension(hre);
});
(0, config_env_1.taskWithEraTestNode)(task_names_1.TASK_DEPLOY_ZKSYNC, 'Runs the deploy scripts for ZKsync network', true)
.addParam('script', 'A certain deploy script to be launched', '')
.addOptionalParam('tags', 'specify which deploy script to execute via tags, separated by commas', undefined, argumentTypes_1.string)
.setAction(task_actions_1.zkSyncDeploy);
(0, config_env_1.taskWithEraTestNode)(task_names_1.TASK_DEPLOY_ZKSYNC_LIBRARIES, 'Runs the library deploy for ZKsync network', true)
.addOptionalParam('privateKeyOrIndex', 'Private key or index of the account that will deploy the libraries', undefined)
.addOptionalParam('externalConfigObjectPath', 'Config file imported in hardhat config file that represent HardhatUserConfig type variable', undefined)
.addOptionalParam('exportedConfigObject', 'Object in hardhat config file that represent HardhatUserConfig type variable', 'config', argumentTypes_1.string)
.addFlag('noAutoPopulateConfig', 'Flag to disable auto population of config file')
.addFlag('compileAllContracts', 'Flag to compile all contracts at the end of the process')
.setAction(task_actions_1.zkSyncLibraryDeploy);
(0, config_env_1.taskWithEraTestNode)(task_names_1.TASK_DEPLOY_ZKSYNC_CONTRACT, 'Runs the deploy scripts for ZKsync network', true)
.addParam('contractName', 'A contract name or a FQN', '')
.addOptionalVariadicPositionalParam('constructorArgsParams', 'Contract constructor arguments. Cannot be used if the --constructor-args option is provided', [])
.addOptionalParam('constructorArgs', 'Path to a Javascript module that exports the constructor arguments', undefined, config_1.types.inputFile)
.addOptionalParam('deploymentType', 'Type of deployment', undefined)
.addOptionalParam('salt', 'Type of deployment', undefined)
.addFlag('noCompile', 'Flag to disable auto compilation')
.setAction(task_actions_1.deployZkSyncContract);
try {
require.resolve('zksync2-js');
console.info(chalk_1.default.red('The package zksync2-js is deprecated. Please use zksync-ethers.'));
}
catch { }
//# sourceMappingURL=index.js.map