-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3355.bandle.js
1 lines (1 loc) · 38.4 KB
/
3355.bandle.js
1
"use strict";(self.webpackChunkhedge=self.webpackChunkhedge||[]).push([[3355,9137],{23355:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "otmController": () => (/* binding */ otmController),\n/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(2262);\n/* harmony import */ var _deployments_42161_HegicStrategyATM_PUT_ETH_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22102);\n/* harmony import */ var _deployments_42161_HegicStrategyATM_CALL_ETH_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29015);\n/* harmony import */ var _deployments_42161_HegicStrategyATM_PUT_BTC_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54643);\n/* harmony import */ var _deployments_42161_HegicStrategyATM_CALL_BTC_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57933);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_PUT_90_ETH_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57749);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_CALL_110_ETH_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24710);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_PUT_90_BTC_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(32546);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_CALL_110_BTC_json__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(27226);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_PUT_80_ETH_json__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24470);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_CALL_120_ETH_json__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99264);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_PUT_80_BTC_json__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(63301);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_CALL_120_BTC_json__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62065);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_PUT_70_ETH_json__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(27707);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_CALL_130_ETH_json__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(43742);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_PUT_70_BTC_json__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9556);\n/* harmony import */ var _deployments_42161_HegicStrategyOTM_CALL_130_BTC_json__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(13014);\n/* harmony import */ var _deployments_42161_USDC_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(39137);\n/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(80711);\n/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(95129);\n/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(21046);\n\n// import * as artifact_PUT_ETH_0_BROKEN from "../../deployments/42161/HegicStrategyAtmPutETH_BROKEN.json"\n// import * as artifact_PUT_BTC_0_BROKEN from "../../deployments/42161/HegicStrategyAtmPutBTC_BROKEN.json"\n//\n// import * as artifact_ATM_PUT_ETH_0_v0 from "../../deployments/42161/HegicStrategyAtmPutETH_v0.json"\n// import * as artifact_ATM_CALL_ETH_0_v0 from "../../deployments/42161/HegicStrategyAtmCallETH_v0.json"\n// import * as artifact_ATM_PUT_BTC_0_v0 from "../../deployments/42161/HegicStrategyAtmPutBTC_v0.json"\n// import * as artifact_ATM_CALL_BTC_0_v0 from "../../deployments/42161/HegicStrategyAtmCallBTC_v0.json"\n//\n// import * as artifact_OTM_PUT_ETH_10_v0 from "../../deployments/42161/HegicStrategyOTM_PUT_90_ETH_v0.json"\n// import * as artifact_OTM_CALL_ETH_10_v0 from "../../deployments/42161/HegicStrategyOTM_CALL_110_ETH_v0.json"\n// import * as artifact_OTM_PUT_BTC_10_v0 from "../../deployments/42161/HegicStrategyOTM_PUT_90_BTC_v0.json"\n// import * as artifact_OTM_CALL_BTC_10_v0 from "../../deployments/42161/HegicStrategyOTM_CALL_110_BTC_v0.json"\n//\n// import * as artifact_OTM_PUT_ETH_20_v0 from "../../deployments/42161/HegicStrategyOTM_PUT_80_ETH_v0.json"\n// import * as artifact_OTM_CALL_ETH_20_v0 from "../../deployments/42161/HegicStrategyOTM_CALL_120_ETH_v0.json"\n// import * as artifact_OTM_PUT_BTC_20_v0 from "../../deployments/42161/HegicStrategyOTM_PUT_80_BTC_v0.json"\n// import * as artifact_OTM_CALL_BTC_20_v0 from "../../deployments/42161/HegicStrategyOTM_CALL_120_BTC_v0.json"\n//\n// import * as artifact_OTM_PUT_ETH_30_v0 from "../../deployments/42161/HegicStrategyOTM_PUT_70_ETH_v0.json"\n// import * as artifact_OTM_CALL_ETH_30_v0 from "../../deployments/42161/HegicStrategyOTM_CALL_130_ETH_v0.json"\n// import * as artifact_OTM_PUT_BTC_30_v0 from "../../deployments/42161/HegicStrategyOTM_PUT_70_BTC_v0.json"\n// import * as artifact_OTM_CALL_BTC_30_v0 from "../../deployments/42161/HegicStrategyOTM_CALL_130_BTC_v0.json"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst logger = ethers__WEBPACK_IMPORTED_MODULE_17__/* .Logger.globalLogger */ .Yd.globalLogger();\nconst router = (__webpack_require__(66843)/* ["default"] */ .Z);\nconst routerPlayground = (__webpack_require__(61546)/* ["default"] */ .Z);\nconst otmController = {\n namespaced: true,\n state() {\n return {\n contracts: null,\n allowance: {},\n };\n },\n mutations: {\n reset() { },\n setContracts(state, contracts) {\n state.contracts = contracts;\n },\n setAllowance(state, { strategy, token, value, }) {\n if (!state.allowance[strategy]) {\n state.allowance[strategy] = { USDC: null };\n }\n state.allowance[strategy][token] = value;\n },\n },\n actions: {\n async init({ commit, rootGetters, rootState }) {\n if (rootGetters["connection/state"] != "connected")\n return;\n const provider = rootGetters["connection/provider"];\n const address = rootState.connection.address;\n // TODO\n // // artifact_ATM_PUT_ETH_0_v0\n // const ATM_PUT_ETH_0_v0 = markRaw(\n // new ethers.Contract(\n // artifact_ATM_PUT_ETH_0_v0.address,\n // artifact_ATM_PUT_ETH_0_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_ATM_CALL_ETH_0_v0\n // const ATM_CALL_ETH_0_v0 = markRaw(\n // new ethers.Contract(\n // artifact_ATM_CALL_ETH_0_v0.address,\n // artifact_ATM_CALL_ETH_0_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_ATM_PUT_BTC_0_v0\n // const ATM_PUT_BTC_0_v0 = markRaw(\n // new ethers.Contract(\n // artifact_ATM_PUT_BTC_0_v0.address,\n // artifact_ATM_PUT_BTC_0_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_ATM_CALL_BTC_0_v0\n // const ATM_CALL_BTC_0_v0 = markRaw(\n // new ethers.Contract(\n // artifact_ATM_CALL_BTC_0_v0.address,\n // artifact_ATM_CALL_BTC_0_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_PUT_ETH_10_v0\n // const OTM_PUT_ETH_10_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_PUT_ETH_10_v0.address,\n // artifact_OTM_PUT_ETH_10_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_CALL_ETH_10_v0\n // const OTM_CALL_ETH_10_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_CALL_ETH_10_v0.address,\n // artifact_OTM_CALL_ETH_10_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_PUT_BTC_10_v0\n // const OTM_PUT_BTC_10_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_PUT_BTC_10_v0.address,\n // artifact_OTM_PUT_BTC_10_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_CALL_BTC_10_v0\n // const OTM_CALL_BTC_10_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_CALL_BTC_10_v0.address,\n // artifact_OTM_CALL_BTC_10_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_OTM_PUT_ETH_20_v0\n // const OTM_PUT_ETH_20_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_PUT_ETH_20_v0.address,\n // artifact_OTM_PUT_ETH_20_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_CALL_ETH_20_v0\n // const OTM_CALL_ETH_20_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_CALL_ETH_20_v0.address,\n // artifact_OTM_CALL_ETH_20_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_PUT_BTC_20_v0\n // const OTM_PUT_BTC_20_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_PUT_BTC_20_v0.address,\n // artifact_OTM_PUT_BTC_20_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_CALL_BTC_20_v0\n // const OTM_CALL_BTC_20_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_CALL_BTC_20_v0.address,\n // artifact_OTM_CALL_BTC_20_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_PUT_ETH_30_v0\n // const OTM_PUT_ETH_30_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_PUT_ETH_30_v0.address,\n // artifact_OTM_PUT_ETH_30_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_CALL_ETH_30_v0\n // const OTM_CALL_ETH_30_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_CALL_ETH_30_v0.address,\n // artifact_OTM_CALL_ETH_30_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_PUT_BTC_30_v0\n // const OTM_PUT_BTC_30_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_PUT_BTC_30_v0.address,\n // artifact_OTM_PUT_BTC_30_v0.abi,\n // provider,\n // ),\n // )\n // // artifact_OTM_CALL_BTC_30_v0\n // const OTM_CALL_BTC_30_v0 = markRaw(\n // new ethers.Contract(\n // artifact_OTM_CALL_BTC_30_v0.address,\n // artifact_OTM_CALL_BTC_30_v0.abi,\n // provider,\n // ),\n // )\n //\n // // artifact_PUT_ETH_0_BROKEN,\n // const ATM_PUT_ETH_BROKEN = markRaw(\n // new ethers.Contract(\n // artifact_PUT_ETH_0_BROKEN.address,\n // artifact_PUT_ETH_0_BROKEN.abi,\n // provider,\n // ),\n // )\n // // artifact_PUT_BTC_0_BROKEN,\n // const ATM_PUT_BTC_BROKEN = markRaw(\n // new ethers.Contract(\n // artifact_PUT_BTC_0_BROKEN.address,\n // artifact_PUT_BTC_0_BROKEN.abi,\n // provider,\n // ),\n // )\n const ATM_PUT_ETH = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyATM_PUT_ETH_json__WEBPACK_IMPORTED_MODULE_0__.address, _deployments_42161_HegicStrategyATM_PUT_ETH_json__WEBPACK_IMPORTED_MODULE_0__.abi, provider));\n const ATM_PUT_BTC = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyATM_PUT_BTC_json__WEBPACK_IMPORTED_MODULE_2__.address, _deployments_42161_HegicStrategyATM_PUT_BTC_json__WEBPACK_IMPORTED_MODULE_2__.abi, provider));\n const ATM_CALL_ETH = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyATM_CALL_ETH_json__WEBPACK_IMPORTED_MODULE_1__.address, _deployments_42161_HegicStrategyATM_CALL_ETH_json__WEBPACK_IMPORTED_MODULE_1__.abi, provider));\n const ATM_CALL_BTC = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyATM_CALL_BTC_json__WEBPACK_IMPORTED_MODULE_3__.address, _deployments_42161_HegicStrategyATM_CALL_BTC_json__WEBPACK_IMPORTED_MODULE_3__.abi, provider));\n const OTM_PUT_ETH_10 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_PUT_90_ETH_json__WEBPACK_IMPORTED_MODULE_4__.address, _deployments_42161_HegicStrategyOTM_PUT_90_ETH_json__WEBPACK_IMPORTED_MODULE_4__.abi, provider));\n const OTM_CALL_ETH_10 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_CALL_110_ETH_json__WEBPACK_IMPORTED_MODULE_5__.address, _deployments_42161_HegicStrategyOTM_CALL_110_ETH_json__WEBPACK_IMPORTED_MODULE_5__.abi, provider));\n const OTM_PUT_BTC_10 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_PUT_90_BTC_json__WEBPACK_IMPORTED_MODULE_6__.address, _deployments_42161_HegicStrategyOTM_PUT_90_BTC_json__WEBPACK_IMPORTED_MODULE_6__.abi, provider));\n const OTM_CALL_BTC_10 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_CALL_110_BTC_json__WEBPACK_IMPORTED_MODULE_7__.address, _deployments_42161_HegicStrategyOTM_CALL_110_BTC_json__WEBPACK_IMPORTED_MODULE_7__.abi, provider));\n const OTM_PUT_ETH_20 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_PUT_80_ETH_json__WEBPACK_IMPORTED_MODULE_8__.address, _deployments_42161_HegicStrategyOTM_PUT_80_ETH_json__WEBPACK_IMPORTED_MODULE_8__.abi, provider));\n const OTM_CALL_ETH_20 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_CALL_120_ETH_json__WEBPACK_IMPORTED_MODULE_9__.address, _deployments_42161_HegicStrategyOTM_CALL_120_ETH_json__WEBPACK_IMPORTED_MODULE_9__.abi, provider));\n const OTM_PUT_BTC_20 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_PUT_80_BTC_json__WEBPACK_IMPORTED_MODULE_10__.address, _deployments_42161_HegicStrategyOTM_PUT_80_BTC_json__WEBPACK_IMPORTED_MODULE_10__.abi, provider));\n const OTM_CALL_BTC_20 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_CALL_120_BTC_json__WEBPACK_IMPORTED_MODULE_11__.address, _deployments_42161_HegicStrategyOTM_CALL_120_BTC_json__WEBPACK_IMPORTED_MODULE_11__.abi, provider));\n const OTM_PUT_ETH_30 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_PUT_70_ETH_json__WEBPACK_IMPORTED_MODULE_12__.address, _deployments_42161_HegicStrategyOTM_PUT_70_ETH_json__WEBPACK_IMPORTED_MODULE_12__.abi, provider));\n const OTM_CALL_ETH_30 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_CALL_130_ETH_json__WEBPACK_IMPORTED_MODULE_13__.address, _deployments_42161_HegicStrategyOTM_CALL_130_ETH_json__WEBPACK_IMPORTED_MODULE_13__.abi, provider));\n const OTM_PUT_BTC_30 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_PUT_70_BTC_json__WEBPACK_IMPORTED_MODULE_14__.address, _deployments_42161_HegicStrategyOTM_PUT_70_BTC_json__WEBPACK_IMPORTED_MODULE_14__.abi, provider));\n const OTM_CALL_BTC_30 = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_HegicStrategyOTM_CALL_130_BTC_json__WEBPACK_IMPORTED_MODULE_15__.address, _deployments_42161_HegicStrategyOTM_CALL_130_BTC_json__WEBPACK_IMPORTED_MODULE_15__.abi, provider));\n const USDC = (0,vue__WEBPACK_IMPORTED_MODULE_18__/* .markRaw */ .Xl)(new ethers__WEBPACK_IMPORTED_MODULE_19__/* .Contract */ .CH(_deployments_42161_USDC_json__WEBPACK_IMPORTED_MODULE_16__.address, _deployments_42161_USDC_json__WEBPACK_IMPORTED_MODULE_16__.abi, provider));\n const contracts = {\n // ATM_PUT_ETH_0_v0,\n // ATM_CALL_ETH_0_v0,\n // ATM_PUT_BTC_0_v0,\n // ATM_CALL_BTC_0_v0,\n // OTM_PUT_ETH_10_v0,\n // OTM_CALL_ETH_10_v0,\n // OTM_PUT_BTC_10_v0,\n // OTM_CALL_BTC_10_v0,\n // OTM_PUT_ETH_20_v0,\n // OTM_CALL_ETH_20_v0,\n // OTM_PUT_BTC_20_v0,\n // OTM_CALL_BTC_20_v0,\n // OTM_PUT_ETH_30_v0,\n // OTM_CALL_ETH_30_v0,\n // OTM_PUT_BTC_30_v0,\n // OTM_CALL_BTC_30_v0,\n ATM_PUT_ETH,\n ATM_PUT_BTC,\n ATM_CALL_ETH,\n ATM_CALL_BTC,\n OTM_PUT_ETH_10,\n OTM_CALL_ETH_10,\n OTM_PUT_BTC_10,\n OTM_CALL_BTC_10,\n OTM_PUT_ETH_20,\n OTM_CALL_ETH_20,\n OTM_PUT_BTC_20,\n OTM_CALL_BTC_20,\n OTM_PUT_ETH_30,\n OTM_CALL_ETH_30,\n OTM_PUT_BTC_30,\n OTM_CALL_BTC_30,\n //\n // ATM_PUT_ETH_BROKEN,\n // ATM_PUT_BTC_BROKEN,\n USDC,\n };\n commit("setContracts", contracts);\n Object.keys(contracts).map((strategy) => {\n USDC.allowance(address, contracts[strategy].address).then((value) => commit("setAllowance", { strategy, token: "USDC", value }));\n });\n },\n async getOptionCost({ state }, { strategy, period, amount, strike }) {\n // return {total: BigNumber.from(20e6)}\n if (!amount || amount.isZero())\n return ethers__WEBPACK_IMPORTED_MODULE_20__/* .Zero */ ._Y;\n if (state.contracts) {\n const contract = state.contracts[strategy];\n // logger.debug(\n // "otmController",\n // "getOptionCost contracts",\n // state.contracts,\n // )\n // logger.debug("otmController", "getOptionCost", contract)\n // logger.debug(\n // "otmController",\n // "getOptionCost",\n // strategy,\n // period * 24 * 3600,\n // amount,\n // strike,\n // )\n const { premium, available } = await contract.calculatePremium(period * 24 * 3600, amount, strike);\n logger.debug("otmController", "getOptionCost", premium, available);\n return { premium, available };\n }\n return {};\n },\n async approve({ state, dispatch, rootGetters, commit }, { token, strategy }) {\n const strategyContract = state.contracts[strategy];\n const tx = state.contracts.USDC.approve(strategyContract.address, ethers__WEBPACK_IMPORTED_MODULE_20__/* .MaxUint256 */ .Bz);\n await dispatch("tfController/start", { tx }, { root: true });\n commit("setAllowance", {\n strategy,\n token,\n value: ethers__WEBPACK_IMPORTED_MODULE_20__/* .MaxUint256 */ .Bz,\n });\n },\n async buy({ state, dispatch, rootState }, { strategy, period, amount, strike }) {\n // const provider = rootGetters["connection/provider"]\n const address = rootState.connection.address;\n // logger.debug("otmController",\'buy\', strike)\n const strategyContract = state.contracts[strategy];\n const tx = strategyContract.buy(address, period * 24 * 3600, amount, strike);\n await dispatch("tfController/start", { tx, particles: "confetti" }, { root: true });\n const { events, blockNumber } = await tx.then((x) => x.wait());\n const tokenId = events.find((x) => x.event == "Acquired").args.id;\n // logger.debug("otm", await tx.then((x) => x.wait()))\n if (rootState.historyController)\n await dispatch("historyController/appendStratagy", { tokenId, blockNumber }, { root: true });\n //\n // await dispatch("tfController/start", {tx}, {root: true})\n //\n // const receipt = await tx.then(x => x.wait())\n // const event = receipt.logs.find(\n // x => x.address == contracts.OptionManager.address\n // )\n // const id = ethers.BigNumber.from(event.topics[3])\n //\n // const option = await poolContract.options(id)\n //\n // event.args = {tokenId: id}\n // const aqFilter = poolContract.filters.Acquired(id)\n //\n // const acquired = receipt.events.find(\n // x =>\n // x.topics[0] == aqFilter.topics[0] && x.address == poolContract.address\n // )\n // const {blockNumber} = await tx.then(x => x.wait())\n // const creationTimestamp = await facade.provider.getBlock(blockNumber).then(x =>x.timestamp)\n // logger.debug("otmController","creationTimestamp", creationTimestamp)\n // commit("pushOption", {pool, option, event, acquired, creationTimestamp})\n if (rootState.connection.networkType == "playground") {\n routerPlayground.push({ path: "/options/my-options" });\n }\n else {\n router.push({ path: "/arbitrum/options/my-options" });\n }\n },\n },\n getters: {},\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (otmController);\n\n\n//# sourceURL=webpack://hedge/./src/store/modules/otmController.ts?')},61546:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval('\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n "Z": () => (/* binding */ playground)\n});\n\n// EXTERNAL MODULE: ./node_modules/vue-router/dist/vue-router.esm-bundler.js\nvar vue_router_esm_bundler = __webpack_require__(42119);\n// EXTERNAL MODULE: ./src/components/options/buy/_Index.vue + 39 modules\nvar _Index = __webpack_require__(2902);\n// EXTERNAL MODULE: ./src/components/options/MyOptionsStrategy.vue + 14 modules\nvar MyOptionsStrategy = __webpack_require__(55272);\n// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js\nvar runtime_core_esm_bundler = __webpack_require__(66252);\n// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js\nvar shared_esm_bundler = __webpack_require__(3577);\n;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/pug-plain-loader/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[11].use[0]!./src/components/playground/MoneyFaucet.vue?vue&type=template&id=e8b0dd90&lang=pug\n\n\nconst _hoisted_1 = { class: "section-title" }\nconst _hoisted_2 = { class: "section-content" }\nconst _hoisted_3 = { class: "section-content__subsection" }\nconst _hoisted_4 = { class: "section-content__title" }\nconst _hoisted_5 = { class: "desktop-text cultured-d4" }\nconst _hoisted_6 = { class: "desktop-text-bold" }\nconst _hoisted_7 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("div", { class: "margin-texts--money-faucet" }, null, -1 /* HOISTED */)\nconst _hoisted_8 = { class: "desktop-text-bold cultured-d2" }\nconst _hoisted_9 = { class: "buttons-box buttons-box--money-faucet" }\nconst _hoisted_10 = { class: "mobile-bigtext-bold" }\nconst _hoisted_11 = { class: "list-box--money-faucet" }\nconst _hoisted_12 = { class: "list--money-faucet" }\nconst _hoisted_13 = {\n class: "list-title--money-faucet",\n "data-n": "1."\n}\nconst _hoisted_14 = { class: "list-text--money-faucet" }\nconst _hoisted_15 = ["href"]\nconst _hoisted_16 = { key: 0 }\nconst _hoisted_17 = { class: "list--money-faucet" }\nconst _hoisted_18 = {\n class: "list-title--money-faucet",\n "data-n": "2."\n}\nconst _hoisted_19 = { class: "list-text--money-faucet" }\nconst _hoisted_20 = ["href"]\nconst _hoisted_21 = { class: "mobile-bigtext-bold" }\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_el_button = (0,runtime_core_esm_bundler/* resolveComponent */.up)("el-button")\n const _component_el_divider = (0,runtime_core_esm_bundler/* resolveComponent */.up)("el-divider")\n\n return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, [\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_1, (0,shared_esm_bundler.toDisplayString)(_ctx.$t(\'playground.section.title\')), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_2, [\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_3, [\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_4, (0,shared_esm_bundler.toDisplayString)(_ctx.$t(\'playground.section.subsection-get-money.title\')), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_5, [\n (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-get-money.texts.t1\')[0]), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("span", _hoisted_6, (0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-get-money.texts.t1\')[1]), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-get-money.texts.t1\')[2]), 1 /* TEXT */)\n ]),\n _hoisted_7,\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_8, (0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-get-money.texts.t2\')[0]), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_9, [\n (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_el_button, {\n title: _ctx.$t(\'playground.section.subsection-get-money.buttons.receive\'),\n type: "primary",\n "with-icon": "pgusd",\n onClick: $options.mintUSD\n }, null, 8 /* PROPS */, ["title", "onClick"]),\n (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_el_button, {\n title: _ctx.$t(\'playground.section.subsection-get-money.buttons.add-metamask\'),\n type: "secondary",\n "with-icon": "add",\n onClick: $options.addToken\n }, null, 8 /* PROPS */, ["title", "onClick"])\n ]),\n (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_el_divider, { type: "horizontal" }),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_10, (0,shared_esm_bundler.toDisplayString)(_ctx.$t(\'playground.section.subsection-question.title\')), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_11, [\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_12, [\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_13, (0,shared_esm_bundler.toDisplayString)(_ctx.$t(\'playground.section.subsection-question.questions.q1.title\')), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_14, [\n (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-question.questions.q1.texts\')[0]), 1 /* TEXT */),\n ((0,runtime_core_esm_bundler/* openBlock */.wg)(true), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, (0,runtime_core_esm_bundler/* renderList */.Ko)(_ctx.$tm(\'playground.section.subsection-question.questions.q1.links\'), (link, i) => {\n return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("span", null, [\n (0,runtime_core_esm_bundler/* createElementVNode */._)("a", {\n class: "element-link",\n href: link.link,\n target: "_blank"\n }, (0,shared_esm_bundler.toDisplayString)(link.title), 9 /* TEXT, PROPS */, _hoisted_15),\n (i!=_ctx.$tm(\'playground.section.subsection-question.questions.q1.links\').length - 1)\n ? ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("span", _hoisted_16, ", "))\n : (0,runtime_core_esm_bundler/* createCommentVNode */.kq)("v-if", true)\n ]))\n }), 256 /* UNKEYED_FRAGMENT */)),\n (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-question.questions.q1.texts\')[1]), 1 /* TEXT */)\n ])\n ]),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_17, [\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_18, (0,shared_esm_bundler.toDisplayString)(_ctx.$t(\'playground.section.subsection-question.questions.q2.title\')), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_19, [\n (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-question.questions.q2.texts\')[0]), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("a", {\n class: "element-link",\n href: _ctx.$tm(\'playground.section.subsection-question.questions.q2.links\')[0].link,\n target: "_blank"\n }, (0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-question.questions.q2.links\')[0].title), 9 /* TEXT, PROPS */, _hoisted_20),\n (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-question.questions.q2.texts\')[1]), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createElementVNode */._)("span", _hoisted_21, (0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-question.questions.q2.texts\')[2]), 1 /* TEXT */),\n (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler.toDisplayString)(_ctx.$tm(\'playground.section.subsection-question.questions.q2.texts\')[3]), 1 /* TEXT */)\n ])\n ])\n ])\n ])\n ])\n ], 64 /* STABLE_FRAGMENT */))\n}\n;// CONCATENATED MODULE: ./src/components/playground/MoneyFaucet.vue?vue&type=template&id=e8b0dd90&lang=pug\n\n// EXTERNAL MODULE: ./src/router/index.js + 195 modules\nvar router = __webpack_require__(66843);\n// EXTERNAL MODULE: ./src/components/general/elements/Divider.vue\nvar Divider = __webpack_require__(63232);\n// EXTERNAL MODULE: ./src/components/general/elements/Button.vue\nvar Button = __webpack_require__(57779);\n// EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm-bundler.js\nvar vuex_esm_bundler = __webpack_require__(80894);\n;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[11].use[0]!./src/components/playground/MoneyFaucet.vue?vue&type=script&lang=js\n\n\n\n\n\n\n/* harmony default export */ const MoneyFaucetvue_type_script_lang_js = ({\n computed: {\n ...(0,vuex_esm_bundler/* mapState */.rn)({\n networkType: state => state.connection.networkType\n })\n },\n components: {\n ElButton: Button/* default */.Z,\n ElDivider: Divider/* default */.Z\n },\n methods: {\n async mintUSD() {\n await this.$store.dispatch("activate", "playgroundController")\n await this.$store.dispatch("playgroundController/getMoney")\n },\n async addToken() {\n ethereum.request({\n method: "wallet_watchAsset",\n params: {\n type: "ERC20",\n options: {\n address: "0xd3F41e2239c848Ed576eB4dc04074Ad6049A00f1",\n symbol: "pgUSD",\n decimals: 6,\n image:\n "http://play.hegic.co/assets/img/d43682e0985a99a7c3c89b3c06f257b4.svg"\n }\n }\n })\n }\n }\n});\n\n;// CONCATENATED MODULE: ./src/components/playground/MoneyFaucet.vue?vue&type=script&lang=js\n \n// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js\nvar exportHelper = __webpack_require__(83744);\n;// CONCATENATED MODULE: ./src/components/playground/MoneyFaucet.vue\n\n\n\n\n;\nconst __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(MoneyFaucetvue_type_script_lang_js, [[\'render\',render]])\n\n/* harmony default export */ const MoneyFaucet = (__exports__);\n;// CONCATENATED MODULE: ./src/router/playground.js\n\n\n// import OptionsBuyOTM from \'../components/options/OptionsBuyOTM.vue\'\n// import OptionsBuyStrategy from \'../components/options/OptionsBuyStrategy.vue\'\n\n\n\n/* harmony default export */ const playground = ((0,vue_router_esm_bundler/* createRouter */.p7)({\n\thistory: (0,vue_router_esm_bundler/* createWebHashHistory */.r5)(),\n\troutes: [\n\t\t// {\n\t\t// \tpath: \'/options/buy-otm\',\n\t\t// \tcomponent: OptionsBuyOTM,\n\t\t// },\n\t\t// {\n\t\t// \tpath: \'/options/buy-strategy\',\n\t\t// \tcomponent: OptionsBuyStrategy,\n\t\t// },\n\t\t{\n\t\t\tpath: \'/options/buy\',\n\t\t\tcomponent: _Index/* default */.Z,\n\t\t},\n\t\t{\n\t\t\tpath: \'/options/my-options\',\n\t\t\tcomponent: MyOptionsStrategy/* default */.Z,\n\t\t},\n\t\t{\n\t\t\tpath: \'/money-faucet\',\n\t\t\tcomponent: MoneyFaucet,\n\t\t},\n\n\t\t{ path: \'\', redirect: \'/options/buy-otm\' },\n\t\t{ path: \'/:pathMatch(.*)*\', redirect: \'/options/buy-otm\' },\n\n\t]\n}));\n\n\n//# sourceURL=webpack://hedge/./src/router/playground.js_+_5_modules?')},39137:module=>{eval('module.exports = JSON.parse(\'{"address":"0xff970a61a04b1ca14834a43f5de4533ebddb5cc8","abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]}\');\n\n//# sourceURL=webpack://hedge/./src/deployments/arbitrum/USDC.json?')}}]);