UNPKG

@tovarishfin/hardhat-yul

Version:

Hardhat plugin to develop smart contracts in Yul

49 lines 2.43 kB
"use strict"; 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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const task_names_1 = require("hardhat/builtin-tasks/task-names"); const config_env_1 = require("hardhat/internal/core/config/config-env"); const task_names_2 = require("./task-names"); require("./type-extensions"); (0, config_env_1.extendConfig)((config) => { const defaultConfig = { version: "latest" }; config.yul = Object.assign(Object.assign({}, defaultConfig), config.yul); }); // add new tasks: compile:yul, compile:yulp (0, config_env_1.subtask)(task_names_1.TASK_COMPILE_GET_COMPILATION_TASKS, async (_, __, runSuper) => { const otherTasks = await runSuper(); return [...otherTasks, task_names_2.TASK_COMPILE_YUL, task_names_2.TASK_COMPILE_YULP]; }); // handle the newly added compile:yul (0, config_env_1.subtask)(task_names_2.TASK_COMPILE_YUL, async (_flags, { config, artifacts }) => { const { compileYul } = await Promise.resolve().then(() => __importStar(require("./compilation"))); await compileYul(config.yul, config.paths, artifacts); }); // handle the newly added compile:yulp tasks (0, config_env_1.subtask)(task_names_2.TASK_COMPILE_YULP, async (_flags, { config, artifacts }) => { const { compileYulp } = await Promise.resolve().then(() => __importStar(require("./compilation"))); await compileYulp(config.yul, config.paths, artifacts); }); //# sourceMappingURL=index.js.map