From 083c58f8ec602c8e41ad12077ad6780b4e18261c Mon Sep 17 00:00:00 2001 From: "Riedl Kevin, Bsc" Date: Thu, 7 Sep 2023 14:34:14 +0200 Subject: [PATCH 01/20] fix: Replace Teleportation rpcs with Tenderly rpcs (#1189) (cherry picked from commit 046458133780bbc3518e75117d5c7348c690a423) --- packages/boba/teleportation/src/utils/chains.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/boba/teleportation/src/utils/chains.ts b/packages/boba/teleportation/src/utils/chains.ts index 51dbe8f339..4b9cb5d1f6 100644 --- a/packages/boba/teleportation/src/utils/chains.ts +++ b/packages/boba/teleportation/src/utils/chains.ts @@ -20,7 +20,7 @@ export const BobaChains: IBobaChains = { //#region boba_networks 288: { - url: 'https://replica.boba.network', + url: 'https://boba-ethereum.gateway.tenderly.co/1clfZoq7qEGyF4SQvF8gvI', testnet: false, name: 'Boba Ethereum Mainnet', teleportationAddress: '0xd68809330075C792C171C450B983F4D18128e9BF', @@ -33,7 +33,7 @@ export const BobaChains: IBobaChains = { }, }, 56288: { - url: 'https://replica.bnb.boba.network', + url: 'https://boba-bnb.gateway.tenderly.co/1clfZoq7qEGyF4SQvF8gvI', testnet: false, name: 'Boba BNB Mainnet', teleportationAddress: '0xd68809330075C792C171C450B983F4D18128e9BF', @@ -55,7 +55,7 @@ export const BobaChains: IBobaChains = { }, }, 9728: { - url: 'https://replica.testnet.bnb.boba.network', + url: 'https://boba-bnb-testnet.gateway.tenderly.co/1clfZoq7qEGyF4SQvF8gvI', testnet: true, name: 'Boba BNB Testnet', teleportationAddress: '0xf4d179d3a083Fa3Eede935FaF4C679D32d514186', @@ -69,7 +69,7 @@ export const BobaChains: IBobaChains = { //#endregion //#region l1 1: { - url: 'https://eth.llamarpc.com', + url: 'https://mainnet.gateway.tenderly.co/1clfZoq7qEGyF4SQvF8gvI', testnet: false, name: 'Ethereum Mainnet', teleportationAddress: '0x0', From 5b06982a9e2ff34e07975d9a1722dc0f6a37b38f Mon Sep 17 00:00:00 2001 From: jemeza <57341979+jemeza@users.noreply.github.com> Date: Tue, 12 Sep 2023 02:40:47 -0500 Subject: [PATCH 02/20] making getBalance more robust (#1196) (cherry picked from commit ad241687180db4e8404c660994b1ff8f0f86ecde) --- .../boba/gateway/src/services/networkService.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/boba/gateway/src/services/networkService.js b/packages/boba/gateway/src/services/networkService.js index 3d9ac972a3..bc6a225abe 100644 --- a/packages/boba/gateway/src/services/networkService.js +++ b/packages/boba/gateway/src/services/networkService.js @@ -889,7 +889,22 @@ class NetworkService { } }) - const tokenBalances = await Promise.all(getBalancePromise) + const tokenBalances = await Promise.allSettled(getBalancePromise).then( + (results) => + results + .filter((result) => { + switch (result.status) { + case 'fulfilled': { + return true + } + case 'rejected': { + console.log("NS: getBalances:", result.reason) + return false + } + } + }) + .map((result) => result.value) + ) tokenBalances.forEach((token) => { if (token.layer === 'L1' && From 6a02fbfe52a3dc769aba313b09f1bc9e84d67a1e Mon Sep 17 00:00:00 2001 From: Sahil K <86316370+sk-enya@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:02:09 +0530 Subject: [PATCH 03/20] Gateway : Cleanup Dead Code / Lazy loading of containers with (#1212) (cherry picked from commit 903cb8fce8d30ef99944692ee3e1bc4731f3b25c) --- packages/boba/gateway/.env.example | 6 - packages/boba/gateway/config-overrides.js | 12 +- packages/boba/gateway/package.json | 22 +- .../boba/gateway/src/actions/veBobaAction.js | 39 - .../src/components/areaChart/AreaChart.js | 59 - .../components/areaChart/AreaChart.styles.js | 12 - .../src/components/bridgeFee/BridgeFee.js | 83 -- .../components/bridgeFee/BridgeFee.styles.js | 31 - .../counterButton/CounterButton.tsx | 45 - .../gateway/src/components/faucet/Faucet.js | 148 --- packages/boba/gateway/src/components/index.ts | 3 - .../layout/Header/NavDrawer/index.tsx | 2 +- .../components/mainMenu/MainMenu.styles.js | 51 - .../mainMenu/feeSwitcher/FeeSwitcher.js | 171 --- .../feeSwitcher/FeeSwitcher.styles.js | 24 - .../mainMenu/gasSwitcher/GasSwitcher.js | 112 -- .../gasSwitcher/GasSwitcher.styles.js | 41 - .../gateway/src/components/mainMenu/index.tsx | 4 - .../mainMenu/layerSwitcher/LayerSwitcher.js | 373 ------ .../layerSwitcher/LayerSwitcher.styles.js | 63 - .../mainMenu/menuItems/MenuItems.js | 53 - .../mainMenu/menuItems/MenuItems.styles.js | 55 - .../mainMenu/menuItems/menu.config.js | 48 - .../networkSwitcher/NetworkListItem.js | 38 - .../networkSwitcher/NetworkListItem.styles.js | 15 - .../networkSwitcher/NetworkSwitcher.js | 107 -- .../networkSwitcher/NetworkSwitcher.styles.js | 14 - .../mainMenu/themeSwitcher/ThemeSwitcher.js | 32 - .../themeSwitcher/ThemeSwitcher.styles.js | 22 - .../gateway/src/components/modal/Modal.tsx | 5 +- .../src/components/pageTitle/PageTitle.js | 20 - .../components/pageTitle/PageTitle.styles.js | 13 - .../gateway/src/components/tabs/TabPanel.js | 19 - .../boba/gateway/src/components/tabs/Tabs.js | 36 - .../src/components/tabs/Tabs.styles.js | 38 - .../boba/gateway/src/components/tabs/index.js | 63 - .../BridgeInput/EmergencySwap/index.tsx | 2 +- .../gateway/src/containers/Global.styles.js | 189 --- .../src/containers/VoteAndDao/Dao/Dao.js | 173 --- .../containers/VoteAndDao/Dao/Dao.styles.js | 95 -- .../VoteAndDao/Vote/Pools/poolList.js | 83 -- .../VoteAndDao/Vote/Pools/poolListItem.js | 146 --- .../VoteAndDao/Vote/Pools/pools.tableHeads.js | 39 - .../VoteAndDao/Vote/VeNfts/VeNfts.list.js | 79 -- .../src/containers/VoteAndDao/Vote/Vote.js | 183 --- .../src/containers/VoteAndDao/index.js | 106 -- .../src/containers/bobaScope/BobaScope.js | 10 +- .../gateway/src/containers/connect/Connect.js | 55 - .../gateway/src/containers/connect/index.tsx | 79 ++ .../boba/gateway/src/containers/dao/OldDao.js | 2 +- .../src/containers/devtools/DevTools.js | 2 +- .../boba/gateway/src/containers/earn/Earn.js | 17 +- .../containers/modals/dao/CastVoteModal.js | 91 +- .../containers/modals/dao/NewProposalModal.js | 36 +- .../modals/deposit/DepositBatchModal.js | 41 - .../containers/modals/deposit/DepositModal.js | 59 - .../modals/deposit/steps/InputStep.js | 223 ---- .../modals/deposit/steps/InputStepBatch.js | 454 ------- .../modals/deposit/steps/InputStepFast.js | 440 ------- .../deposit/steps/InputStepMultiChain.js | 241 ---- .../src/containers/modals/exit/ExitModal.js | 46 - .../modals/exit/steps/DoExitStep.js | 412 ------ .../modals/exit/steps/DoExitStepFast.js | 491 ------- .../gateway/src/containers/modals/index.tsx | 34 +- .../modals/transfer/TransferNFTModal.js | 119 -- .../containers/modals/veBoba/IncreaseLock.js | 221 ---- .../modals/veBoba/ManageLockModal.js | 58 - .../modals/veBoba/ManageLockModal.module.scss | 31 - .../modals/veBoba/ManageLockModal.styles.js | 26 - .../containers/modals/veBoba/WithdrawLock.js | 80 -- .../boba/gateway/src/containers/save/Save.tsx | 2 +- .../gateway/src/containers/veboba/Lock.js | 61 - .../src/containers/veboba/Lock.styles.js | 36 - .../containers/veboba/Records/RecordItem.js | 74 -- .../src/containers/veboba/Records/Records.js | 80 -- .../veboba/createLock/CreateLock.js | 203 --- .../veboba/createLock/CreateLock.module.scss | 31 - .../veboba/createLock/CreateLock.styles.js | 22 - .../src/deployment/contracts/BaseV1Voter.json | 726 ----------- .../contracts/crosschain/AltL1Bridge.json | 755 ----------- .../gateway/src/deployment/contracts/ve.json | 1145 ----------------- .../src/deployment/rinkeby/addresses.json | 83 -- ...96D6A5beb1F661cf052722A1424CDDA3e9418.json | 73 -- .../boba/gateway/src/hooks/useFeeSwitcher.ts | 2 +- packages/boba/gateway/src/index.scss | 53 - .../boba/gateway/src/layout/routes/index.js | 1 - .../gateway/src/layout/routes/routeList.js | 36 +- packages/boba/gateway/src/reducers/index.js | 2 - .../boba/gateway/src/reducers/uiReducer.js | 4 - .../gateway/src/reducers/veBobaReducer.js | 33 - .../boba/gateway/src/selectors/daoSelector.js | 4 - .../gateway/src/selectors/earnSelector.js | 20 +- packages/boba/gateway/src/selectors/index.ts | 1 - .../gateway/src/selectors/veBobaSelector.js | 22 - .../gateway/src/services/graphql.service.js | 3 +- .../gateway/src/services/networkService.js | 525 +------- packages/boba/gateway/src/util/constant.ts | 2 - packages/boba/gateway/src/util/lodash.js | 17 +- packages/boba/gateway/src/util/poolDetails.js | 23 - yarn.lock | 146 ++- 100 files changed, 308 insertions(+), 10119 deletions(-) delete mode 100644 packages/boba/gateway/src/actions/veBobaAction.js delete mode 100644 packages/boba/gateway/src/components/areaChart/AreaChart.js delete mode 100644 packages/boba/gateway/src/components/areaChart/AreaChart.styles.js delete mode 100644 packages/boba/gateway/src/components/bridgeFee/BridgeFee.js delete mode 100644 packages/boba/gateway/src/components/bridgeFee/BridgeFee.styles.js delete mode 100644 packages/boba/gateway/src/components/counterButton/CounterButton.tsx delete mode 100644 packages/boba/gateway/src/components/faucet/Faucet.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/MainMenu.styles.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/feeSwitcher/FeeSwitcher.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/feeSwitcher/FeeSwitcher.styles.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/gasSwitcher/GasSwitcher.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/gasSwitcher/GasSwitcher.styles.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/index.tsx delete mode 100644 packages/boba/gateway/src/components/mainMenu/layerSwitcher/LayerSwitcher.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/layerSwitcher/LayerSwitcher.styles.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/menuItems/MenuItems.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/menuItems/MenuItems.styles.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/menuItems/menu.config.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/networkSwitcher/NetworkListItem.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/networkSwitcher/NetworkListItem.styles.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/networkSwitcher/NetworkSwitcher.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/networkSwitcher/NetworkSwitcher.styles.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/themeSwitcher/ThemeSwitcher.js delete mode 100644 packages/boba/gateway/src/components/mainMenu/themeSwitcher/ThemeSwitcher.styles.js delete mode 100644 packages/boba/gateway/src/components/pageTitle/PageTitle.js delete mode 100644 packages/boba/gateway/src/components/pageTitle/PageTitle.styles.js delete mode 100644 packages/boba/gateway/src/components/tabs/TabPanel.js delete mode 100644 packages/boba/gateway/src/components/tabs/Tabs.js delete mode 100644 packages/boba/gateway/src/components/tabs/Tabs.styles.js delete mode 100644 packages/boba/gateway/src/components/tabs/index.js delete mode 100644 packages/boba/gateway/src/containers/Global.styles.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/Dao/Dao.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/Dao/Dao.styles.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolList.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolListItem.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/pools.tableHeads.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/Vote/VeNfts/VeNfts.list.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/Vote/Vote.js delete mode 100644 packages/boba/gateway/src/containers/VoteAndDao/index.js delete mode 100644 packages/boba/gateway/src/containers/connect/Connect.js create mode 100644 packages/boba/gateway/src/containers/connect/index.tsx delete mode 100644 packages/boba/gateway/src/containers/modals/deposit/DepositBatchModal.js delete mode 100644 packages/boba/gateway/src/containers/modals/deposit/DepositModal.js delete mode 100644 packages/boba/gateway/src/containers/modals/deposit/steps/InputStep.js delete mode 100644 packages/boba/gateway/src/containers/modals/deposit/steps/InputStepBatch.js delete mode 100644 packages/boba/gateway/src/containers/modals/deposit/steps/InputStepFast.js delete mode 100644 packages/boba/gateway/src/containers/modals/deposit/steps/InputStepMultiChain.js delete mode 100644 packages/boba/gateway/src/containers/modals/exit/ExitModal.js delete mode 100644 packages/boba/gateway/src/containers/modals/exit/steps/DoExitStep.js delete mode 100644 packages/boba/gateway/src/containers/modals/exit/steps/DoExitStepFast.js delete mode 100644 packages/boba/gateway/src/containers/modals/transfer/TransferNFTModal.js delete mode 100644 packages/boba/gateway/src/containers/modals/veBoba/IncreaseLock.js delete mode 100644 packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.js delete mode 100644 packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.module.scss delete mode 100644 packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.styles.js delete mode 100644 packages/boba/gateway/src/containers/modals/veBoba/WithdrawLock.js delete mode 100644 packages/boba/gateway/src/containers/veboba/Lock.js delete mode 100644 packages/boba/gateway/src/containers/veboba/Lock.styles.js delete mode 100644 packages/boba/gateway/src/containers/veboba/Records/RecordItem.js delete mode 100644 packages/boba/gateway/src/containers/veboba/Records/Records.js delete mode 100644 packages/boba/gateway/src/containers/veboba/createLock/CreateLock.js delete mode 100644 packages/boba/gateway/src/containers/veboba/createLock/CreateLock.module.scss delete mode 100644 packages/boba/gateway/src/containers/veboba/createLock/CreateLock.styles.js delete mode 100644 packages/boba/gateway/src/deployment/contracts/BaseV1Voter.json delete mode 100644 packages/boba/gateway/src/deployment/contracts/crosschain/AltL1Bridge.json delete mode 100644 packages/boba/gateway/src/deployment/contracts/ve.json delete mode 100644 packages/boba/gateway/src/deployment/rinkeby/addresses.json delete mode 100644 packages/boba/gateway/src/deployment/rinkeby/rinkeby_0x93A96D6A5beb1F661cf052722A1424CDDA3e9418.json delete mode 100644 packages/boba/gateway/src/reducers/veBobaReducer.js delete mode 100644 packages/boba/gateway/src/selectors/veBobaSelector.js delete mode 100644 packages/boba/gateway/src/util/poolDetails.js diff --git a/packages/boba/gateway/.env.example b/packages/boba/gateway/.env.example index fb0b25aea4..f4215bc026 100644 --- a/packages/boba/gateway/.env.example +++ b/packages/boba/gateway/.env.example @@ -10,12 +10,6 @@ REACT_APP_GA4_MEASUREMENT_ID= REACT_APP_SENTRY_DSN= REACT_APP_ENABLE_LOCK_PAGE= # values can be 0 and 1 -################ -### Ve Dao ##### -################ -# to disable the veDoa set below flat to 1. -REACT_APP_DISABLE_VE_DAO=1 - ##################### ##### WebWallet ##### ##################### diff --git a/packages/boba/gateway/config-overrides.js b/packages/boba/gateway/config-overrides.js index dd3870abb6..16f075b1c8 100644 --- a/packages/boba/gateway/config-overrides.js +++ b/packages/boba/gateway/config-overrides.js @@ -1,7 +1,6 @@ // @ts-ignore const webpack = require('webpack'); -const { Buffer } = require('buffer'); -const path = require('path'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; module.exports = (config, env) => { // Resto de tu configuraciĆ³n... @@ -40,6 +39,15 @@ module.exports = (config, env) => { process: 'process', }) ); + if (process.env.REACT_APP_ENV === 'dev') { + config.plugins.push(new BundleAnalyzerPlugin({ + analyzerMode: 'disabled', + generateStatsFile: true, + statsOptions: { + source: false + } + })) + } return config; }; diff --git a/packages/boba/gateway/package.json b/packages/boba/gateway/package.json index 26a890ff21..a453b74971 100644 --- a/packages/boba/gateway/package.json +++ b/packages/boba/gateway/package.json @@ -5,6 +5,7 @@ "scripts": { "audit-check": "audit-ci --moderate", "build:prod": "GENERATE_SOURCEMAP=false REACT_APP_ENV=prod react-app-rewired build", + "build-storybook": "storybook build", "format:check": "prettier --config .prettierrc.json --check \"./src/**/*.{ts,tsx}\"", "format:fix": "prettier --config .prettierrc.json --write \"./src/**/*.{ts,tsx}\"", "get_artifacts": "./scripts/get_all_artifacts.sh", @@ -18,14 +19,12 @@ "test:coverage": "yarn test --coverage", "test:u": "yarn test -u", "test:w": "yarn test --watchAll=true", - "storybook": "storybook dev -p 6006", - "build-storybook": "storybook build" + "storybook": "storybook dev -p 6006" }, "dependencies": { "@apollo/client": "^3.5.10", "@cfx-kit/wallet-avatar": "^0.0.5", - "@emotion/react": "^11.10.6", - "@emotion/styled": "^11.6.0", + "@emotion/styled": "^11.11.0", "@eth-optimism/contracts": "0.5.11", "@eth-optimism/core-utils": "0.8.1", "@ethersproject/units": "^5.5.0", @@ -33,7 +32,6 @@ "@mui/icons-material": "^5.11.16", "@mui/material": "^5.12.2", "@mui/styles": "^5.3.0", - "@mui/system": "^5.12.1", "@sentry/react": "^7.51.0", "@sentry/tracing": "^7.51.0", "@walletconnect/web3-provider": "^1.8.0", @@ -44,7 +42,6 @@ "bootstrap-daterangepicker": "^3.1.0", "browserify-fs": "^1.0.0", "browserify-zlib": "^0.2.0", - "buffer": "^6.0.3", "date-fns": "^2.30.0", "dayjs": "^1.11.7", "dotenv": "^8.2.0", @@ -55,7 +52,10 @@ "http-browserify": "^1.7.0", "https-browserify": "^1.0.0", "human-standard-token-abi": "^2.0.0", - "lodash": "^4.17.21", + "lodash.flatten": "^4.4.0", + "lodash.intersection": "^4.4.0", + "lodash.keyby": "^4.6.0", + "lodash.orderby": "^4.6.0", "node-forge": "^1.3.1", "os-browserify": "^0.3.0", "patch-package": "^6.2.2", @@ -86,7 +86,8 @@ "truncate-middle": "^1.0.6", "ts-md5": "^1.2.11", "typescript": "^4.3.5", - "web3": "^1.8.2" + "web3": "^1.8.2", + "webpack-bundle-analyzer": "^4.9.1" }, "browserslist": [ ">0.2%", @@ -110,6 +111,11 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^12.1.2", "@types/jest": "^29.5.1", + "@types/lodash.flatten": "^4.4.7", + "@types/lodash.intersection": "^4.4.7", + "@types/lodash.isequal": "^4.5.6", + "@types/lodash.keyby": "^4.6.7", + "@types/lodash.orderby": "^4.6.7", "@types/redux-mock-store": "^1.0.3", "@types/styled-components": "^5.1.26", "@types/testing-library__jest-dom": "^5.14.6", diff --git a/packages/boba/gateway/src/actions/veBobaAction.js b/packages/boba/gateway/src/actions/veBobaAction.js deleted file mode 100644 index 481ae7f542..0000000000 --- a/packages/boba/gateway/src/actions/veBobaAction.js +++ /dev/null @@ -1,39 +0,0 @@ -import networkService from "services/networkService"; -import { createAction } from "./createAction"; - - -/************************ - **** VE Boba Actions *** - ************************/ - -export function createLock(payload) { - return createAction('LOCK/CREATE', () => networkService.createLock(payload)) -} - -export function withdrawLock(payload) { - return createAction('LOCK/WITHDRAW', () => networkService.withdrawLock(payload)) -} - -export function increaseLockAmount(payload) { - return createAction('LOCK/INCREASE_AMOUNT', () => networkService.increaseLockAmount(payload)) -} - -export function extendLockTime(payload) { - return createAction('LOCK/EXTEND_TIME', () => networkService.extendLockTime(payload)) -} - -export function fetchLockRecords() { - return createAction('LOCK/RECORDS', () => networkService.fetchLockRecords()) -} - -export function fetchPools() { - return createAction('VOTE/POOLS', () => networkService.fetchPools()) -} - -export function onSavePoolVote(payload) { - return createAction('SAVE_POOL/VOTE', () => networkService.savePoolVote(payload)) -} - -export function onDistributePool(payload) { - return createAction('DISTRIBUTE/POOL', () => networkService.distributePool(payload)) -} diff --git a/packages/boba/gateway/src/components/areaChart/AreaChart.js b/packages/boba/gateway/src/components/areaChart/AreaChart.js deleted file mode 100644 index ea33e773bb..0000000000 --- a/packages/boba/gateway/src/components/areaChart/AreaChart.js +++ /dev/null @@ -1,59 +0,0 @@ -import { Typography } from '@mui/material'; -import React from 'react'; -import { AreaChart as ReAreaChart, Area, Tooltip, XAxis, YAxis, ResponsiveContainer, CartesianGrid } from 'recharts'; - - -import * as S from './AreaChart.styles' - -function CustomToolTip({ - active, - payload, - label -}) { - - if (!active) { - return null; - } - - return - Locking period: {label} - Convert ratio: {payload[ 0 ].value} - -} - -function AreaChart({ data }) { - - return - - - - - - - - - - `${n}%`} /> - } /> - - - - - -} - -export default AreaChart; diff --git a/packages/boba/gateway/src/components/areaChart/AreaChart.styles.js b/packages/boba/gateway/src/components/areaChart/AreaChart.styles.js deleted file mode 100644 index b247c7bcc1..0000000000 --- a/packages/boba/gateway/src/components/areaChart/AreaChart.styles.js +++ /dev/null @@ -1,12 +0,0 @@ -import { styled } from "@mui/styles"; -import { Box } from "@mui/material"; - -export const AreaChartContainer = styled(Box)(({ theme }) => ({ - background: 'transperent' -})) - -export const ToolTipContainer = styled(Box)(({ theme }) => ({ - display: 'flex', - flexDirection: 'column', - background: theme.palette.background.secondary -})) diff --git a/packages/boba/gateway/src/components/bridgeFee/BridgeFee.js b/packages/boba/gateway/src/components/bridgeFee/BridgeFee.js deleted file mode 100644 index 4132d2b380..0000000000 --- a/packages/boba/gateway/src/components/bridgeFee/BridgeFee.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ -import React from 'react' - -import { HelpOutline } from '@mui/icons-material' -import { Box, Typography } from '@mui/material' - -import Tooltip from 'components/tooltip/Tooltip' - -import * as S from './BridgeFee.styles' - -function BridgeFee({ - time, - estFee, - exitFee, - lpFee, - estReceive, - exitFeeInfo, - timeInfo, - estFeeInfo, - lpFeeInfo, - estReceiveInfo -}) { - - const ItemLabel = ({ label, info }) => { - return - {label} - {info ? - - : null} - - } - - return - {time ? - - - {time} - - : null} - - - {estFee ? - - - {estFee} - - : null} - {lpFee ? - - - {lpFee} - - : null} - {exitFee ? - - - {exitFee} - - : null} - {estReceive ? - - - {estReceive} - - : null} - - -} - -export default BridgeFee; diff --git a/packages/boba/gateway/src/components/bridgeFee/BridgeFee.styles.js b/packages/boba/gateway/src/components/bridgeFee/BridgeFee.styles.js deleted file mode 100644 index a22a91ad56..0000000000 --- a/packages/boba/gateway/src/components/bridgeFee/BridgeFee.styles.js +++ /dev/null @@ -1,31 +0,0 @@ -import styled from '@emotion/styled'; -import { Box, Typography } from "@mui/material"; - -export const BrigeFeeWrapper = styled(Box)(({ theme }) => ({ - display: 'flex', - justifyContent: 'space-between', - margin: '5px 0', - [ theme.breakpoints.down('sm') ]: { - flexDirection: 'column', - } -})); - - -export const BridgeFeeItem = styled(Box)(({ theme }) => ({ - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start', - flexDirection: 'column', - [ theme.breakpoints.down('sm') ]: { - flexDirection: 'row', - justifyContent: 'space-between' - } -})); - -export const BridgeFeeItemLabel = styled(Typography)(({ theme }) => ({ - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - gap: '5px', - opacity: '0.65' -})); diff --git a/packages/boba/gateway/src/components/counterButton/CounterButton.tsx b/packages/boba/gateway/src/components/counterButton/CounterButton.tsx deleted file mode 100644 index c7ad0cb2c3..0000000000 --- a/packages/boba/gateway/src/components/counterButton/CounterButton.tsx +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React from 'react' -import { AddCircleOutline, RemoveCircleOutline } from '@mui/icons-material' -import { IconButton } from '@mui/material' - -type CounterButtonPropsType = { - onClick: () => void - disabled: boolean - minus?: boolean -} - -const CounterButton = (props: CounterButtonPropsType): JSX.Element => { - const { onClick, disabled, minus } = props - - return ( - - {minus ? ( - - ) : ( - - )} - - ) -} - -export default React.memo(CounterButton) diff --git a/packages/boba/gateway/src/components/faucet/Faucet.js b/packages/boba/gateway/src/components/faucet/Faucet.js deleted file mode 100644 index 158162638a..0000000000 --- a/packages/boba/gateway/src/components/faucet/Faucet.js +++ /dev/null @@ -1,148 +0,0 @@ -import React, { useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; -import { selectActiveNetworkType, selectLayer, selectWalletAddress } from 'selectors'; - -import * as G from 'containers/Global.styles' -import { Box, Typography, Input } from '@mui/material'; - -import faucetService from 'services/faucet.service'; -import { openAlert } from 'actions/uiAction'; -import { NETWORK_TYPE } from 'util/network/network.util'; -import Copy from 'components/copy/Copy'; -import Button from 'components/button/Button'; -import twitter from 'assets/images/twitter.png' -import { Md5 } from 'ts-md5'; -import networkService from 'services/networkService'; - - -/** - * @Faucet - * - only accessible on L2 for testnet env. - */ - -const Faucet = (props) => { - - const dispatch = useDispatch(); - const activeNetworkType = useSelector(selectActiveNetworkType()); - const layer = useSelector(selectLayer()) - const walletAddress = useSelector(selectWalletAddress()) - - - const [ tweetUrl, setTweetUrl ] = useState("") - const [ isClaimFaucetLoading, setIsClaimFaucetLoading ] = useState(false) - const [ faucetErrorMsg, setFaucetErrorMsg ] = useState("") - - let bobaTag = '' - if (walletAddress) - bobaTag = Md5.hashStr(walletAddress.toLowerCase().substring(2)) - - let BT = '' - let tweet = '' - if (bobaTag) { - BT = "BOBA" + bobaTag.substring(0, 9).toUpperCase() - tweet = networkService.networkConfig.twitterFaucetPromotionText + BT - } - - async function claimAuthenticatedFaucetTokens() { - try { - setIsClaimFaucetLoading(true) - const tweetId = tweetUrl?.match(/twitter\.com\/.*\/status\/(\d+)/)[ 1 ] - const res = await faucetService.getTestnetETHAuthenticatedMetaTransaction(tweetId) - if (!res) { - dispatch(openAlert('Faucet request submitted')) - } else { - setFaucetErrorMsg(res) - } - } catch (err) { - let error = err.message.match(/execution reverted: (.*)\\+"}}/) - if (error) { - error = error[ 1 ] - } else { - error = err?.message ?? err - } - setFaucetErrorMsg(error) - } finally { - setIsClaimFaucetLoading(false) - } - } - - if (layer === 'L2' && - activeNetworkType === NETWORK_TYPE.TESTNET) - { - return ( - - - - - Developer Twitter/Turing test token fountain - your Boba Bubble:{" "} - {BT} - - - - - Welcome developers. - For testnet BOBA and ETH, tweet your Boba Bubble and - then paste the tweet link in the field below. - - - Tweet Now - - - - For the Tweet link, tap the share icon, tap "Share Tweet via", and finally select "Copy link to Tweet". - - - setTweetUrl(e?.target?.value.split('?')[ 0 ])} //remove the superfluous stuff after the "?" - /> - - - You are limited to one fountain call per twitter account per day. - The transaction will not show in your history since it's a MetaTransaction (the gas is covered by Boba). - - - - - {faucetErrorMsg ? {faucetErrorMsg} : null} - - - ) - } - - return null; -} - -export default Faucet; diff --git a/packages/boba/gateway/src/components/index.ts b/packages/boba/gateway/src/components/index.ts index 9e347c0a5d..c657756040 100644 --- a/packages/boba/gateway/src/components/index.ts +++ b/packages/boba/gateway/src/components/index.ts @@ -1,8 +1,5 @@ export { default as Copy } from 'components/copy/Copy' export { default as Disconnect } from 'components/disconnect/Disconnect' -export { default as CounterButton } from 'components/counterButton/CounterButton' export { default as Pager } from 'components/pager/Pager' -export { default as PageTitle } from 'components/pageTitle/PageTitle' export * from 'components/availableBridges' -export * from 'components/mainMenu/' diff --git a/packages/boba/gateway/src/components/layout/Header/NavDrawer/index.tsx b/packages/boba/gateway/src/components/layout/Header/NavDrawer/index.tsx index 47756527f9..c3def53db0 100644 --- a/packages/boba/gateway/src/components/layout/Header/NavDrawer/index.tsx +++ b/packages/boba/gateway/src/components/layout/Header/NavDrawer/index.tsx @@ -1,5 +1,5 @@ import { Drawer } from '@mui/material' -import { makeStyles } from '@mui/styles' +import makeStyles from '@mui/styles/makeStyles' import SunIcon from 'assets/images/theme-sun.svg' import { Svg, SwitchButton } from 'components/global' import React, { FC, useState } from 'react' diff --git a/packages/boba/gateway/src/components/mainMenu/MainMenu.styles.js b/packages/boba/gateway/src/components/mainMenu/MainMenu.styles.js deleted file mode 100644 index da96b93195..0000000000 --- a/packages/boba/gateway/src/components/mainMenu/MainMenu.styles.js +++ /dev/null @@ -1,51 +0,0 @@ - -import { Box } from '@mui/material' -import { styled } from '@mui/system' - -export const Menu = styled('div')({ - display: 'flex', - width: '100%', - height: '100px', - gap: '20px', - justifyContent: 'flex-start', - alignItems: 'center', - paddingTop: '20px', - paddingLeft: '20px', - paddingBottom: '20px', -}) - -export const MobileNavTag = styled(Box)` - width: 100%; - display: flex; - gap: 20px; - align-items: center; - justify-content: space-between; -`; - -export const StyleDrawer = styled(Box)` - background-color: ${(props) => props.theme.palette.mode === 'light' ? 'white' : '#061122'}; - height: 100%; -`; - -export const DrawerHeader = styled(Box)` - display: flex; - flex-direction: column; - gap: 30px; - padding: 40px 40px 20px 40px; -`; - -export const WrapperCloseIcon = styled(Box)` - display: flex; - justify-content: space-between; - align-items: center; -`; - -export const MenuWrapper = styled(Box)(({ theme }) => ({ - display: 'flex', - justifyContent: 'center', - alignItems: 'flex-start', - flexDirection: 'column', - borderRight: 'solid white', - borderWidth: '1px', - paddingRight: '10px', -})) diff --git a/packages/boba/gateway/src/components/mainMenu/feeSwitcher/FeeSwitcher.js b/packages/boba/gateway/src/components/mainMenu/feeSwitcher/FeeSwitcher.js deleted file mode 100644 index f4d8e69bf4..0000000000 --- a/packages/boba/gateway/src/components/mainMenu/feeSwitcher/FeeSwitcher.js +++ /dev/null @@ -1,171 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useCallback } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { openError, openAlert } from 'actions/uiAction' - -import { - selectAccountEnabled, - selectBobaFeeChoice, - selectLayer, - selectlayer2Balance, - selectActiveNetworkName -} from 'selectors' - - -import { switchFee } from 'actions/setupAction.js' - -import * as S from './FeeSwitcher.styles.js' -import Select from 'components/select/Select' -import Tooltip from 'components/tooltip/Tooltip' -import { isEqual } from 'util/lodash'; - -import BN from 'bignumber.js' -import { logAmount } from 'util/amountConvert.js' -import networkService from 'services/networkService.js' - -import {FeeSwitcherIcon, FeeSwitcherLabel} from "./FeeSwitcher.styles.js"; - - -function FeeSwitcher() { - const dispatch = useDispatch() - const accountEnabled = useSelector(selectAccountEnabled()) - const feeUseBoba = useSelector(selectBobaFeeChoice()) - - const networkName = useSelector(selectActiveNetworkName()) - - const layer = useSelector(selectLayer()) - - const l2Balances = useSelector(selectlayer2Balance, isEqual) - - const l2BalanceNativeToken = l2Balances.filter((i) => i.symbol === networkService.L1NativeTokenSymbol) - const balanceETH = l2BalanceNativeToken[ 0 ] - const l2BalanceBOBA = l2Balances.filter((i) => i.symbol === 'BOBA') - const balanceBOBA = l2BalanceBOBA[0] - - const dispatchSwitchFee = useCallback( - async (targetFee) => { - let tooSmallL1NativeToken = false - // mini balance required for token to use as bridge fee - let minL1NativeBalance = await networkService.estimateMinL1NativeTokenForFee() //0.002 - let tooSmallBOBA = false - - if (typeof balanceBOBA === 'undefined') { - tooSmallBOBA = true - } else { - //check actual balance - tooSmallBOBA = new BN(logAmount(balanceBOBA.balance, 18)).lt(new BN(1)) - } - - if (typeof balanceETH === 'undefined') { - tooSmallL1NativeToken = true - } else { - //check actual balance - tooSmallL1NativeToken = new BN(logAmount(balanceETH.balance, 18)).lt( - new BN(minL1NativeBalance) - ) - } - - if (!balanceBOBA && !balanceETH) { - dispatch( - openError('Wallet empty - please bridge in ETH or BOBA from L1') - ) - return - } - - let res - - if (feeUseBoba && targetFee === 'BOBA') { - // do nothing - already set to BOBA - } else if ( - !feeUseBoba && - targetFee === networkService.L1NativeTokenSymbol - ) { - // do nothing - already set to ETH - } else if (!feeUseBoba && targetFee === 'BOBA') { - // change to BOBA - if (tooSmallBOBA) { - dispatch( - openError(`You cannot change the fee token to BOBA since your BOBA balance is below 1 BOBA. - If you change fee token now, you might get stuck. Please swap some ETH for BOBA first.`) - ) - } else { - res = await dispatch(switchFee(targetFee)) - } - } else if ( - feeUseBoba && - targetFee === networkService.L1NativeTokenSymbol - ) { - // change to L1Native Token - if (tooSmallL1NativeToken) { - dispatch( - openError(`You cannot change the fee token to ${networkService.L1NativeTokenSymbol} since your ${networkService.L1NativeTokenSymbol} balance is below ${minL1NativeBalance}. - If you change fee token now, you might get stuck. Please obtain some ${networkService.L1NativeTokenSymbol} first.`) - ) - } else { - res = await dispatch(switchFee(targetFee)) - } - } - - if (res) { - dispatch(openAlert(`Successfully changed fee to ${targetFee}`)) - } - }, - [dispatch, feeUseBoba, balanceETH, balanceBOBA] - ) - - if (!accountEnabled && layer !== 'L2') { - return ( - - - - - Fee - - ) - } - - return ( - - - - - Fee - { - console.log('e', e) - setSelectedState(e) - }} - sx={{ marginBottom: '20px' }} - value={selectedState} - > - - - - {!!loading && !proposals.length ? Loading... : null} - {proposals - // eslint-disable-next-line array-callback-return - .filter((p) => { - if (selectedState.value === 'All') { - return true; - } - return selectedState.value === p.state; - }) - .map((p, index) => { - return - - - })} - - - - ) -} - -export default React.memo(DAO) diff --git a/packages/boba/gateway/src/containers/VoteAndDao/Dao/Dao.styles.js b/packages/boba/gateway/src/containers/VoteAndDao/Dao/Dao.styles.js deleted file mode 100644 index d0824e057d..0000000000 --- a/packages/boba/gateway/src/containers/VoteAndDao/Dao/Dao.styles.js +++ /dev/null @@ -1,95 +0,0 @@ -import { styled } from '@mui/material/styles' -import { Box } from "@mui/material" - -export const DaoPageContainer = styled(Box)(({ theme }) => ({ - margin: '0px auto', - display: 'flex', - flexDirection: 'column', - justifyContent: 'space-around', - padding: '10px', - paddingTop: '0px', - width: '70%', - gap: '10px', - [theme.breakpoints.between('md', 'lg')]: { - width: '90%', - padding: '0px', - }, - [theme.breakpoints.between('sm', 'md')]: { - width: '90%', - padding: '0px', - }, - [theme.breakpoints.down('sm')]: { - width: '100%', - padding: '0px', - }, - -})); - -export const DaoPageContent = styled(Box)(({ theme }) => ({ - display: 'flex', - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'flex-start', - paddingTop: '0px', - gap: '10px', - [theme.breakpoints.down('sm')]: { - flexDirection: 'column' - }, -})); - -export const DaoWalletContainer = styled(Box)(({ theme }) => ({ - display: 'flex', - flexDirection: 'column', - padding: '0px 20px', - minHeight: '700px', - width: '30%', - gap: '10px', - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.glassy, - [theme.breakpoints.down('sm')]: { - width: '100%', - }, -})); - -export const DaoProposalContainer = styled(Box)(({ theme }) => ({ - width: '70%', - display: 'flex', - flexDirection: 'column', - justifyContent: 'flex-start', - padding: '0 32px', - minHeight: '500px', - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.glassy, - [theme.breakpoints.down('sm')]: { - width: '100%', - padding: '0 20px', - }, -})); - -export const DaoProposalHead = styled(Box)(({ theme }) => ({ - display: 'flex', - alignItems: 'center', - alignSelf: 'flex-start', - justifyContent: 'space-between', - padding: '15px 0px', - width: '100%', - margin: '5px', - [theme.breakpoints.down('sm')]: { - padding: '0px', - }, -})) - -export const DaoProposalListContainer = styled(Box)(({ theme }) => ({ - overflowY: 'auto', - margin: '10px auto', - borderRadius: '8px', - padding: '20px 10px', - width: '100%', - height: '600px', - '.loadingContainer' : { - padding: '10px auto', - }, - [theme.breakpoints.down('sm')]: { - padding: '0px', - }, -})) diff --git a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolList.js b/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolList.js deleted file mode 100644 index ae6b4c7909..0000000000 --- a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolList.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState } from 'react' - -import { poolsTableHeads } from './pools.tableHeads' - -import * as G from 'containers/Global.styles' -import PoolListItem from './poolListItem' -import { Pager } from 'components' -import { PER_PAGE } from 'util/constant' -import { useSelector } from 'react-redux' -import { selectPools, selectLoading } from 'selectors' -import { Typography } from '@mui/material' - - -function PoolList({ onPoolVoteChange, token, onDistribute }) { - - const [ page, setPage ] = useState(1) - - const loading = useSelector(selectLoading([ 'VOTE/POOLS' ])) - const pools = useSelector(selectPools) - - // pagination logic - const startingIndex = page === 1 ? 0 : ((page - 1) * PER_PAGE) - const endingIndex = page * PER_PAGE - const paginatedPools = pools.slice(startingIndex, endingIndex) - let totalNumberOfPages = Math.ceil(pools.length / PER_PAGE) - if (totalNumberOfPages === 0) totalNumberOfPages = 1 - - return - - { - poolsTableHeads.map((item) => { - return ( - {item.label} - - ) - }) - } - - {loading && Loading...} - {paginatedPools.map((pool) => { - return - - - })} - setPage(page + 1)} - onClickBack={() => setPage(page - 1)} - /> - -} - -export default PoolList; diff --git a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolListItem.js b/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolListItem.js deleted file mode 100644 index 88de76bbdd..0000000000 --- a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/poolListItem.js +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useEffect, useState } from 'react' -import { Box, Typography, Slider, styled } from '@mui/material' - -import Button from 'components/button/Button' -import bobaLogo from 'assets/images/boba-token.svg' - -import * as G from 'containers/Global.styles' - -// styled component -const ListItemContent = styled(Box)(({ theme }) => ({ - display: 'flex', - flexDirection: 'column', - gap: '20px', - width: '100%', - padding: '10px', - borderBottom: theme.palette.primary.borderBottom -})) - - -function PoolListItem({ - pool, - onPoolVoteChange, - token, - onDistribute, -}) { - - const [ selectedVote, setSelectedVote ] = useState(0); - const [ myVote, setMyVote ] = useState({}); - - const handleVoteChange = (e, value) => { - setSelectedVote(value); - onPoolVoteChange(pool.poolId, value); - } - - useEffect(() => { - if (token) { - let tokenUsed = pool.usedTokens.find((t) => t.tokenId === token.tokenId); - if (tokenUsed) { - let tokenBalance = Number(token.balance); - let poolVote = Number(tokenUsed.vote); - let votePercent = Number((poolVote / tokenBalance) * 100); - setMyVote({ - value: poolVote.toFixed(2), - votePercent, - }) - setSelectedVote(votePercent) - } else { - setSelectedVote(0) - setMyVote({}) - } - } - - }, [ token, pool ]); - - return - - - boba logo - - - {pool.name} - - - {pool.description} - - - - - - - {pool.totalVotes} - - - {pool.votePercentage.toFixed(2)}% - - - - - - - {myVote.value || 0} - - - {myVote.votePercent || 0}% - - - - - - - {selectedVote.toFixed(2)}% - - - - - - - - - - - -} - -export default PoolListItem; diff --git a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/pools.tableHeads.js b/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/pools.tableHeads.js deleted file mode 100644 index 7d4d1d7eb4..0000000000 --- a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Pools/pools.tableHeads.js +++ /dev/null @@ -1,39 +0,0 @@ -export const poolsTableHeads = [ - { - label: 'WAGMI Pools', - isSort: false, - size: '20%', - flex: 1, - }, - { - label: 'Total Votes', - isSort: false, - size: '20%', - flex: 1, - }, - { - label: 'My Votes', - isSort: false, - size: '20%', - flex: 1, - }, - { - label: 'My Vote%', - isSort: false, - size: '30%', - flex: 2, - sx: { - textAlign: 'center' - } - } - , - { - label: 'Action', - isSort: false, - size: '10%', - flex: 1, - sx: { - textAlign: 'center' - } - } -] diff --git a/packages/boba/gateway/src/containers/VoteAndDao/Vote/VeNfts/VeNfts.list.js b/packages/boba/gateway/src/containers/VoteAndDao/Vote/VeNfts/VeNfts.list.js deleted file mode 100644 index cd0bb99e52..0000000000 --- a/packages/boba/gateway/src/containers/VoteAndDao/Vote/VeNfts/VeNfts.list.js +++ /dev/null @@ -1,79 +0,0 @@ -import React from 'react' -import { Box, styled, Typography } from '@mui/material' -import CheckMarkIcon from '@mui/icons-material/CheckCircleOutline' - -import Carousel from 'react-multi-carousel' -import "react-multi-carousel/lib/styles.css"; - -import BobaNFTGlass from 'assets/images/boba2/BobaNFTGlass.svg' - -import * as G from 'containers/Global.styles' - -const NftContainer = styled(Box)(({ theme, active }) => ({ - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - background: active ? theme.palette.background.secondary : theme.palette.background.default, - borderRadius: theme.palette.primary.borderRadius, - border: theme.palette.primary.border, - cursor: 'pointer' -})) - -const responsive = { - superLargeDesktop: { - // the naming can be any, depends on you. - breakpoint: { max: 4000, min: 3000 }, - items: 5 - }, - desktop: { - breakpoint: { max: 3000, min: 1024 }, - items: 5 - }, - tablet: { - breakpoint: { max: 1024, min: 464 }, - items: 4 - }, - mobile: { - breakpoint: { max: 464, min: 0 }, - items: 2 - } -}; - - -const VeNftsList = ({ nftRecords, selectedNft, onSelectNft }) => { - - return - {nftRecords.map((nft) => { - return { onSelectNft(nft) }} - > - {nft.tokenId === selectedNft?.tokenId ? - : null} - - {nft.tokenId} - - - #{nft.tokenId} - {nft.balance.toFixed(2)} veBoba - - - })} - -} - -export default React.memo(VeNftsList) diff --git a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Vote.js b/packages/boba/gateway/src/containers/VoteAndDao/Vote/Vote.js deleted file mode 100644 index b3aa233566..0000000000 --- a/packages/boba/gateway/src/containers/VoteAndDao/Vote/Vote.js +++ /dev/null @@ -1,183 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' - -import { Box, styled, Typography } from '@mui/material' - -import Button from 'components/button/Button' - -import { openAlert } from 'actions/uiAction' - -import { - fetchLockRecords, - fetchPools, - onDistributePool, - onSavePoolVote -} from 'actions/veBobaAction' - -import { selectAccountEnabled, selectLayer,selectLockRecords, selectPools } from 'selectors' - -import { ContentEmpty } from 'containers/Global.styles' - -import PoolList from './Pools/poolList' -import VeNftsList from './VeNfts/VeNfts.list'; - - -// styled component -const Action = styled(Box)({ - display: 'flex', - width: '100%', - justifyContent: 'flex-end' -}); - - - -function Vote({ - connectToBOBA -}) { - const dispatch = useDispatch() - - const nftRecords = useSelector(selectLockRecords); - const accountEnabled = useSelector(selectAccountEnabled()) - const layer = useSelector(selectLayer()) - const pools = useSelector(selectPools) - - const [ selectedNft, setSelectedNft ] = useState(null); - const [ poolsVote, setPoolsVote ] = useState({}); - const [ usedVotingPower, setUsedVotingPower ] = useState(0); - - const onPoolVoteChange = (poolId, value) => { - setPoolsVote({ - ...poolsVote, - [ poolId ]: value - }) - } - - const onVote = async () => { - const res = await dispatch(onSavePoolVote({ - tokenId: selectedNft.tokenId, - pools: Object.keys(poolsVote), - weights: Object.values(poolsVote), - })) - if (res) { - setSelectedNft(null) - dispatch(fetchLockRecords()); - dispatch(fetchPools()); - dispatch( - openAlert(`Vote has been submitted successfully!`) - ) - } - } - - const onDistribute = async (gaugeAddress) => { - const res = await dispatch(onDistributePool({ - gaugeAddress - })) - - if (res) { - dispatch(fetchPools()); - dispatch(fetchLockRecords()); - dispatch( - openAlert(`Pool has been distributed successfully!`) - ) - } - } - - useEffect(() => { - if (selectedNft && pools.length > 0) { - let usedVotes = {}; - pools.forEach((pool) => { - let tokenUsed = pool.usedTokens.find((t) => t.tokenId === selectedNft.tokenId) - if (tokenUsed) { - let nftBalance = parseInt(selectedNft.balance); - let poolVote = Number(tokenUsed.vote); - let votePercent = parseInt((poolVote / nftBalance) * 100); - - usedVotes = { - ...usedVotes, - [pool.poolId]: votePercent - } - } - }) - setPoolsVote(usedVotes) - } - }, [ selectedNft, pools ]); - - useEffect(() => { - if (Object.keys(poolsVote).length > 0) { - let powerSum = Object.values(poolsVote).reduce((s, a) => s + a, 0); - setUsedVotingPower(parseInt(powerSum)) - } - },[poolsVote]) - - useEffect(() => { - if (!!accountEnabled && layer === 'L2') { - dispatch(fetchLockRecords()); - dispatch(fetchPools()); - } - }, [ accountEnabled, dispatch, layer ]); - - return <> - - Please select a govBoba to vote - { - !nftRecords.length - ? - Oh! You don't have veBoba NFT, Please go to Lock to get them. - - : - } - - - {(!accountEnabled || layer !== 'L2') ? - - : - {selectedNft && Selected #{selectedNft.tokenId}, Voting power used {usedVotingPower} %} - - - } - - - -} - -export default React.memo(Vote) diff --git a/packages/boba/gateway/src/containers/VoteAndDao/index.js b/packages/boba/gateway/src/containers/VoteAndDao/index.js deleted file mode 100644 index b0f4637e82..0000000000 --- a/packages/boba/gateway/src/containers/VoteAndDao/index.js +++ /dev/null @@ -1,106 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { Box, Typography } from '@mui/material' - -import * as S from './Dao/Dao.styles'; -import * as G from '../Global.styles' -import {PageTitle} from 'components' -import Tabs from 'components/tabs/Tabs'; -import { useDispatch, useSelector } from 'react-redux'; -import { selectLockRecords, selectAccountEnabled, selectLayer } from 'selectors'; -import { fetchLockRecords } from 'actions/veBobaAction'; -import Vote from './Vote/Vote'; -import Dao from './Dao/Dao'; -import { setConnectBOBA } from 'actions/setupAction'; - -const DAO_TABS = { - VOTE: "Liquidity Bootstrapping", - PROPOSAL: "Proposals", -} - -function VoteAndDAO() { - - const [ page, setPage ] = useState(DAO_TABS.VOTE); - const [ balance, setBalance ] = useState('--'); - - const dispatch = useDispatch() - const nftRecords = useSelector(selectLockRecords); - const accountEnabled = useSelector(selectAccountEnabled()) - const layer = useSelector(selectLayer()) - - - async function connectToBOBA() { - dispatch(setConnectBOBA(true)) - } - - useEffect(() => { - if (!!accountEnabled && layer === 'L2') { - dispatch(fetchLockRecords()); - } - }, [ accountEnabled, dispatch, layer ]); - - useEffect(() => { - if (!!accountEnabled) { - const veBoba = nftRecords.reduce((s, record) => s + Number(record.balance), 0); - setBalance(veBoba.toFixed(2)) - } - }, [ accountEnabled, nftRecords ]); - - const veNftDisclaimer = () => { - if (page !== DAO_TABS.VOTE) { - return null; - } - - return ( - - Votes are due by Wednesday at 23:59 UTC, when the next epoch begins. Each veNFT can only cast votes once per epoch. Your vote will allocate 100% of that veNFT's vote-power. Each veNFT's votes will carry over into the next epoch. However, you must resubmit each veNFT's vote in each epoch to earn the bribes placed in that epoch. Voters will earn bribes no matter when in the epoch the bribes are added. - - - For details refer to our Docs - - ) - } - - const handlePageChange = (type) => { - if (DAO_TABS.VOTE === type) { - setPage(DAO_TABS.VOTE) - } else if (DAO_TABS.PROPOSAL === type) { - setPage(DAO_TABS.PROPOSAL) - } - } - - return - - {/* page hero section */} - - - My total voting power - {balance} - govBOBA - - {veNftDisclaimer()} - - - {/* page tabs section */} - - handlePageChange(t)} - aria-label="Page Tab" - tabs={[ DAO_TABS.VOTE, DAO_TABS.PROPOSAL ]} - /> - - {/* page content section */} - {DAO_TABS.VOTE === page ? - - : } - - - -} - - -export default React.memo(VoteAndDAO); diff --git a/packages/boba/gateway/src/containers/bobaScope/BobaScope.js b/packages/boba/gateway/src/containers/bobaScope/BobaScope.js index 648bf5aba7..b0ecc4634c 100644 --- a/packages/boba/gateway/src/containers/bobaScope/BobaScope.js +++ b/packages/boba/gateway/src/containers/bobaScope/BobaScope.js @@ -16,18 +16,11 @@ limitations under the License. */ import React, { useEffect, useState } from 'react' import { useDispatch } from 'react-redux' import { isEqual, orderBy } from 'util/lodash'; - - import { useSelector } from 'react-redux' -import "react-datepicker/dist/react-datepicker.css" - -import { setActiveDataTab } from 'actions/uiAction' import { fetchSevens, fetchFastExits } from 'actions/networkAction' -import { selectBaseEnabled, selectActiveDataTab, selectSevens, selectFastExits } from 'selectors' - -import Tabs from 'components/tabs/Tabs' +import { selectBaseEnabled, selectSevens, selectFastExits } from 'selectors' import Sevens from './Sevens' import FastExits from './FastExits' @@ -45,7 +38,6 @@ function BobaScope() { const [ searchData, setSearchData ] = useState('') - const activeTab = useSelector(selectActiveDataTab, isEqual) const baseEnabled = useSelector(selectBaseEnabled()) const unorderedSevens = useSelector(selectSevens, isEqual) diff --git a/packages/boba/gateway/src/containers/connect/Connect.js b/packages/boba/gateway/src/containers/connect/Connect.js deleted file mode 100644 index ce6660cf96..0000000000 --- a/packages/boba/gateway/src/containers/connect/Connect.js +++ /dev/null @@ -1,55 +0,0 @@ -import React from 'react' -import * as G from '../Global.styles' - -import { useDispatch } from 'react-redux' -import AlertIcon from 'components/icons/AlertIcon' -import {Button} from 'components/global/button' - -import { setConnectBOBA, setConnect } from 'actions/setupAction' - -const Connect = ({ - userPrompt, - accountEnabled, - connectToBoba = false, - layer = '', -}) => { - const dispatch = useDispatch() - - if (!accountEnabled && !connectToBoba) { - return ( - - - - - {userPrompt} - - - )} diff --git a/packages/boba/gateway/src/containers/modals/dao/CastVoteModal.js b/packages/boba/gateway/src/containers/modals/dao/CastVoteModal.js index 4487c65df8..6610de7936 100644 --- a/packages/boba/gateway/src/containers/modals/dao/CastVoteModal.js +++ b/packages/boba/gateway/src/containers/modals/dao/CastVoteModal.js @@ -13,22 +13,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import React, { useState, useEffect } from 'react' -import { Box, Typography } from '@mui/material' +import React, { useState } from 'react' +import { Box } from '@mui/material' import { useDispatch, useSelector } from 'react-redux' import { closeModal, openAlert } from 'actions/uiAction' - -import Modal from 'components/modal/Modal' - - import { castProposalVote } from 'actions/daoAction' -import BobaGlassIcon from 'components/icons/BobaGlassIcon' -import { selectLockRecords,selectLoading } from 'selectors' -import BobaNFTGlass from 'assets/images/boba2/BobaNFTGlass.svg' -import networkService from 'services/networkService' +import { selectLoading } from 'selectors' + +import Modal from 'components/modal/Modal' import { Dropdown } from 'components/global/dropdown' import { Button } from 'components/global/button' @@ -36,57 +31,8 @@ const CastVoteModal = ({ open, proposalId }) => { const dispatch = useDispatch() const [ selectedVoteType, setselectedVoteType ] = useState(null) - const [ tokens, setTokens ] = useState([]) - const [ nftOptions, setNftOptions ] = useState([]); - const [ filterOptions, setFilterOptions ] = useState([]); - const [ loadingOptions, setloadingOptions ] = useState([]); - const loading = useSelector(selectLoading([ 'PROPOSAL/CAST/VOTE' ])) - const records = useSelector(selectLockRecords); - - useEffect(() => { - if (records && records.length > 0) { - const options = records.map((token) => ({ - value: token.tokenId, - balance: token.balance, - label: `#${token.tokenId}`, - title: `VeBoba - ${token.balance}`, - subTitle: `Lock Amount - ${token.lockedAmount}`, - icon: BobaNFTGlass - })) - setNftOptions(options); - } - - return () => { - setNftOptions([]); - }; - }, [ records ]); - - - useEffect(() => { - const filterUsedTokens = async () =>{ - setloadingOptions(true); - const filterOptionP = nftOptions - .map(async (token) => { - const receipt = await networkService.checkProposalVote( - proposalId, - token.value - ) - if (!receipt || !receipt.hasVoted) { - return token - } - }).filter(Boolean) - - const tokensRes = await Promise.all(filterOptionP); - const filterTokens = tokensRes.filter(Boolean) - setloadingOptions(false); - setFilterOptions(filterTokens); - } - - filterUsedTokens(); - }, [nftOptions, proposalId]); - const onVoteTypeChange = (voteType) => { setselectedVoteType(voteType) } @@ -101,21 +47,11 @@ const CastVoteModal = ({ open, proposalId }) => { { value: 2, label: 'Vote Abstain' } ] - const customStyles = { - option: (provided, state) => ({ - ...provided, - color: state.isSelected ? '#282828' : '#909090', - }), - } - const submit = async () => { - const tokenIds = tokens.map((t) => t.value); - const res = await dispatch( castProposalVote({ id: Number(proposalId), - userVote: selectedVoteType.value, - tokenIds + userVote: selectedVoteType.value }) ); @@ -145,26 +81,13 @@ const CastVoteModal = ({ open, proposalId }) => { items={options} /> - setTokens(option)} - defaultItem={{ - value: null, - label: 'Select Nft token', - }} - items={filterOptions} - /> - - - ) - } - - return ( - <> - - {!isBridge && - - Classic Bridge {token && token.symbol ? token.symbol : ''} to L2 - - } - { - setAmount(i.target.value) - setValue_Wei_String(toWei_String(i.target.value, token.decimals)) - }} - onUseMax={(i) => {//they want to use the maximum - setAmount(maxValue) //so the input value updates for the user - just for display purposes - setValue_Wei_String(token.balance.toString()) //this is the one that matters - }} - allowUseAll={true} - unit={token.symbol} - maxValue={maxValue} - variant="standard" - newStyle - isBridge={isBridge} - openTokenPicker={openTokenPicker} - /> - - setEnableToL2Account(e.target.checked)} - name="L2Account" - color="primary" - /> - } - label="Enable Deposit to other L2 Account" - /> - - {!!enableToL2Account && - setRecipient(i.target.value)} - fullWidth - paste - sx={{ fontSize: '50px' }} - newStyle - />} - - {!!convertToUSD && ( - - {`Amount in USD ${amountToUsd(value, lookupPrice, token).toFixed(2)}`} - - )} - - {!!token && token.symbol === 'OMG' && ( - - NOTE: The OMG Token was minted in 2017 and it does not conform to the ERC20 token standard. - In some cases, three interactions with MetaMask are needed. If you are bridging out of a - new wallet, it starts out with a 0 approval, and therefore, only two interactions with - MetaMask will be needed. - - )} - - - - - - - - ) -} - -export default React.memo(InputStep) diff --git a/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepBatch.js b/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepBatch.js deleted file mode 100644 index 0bd9f39b36..0000000000 --- a/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepBatch.js +++ /dev/null @@ -1,454 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' - - -import { Box, Typography, useMediaQuery,useTheme } from '@mui/material' - -import { depositL1LPBatch, approveFastDepositBatch, fetchBalances } from 'actions/networkAction' -import { utils } from 'ethers' - -import { openModal, openError, setActiveHistoryTab } from 'actions/uiAction' -import { setCDMCompletion } from 'actions/transactionAction' - -import Button from 'components/button/Button' -import Input from 'components/input/Input' -import { CounterButton } from 'components'; - -import { WrapperActionsModal } from 'components/modal/styles' - -import { - selectLoading, - selectSignatureStatus_depositLP, - selectlayer1Balance, - selectFastDepositBatchCost, - selectL1FeeBalance, - selectUserAndL2LPBalanceBatch, - } from 'selectors' - -import networkService from 'services/networkService' - -import parse from 'html-react-parser' - -import { - fetchL2TotalFeeRate, - fetchL1FeeBalance, - fetchUserAndL2LPBalanceBatch, - fetchFastDepositBatchCost, - } from 'actions/balanceAction' - - -function InputStepBatch({ isBridge, handleClose }) { - - const dispatch = useDispatch() - - const [ payload, setPayload ] = useState([{}]) - const [ tokenList, setTokenList ] = useState([]) - - const userBalance = useSelector(selectlayer1Balance) - const batchInfo = useSelector(selectUserAndL2LPBalanceBatch) - - const batchCost = useSelector(selectFastDepositBatchCost) - const feeBalance = useSelector(selectL1FeeBalance) //amount of ETH on L1 to pay gas - - const depositLoading = useSelector(selectLoading(['DEPOSIT/CREATE'])) - const approvalLoading = useSelector(selectLoading(['APPROVE/CREATE'])) - - const signatureStatus = useSelector(selectSignatureStatus_depositLP) - - // console.log("ETH available for paying fees:",Number(feeBalance)) - async function doDeposit() { - - console.log(`User input payload: `, payload) - let updatedPayload = [] - for (const tokenInput of payload) { - const tokenBalance = userBalance.filter(i => i.symbol === tokenInput.symbol) - if (tokenBalance.length === 0) { - dispatch(openError('Failed to build appropriate payload')) - } else { - updatedPayload.push({...tokenInput, ...tokenBalance[0]}) - } - } - - console.log(`Updated payload: `, updatedPayload) - - let receipt = {transactionHash: '0x1234567890'} - receipt = await dispatch(approveFastDepositBatch(updatedPayload)) - - if(receipt === false) { - dispatch(openError('Failed to approve amount or user rejected signature')) - handleClose() - return - } - - receipt = await dispatch(depositL1LPBatch(updatedPayload)) - - if (receipt) { - const [token, receivedToken] = updatedPayload.reduce((tokenPayload, tokenInfo) => { - let [tokenStr, receivedTokenStr] = tokenPayload - if (tokenStr !== "") { - tokenStr += ", " - } - tokenStr += `${tokenInfo.symbol}` - if (receivedTokenStr !== "") { - receivedTokenStr += ", " - } - const l2LPFeeRate = batchInfo[tokenInfo.symbol].l2LPFeeRate - receivedTokenStr += `${(tokenInfo.value * (1 - l2LPFeeRate / 100)).toFixed(3)} ${tokenInfo.symbol}` - return [tokenStr, receivedTokenStr] - }, ["", ""]) - dispatch(setCDMCompletion({ - CDMType: 'L1FastBridge', - CDMMessage: { token, receivedToken }, - CDMTransaction: receipt - })) - dispatch(openModal('CDMCompletionModal')) - dispatch(setActiveHistoryTab('Boba Ethereum L2 to Ethereum')) - handleClose() - } - } - - useEffect(() => { - dispatch(fetchL2TotalFeeRate()) - dispatch(fetchL1FeeBalance()) //ETH balance for paying gas - dispatch(fetchBalances()) - - return ()=>{ - dispatch({type: 'BALANCE/L2/RESET'}) - } - }, [ dispatch ]) - - useEffect(() => { - dispatch(fetchUserAndL2LPBalanceBatch(tokenList)) - dispatch(fetchFastDepositBatchCost(tokenList)) - }, [ tokenList, dispatch ]) - - - useEffect(() => { - if (signatureStatus && depositLoading) { - //we are all set - can close the window - //transaction has been sent and signed - handleClose() - } - }, [ signatureStatus, depositLoading, handleClose ]) - - function getOptions() { - const selectTokens = Object.keys(payload).reduce((acc, cur) => { - acc.push(payload[cur].symbol) - return acc - }, []) - const effectTokens = userBalance.reduce((acc, cur) => { - acc.push(cur.symbol) - return acc - }, []) - return ['ETH', ...networkService.supportedTokens].reduce((acc, cur) => { - if (cur !== 'xBOBA' && !selectTokens.includes(cur) && effectTokens.includes(cur)) { - acc.push(cur) - } - return acc - },[]) - } - - let buttonLabel_1 = 'Cancel' - if( depositLoading || approvalLoading ) buttonLabel_1 = 'CLOSE WINDOW' - - let buttonLabel_2 = 'Bridge' - - if(depositLoading) { - buttonLabel_2 = "Bridging..." - } else if (approvalLoading) { - buttonLabel_2 = "Approving..." - } - - const theme = useTheme() - const isMobile = useMediaQuery(theme.breakpoints.down('md')) - - let ETHstring = '' - let warning = false - let validInput = true - - // Make sure user have enough ETH to cover the cost and ETH amount - // that they want to transfer - const filterETH = payload.filter(i => i.symbol === 'ETH') - if (filterETH.length === 1) { - // There should be only one input for ETH - const payloadETH = filterETH[0] - if (Number(payloadETH.value) + Number(batchCost) > Number(feeBalance)) { - warning = true - validInput = false - ETHstring = `
WARNING: your L1 ETH balance of ${Number(feeBalance).toFixed(4)} is not sufficient to cover this transaction. -
THIS TRANSACTION WILL FAIL.` - } - else if ((Number(payloadETH.value) + Number(batchCost)) > Number(feeBalance) * 0.96) { - warning = true - ETHstring = `
CAUTION: your L1 ETH balance of ${Number(feeBalance).toFixed(4)} is very close to the estimated total. -
THIS TRANSACTION MIGHT FAIL.` - } - } else if (filterETH.length > 1) { - // Disable the bridge button - validInput = false - } else { - if(Number(batchCost) > Number(feeBalance)) { - warning = true - ETHstring = `
WARNING: your L1 ETH balance of ${Number(feeBalance).toFixed(4)} is not sufficient to cover the estimated gas. -
THIS TRANSACTION WILL FAIL.` - } - else if(Number(batchCost) > Number(feeBalance) * 0.96) { - warning = true - validInput = false - ETHstring = `
CAUTION: your L1 ETH balance of ${Number(feeBalance).toFixed(4)} is very close to the estimated cost. -
THIS TRANSACTION MIGHT FAIL. It would be safer to have slightly more ETH in your L1 wallet to cover gas.` - } - } - - // Make sure all input value is correct - for (const tokenInput of payload) { - const tokenBalance = userBalance.filter(i => i.symbol === tokenInput.symbol) - // the token is not selected or the value is not provided - if (!tokenInput.symbol || !tokenInput.value) { - validInput = false - } - // the value should be larger than 0 - else if (Number(tokenInput.value) <= 0) { - validInput = false - } - // the balance should cover the amount - else if (tokenBalance.length === 1 && - Number(utils.parseUnits(tokenBalance[0].balance.toString(), tokenBalance[0].decimals).toString()) < tokenInput.value - ) { - validInput = false - } - else if (tokenBalance.length === 0) { - validInput = false - } - // the pool should have the liquidity to cover the value - else { - if (batchInfo[tokenInput.symbol]) { - const LPBalance = batchInfo[tokenInput.symbol].l2LPBalance - const LPRatio = batchInfo[tokenInput.symbol].LPRatio - if ( - (Number(LPRatio) < 0.10 && Number(tokenInput.value) > Number(LPBalance) * 0.90) || - (Number(LPRatio) < 0.10 && Number(tokenInput.value) <= Number(LPBalance) * 0.90) || - (Number(LPRatio) >= 0.10 && Number(tokenInput.value) > Number(LPBalance) * 0.90) - ) { - validInput = false - } - } - // We don't get the batch information - else { - validInput = false - } - } - } - - return ( - <> - - {!isBridge && - - Batch Bridge to Boba - - } - - {payload.map((_, index) => { - let maxValue = 0, LPRatio = 1, LPBalance = Infinity - if (payload[index].symbol && batchInfo[payload[index].symbol]) { - maxValue = batchInfo[payload[index].symbol].balance - LPRatio = batchInfo[payload[index].symbol].LPRatio - LPBalance = batchInfo[payload[index].symbol].l2LPBalance - } - return ( -
- - { - const updatedPayload = [...payload] - updatedPayload[index] = { ...updatedPayload[index], value: i.target.value } - setPayload(updatedPayload) - }} - onUseMax={(i)=>{//they want to use the maximum - const updatedPayload = [...payload] - updatedPayload[index] = { ...updatedPayload[index], value: maxValue } - setPayload(updatedPayload) - }} - onSelect={(i) => { - // Update payload - const updatedPayload = [...payload] - updatedPayload[index] = { ...updatedPayload[index], symbol: i.value } - setPayload(updatedPayload) - // Update token list - setTokenList(updatedPayload.reduce((acc, cur) => {acc.push(cur.symbol); return acc}, [])) - }} - allowUseAll={true} - unit={payload[index] ? payload[index].symbol ? payload[index].symbol : 'BOBA' : 'BOBA'} - maxValue={maxValue} - variant="standard" - newStyle - selectOptions={getOptions()} - selectValue={payload[index].symbol ? payload[index].symbol: ''} - style={{width: '100%'}} - /> -
- { - const updatedPayload = [...payload] - updatedPayload.push({}) - setPayload(updatedPayload) - }} - disabled={payload.length > 3} - /> - { - let updatedPayload = [...payload] - updatedPayload.splice(index, 1) - setPayload(updatedPayload) - // Update token list - setTokenList(updatedPayload.reduce((acc, cur) => { - if (typeof cur.symbol !== 'undefined') {acc.push(cur.symbol)}; return acc - }, [])) - }} - disabled={payload.length === 1} - /> -
-
- - {payload[index].symbol === 'OMG' && - - The OMG Token was minted in 2017 and it does not conform to the ERC20 token standard. - In some cases, three interactions with MetaMask are needed. - - } - - {(Number(LPRatio) < 0.10 && Number(payload[index].value) > Number(LPBalance) * 0.90) && ( - - The {payload[index].symbol} pool's balance and balance/liquidity ratio are low. - Please use the classic bridge. - - )} - - {(Number(LPRatio) < 0.10 && Number(payload[index].value) <= Number(LPBalance) * 0.90) && ( - - The {payload[index].symbol} pool's balance/liquidity ratio (of {Number(LPRatio).toFixed(2)}) is too low. - Please use the classic bridge. - - )} - - {(Number(LPRatio) >= 0.10 && Number(payload[index].value) > Number(LPBalance) * 0.90) && ( - - The {payload[index].symbol} pool's balance (of {Number(LPBalance).toFixed(2)} including inflight bridges) is too low. - Please use the classic bridge or reduce the amount. - - )} -
-
- ) - })} - - - Click the + symbol to add additional tokens to bridge. -
- Est. time: less than 10 minutes to 3 hours. -
- -
-
- Est. total fee - {batchCost === 0 ? <>: {Number(batchCost).toFixed(5)} ETH} -
-
- Est. bridge fee - {payload.map((_, index) => { - let l2LPFeeRate = 0.1 - if (payload[index].symbol && batchInfo[payload[index].symbol]) { - l2LPFeeRate = batchInfo[payload[index].symbol].l2LPFeeRate - } - if (payload[index].symbol) { - return ( - - {`${((payload[index].value ? payload[index].value: 0) * l2LPFeeRate / 100).toFixed(3)} ${payload[index].symbol} (${l2LPFeeRate}%)`} - - ) - } - return <> - })} -
-
- Est. receive - {payload.map((_, index) => { - let l2LPFeeRate = 0.1 - if (payload[index].symbol && batchInfo[payload[index].symbol]) { - l2LPFeeRate = batchInfo[payload[index].symbol].l2LPFeeRate - } - if (payload[index].symbol) { - return ( - - {`${((payload[index].value ? payload[index].value * (1 - l2LPFeeRate / 100): 0)).toFixed(3)} ${payload[index].symbol} `} - - ) - } - return <> - })} -
-
- - {warning && ( - - {parse(ETHstring)} - - )} - - {(depositLoading || approvalLoading) && ( - - This window will automatically close when your transaction has been signed and submitted. - - )} -
- - - - - - - ) -} - -export default React.memo(InputStepBatch) diff --git a/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepFast.js b/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepFast.js deleted file mode 100644 index 6f706c6c20..0000000000 --- a/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepFast.js +++ /dev/null @@ -1,440 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' - - - -import { Box, Typography, useMediaQuery,useTheme } from '@mui/material' - -import { depositL1LP, approveERC20 } from 'actions/networkAction' - -import { openModal, openError, setActiveHistoryTab } from 'actions/uiAction' -import { setCDMCompletion } from 'actions/transactionAction' - -import Button from 'components/button/Button' -import Input from 'components/input/Input' - -import { WrapperActionsModal } from 'components/modal/styles' -import BridgeFee from 'components/bridgeFee/BridgeFee' - - -import { - selectLoading, - selectLookupPrice, - selectSignatureStatus_depositLP, - selectL2FeeRateN, - selectFastDepositCost, - selectL2LPBalanceString, - selectL2LPPendingString, - selectL1FeeBalance, - selectL2LPLiquidity, - selectActiveNetworkName -} from 'selectors' - - -import networkService from 'services/networkService' -import { logAmount, amountToUsd, toWei_String } from 'util/amountConvert' - -import parse from 'html-react-parser' - -import BN from 'bignumber.js' - -import { - fetchFastDepositCost, - fetchL2LPBalance, - fetchL2LPPending, - fetchL2TotalFeeRate, - fetchL2FeeRateN, - fetchL1FeeBalance, - fetchL2LPLiquidity, -} from 'actions/balanceAction' - - -function InputStepFast({ handleClose, token, isBridge, openTokenPicker }) { - const dispatch = useDispatch() - - const [ value, setValue ] = useState('') - const [ value_Wei_String, setValue_Wei_String ] = useState('0') //support for Use Max - - const [ LPRatio, setLPRatio ] = useState(0) - - const LPBalance = useSelector(selectL2LPBalanceString) - const LPPending = useSelector(selectL2LPPendingString) - const LPLiquidity = useSelector(selectL2LPLiquidity) - - const feeRateN = useSelector(selectL2FeeRateN) - - const cost = useSelector(selectFastDepositCost) - - const feeBalance = useSelector(selectL1FeeBalance) //amount of ETH on L1 to pay gas - - const networkName = useSelector(selectActiveNetworkName()) - - const [ validValue, setValidValue ] = useState(false) - - const depositLoading = useSelector(selectLoading([ 'DEPOSIT/CREATE' ])) - const approvalLoading = useSelector(selectLoading([ 'APPROVE/CREATE' ])) - - const lookupPrice = useSelector(selectLookupPrice) - const signatureStatus = useSelector(selectSignatureStatus_depositLP) - - const allAddresses = networkService.getAllAddresses() - - const maxValue = logAmount(token.balance, token.decimals) - const lpUnits = logAmount(LPBalance, token.decimals) - const balanceSubPending = lpUnits - logAmount(LPPending, token.decimals) //subtract the in flight exits - - function setAmount(value) { - const tooSmall = new BN(value).lte(new BN(0.0)) - const tooBig = new BN(value).gt(new BN(maxValue)) - - - if (tooSmall || tooBig) { - setValidValue(false) - setValue(value) - return false - } else if ( - token.symbol === 'ETH' && - Number(cost) + Number(value) > Number(feeBalance) - ) { - //insufficient ETH to cover the ETH amount plus gas - setValidValue(false) - setValue(value) - return false - } else if (Number(cost) > Number(feeBalance)) { - //insufficient ETH to pay gas - setValidValue(false) - setValue(value) - return false - } else if (Number(LPRatio) < 0.1) { - //not enough balance/liquidity ratio - //we always want some balance for unstaking - setValidValue(false) - setValue(value) - return false - } else if (Number(value) > Number(balanceSubPending) * 0.9) { - //not enough absolute balance - //we don't want one large bridge to wipe out the entire balance - //NOTE - this logic still allows bridgers to drain the entire pool, but just more slowly than before - //this is because the every time someone exits, the limit is recalculated - //via Number(LPBalance) * 0.9, and LPBalance changes over time - setValidValue(false) - setValue(value) - return false - } else { - //Whew, finally! - setValidValue(true) - setValue(value) - return true - } - } - - const receivableAmount = (value) => { - return (Number(value) * ((100 - Number(feeRateN)) / 100)).toFixed(3) - } - - async function doDeposit() { - console.log(`${token.symbol} Amount to bridge to L2: ${value_Wei_String}`) - - let receipt = '' - - if (token.symbol === networkService.L1NativeTokenSymbol) { - - console.log("L1 Native token Fast Bridge") - - receipt = await dispatch(depositL1LP(token.address, value_Wei_String)) - - if (receipt) { - dispatch(setCDMCompletion({ - CDMType: 'L1FastBridge', - CDMMessage: { - token: `${token.symbol}`, - receivedToken: `${receivableAmount(Number(value))} ${token.symbol}` - }, - CDMTransaction: receipt - })) - dispatch(openModal('CDMCompletionModal')) - dispatch(setActiveHistoryTab(`${networkName[ 'l1' ]} to ${networkName[ 'l2' ]}`)) - handleClose() - return - } - } - - //at this point we know it's not ETH - console.log('ERC20 Fast Bridge') - - receipt = await dispatch( - approveERC20(value_Wei_String, token.address, allAddresses.L1LPAddress) - ) - - if (receipt === false) { - dispatch(openError('Failed to approve amount or user rejected signature')) - handleClose() - return - } - - receipt = await dispatch(depositL1LP(token.address, value_Wei_String)) - - if (receipt) { - dispatch(setActiveHistoryTab(`${networkName[ 'l1' ]} to ${networkName[ 'l2' ]}`)) - dispatch(setCDMCompletion({ - CDMType: 'L1FastBridge', - CDMMessage: { - token: `${token.symbol}`, - receivedToken: `${receivableAmount(Number(value))} ${token.symbol}` - }, - CDMTransaction: receipt - })) - dispatch(openModal('CDMCompletionModal')) - handleClose() - } - } - - //ok, we are on L1, but the funds will be paid out on l2 - //goal now is to find out as much as we can about the state of the l2 pools... - useEffect(() => { - if (typeof token !== 'undefined') { - dispatch(fetchL2LPBalance(token.addressL2)) - dispatch(fetchL2LPLiquidity(token.addressL2)) - dispatch(fetchL2LPPending(token.addressL1)) //lookup is, confusingly, via L1 token address - dispatch(fetchL2TotalFeeRate()) - dispatch(fetchL2FeeRateN(token.addressL2)) - dispatch(fetchFastDepositCost(token.address)) - dispatch(fetchL1FeeBalance()) //ETH balance for paying gas - return () => { - dispatch({ type: 'BALANCE/L2/RESET' }) - } - } - }, [ token, dispatch ]) - - useEffect(() => { - const lbl = Number(logAmount(LPLiquidity, token.decimals)) - if (lbl > 0) { - const lbp = Number(logAmount(LPBalance, token.decimals)) - const LPR = lbp / lbl - setLPRatio(Number(LPR).toFixed(3)) - } - }, [ LPLiquidity, LPBalance, token.decimals ]) - - useEffect(() => { - if (signatureStatus && depositLoading) { - //we are all set - can close the window - //transaction has been sent and signed - handleClose() - } - }, [ signatureStatus, depositLoading, handleClose ]) - - let buttonLabel_1 = 'Cancel' - if (depositLoading || approvalLoading) buttonLabel_1 = 'Close window' - - let buttonLabel_2 = 'Bridge' - - if (depositLoading) { - buttonLabel_2 = 'Bridging...' - } else if (approvalLoading) { - buttonLabel_2 = 'Approving...' - } - - const theme = useTheme() - const isMobile = useMediaQuery(theme.breakpoints.down('md')) - - let ETHstring = '' - let warning = false - - if (cost && Number(cost) > 0) { - if (token.symbol !== 'ETH') { - if (Number(cost) > Number(feeBalance)) { - warning = true - ETHstring = `WARNING: your L1 ETH balance of ${Number( - feeBalance - ).toFixed(4)} is not sufficient to cover the estimated gas. -
THIS TRANSACTION WILL FAIL.` - } else if (Number(cost) > Number(feeBalance) * 0.96) { - warning = true - ETHstring = `CAUTION: your L1 ETH balance of ${Number( - feeBalance - ).toFixed(4)} is very close to the estimated cost. -
THIS TRANSACTION MIGHT FAIL. It would be safer to have slightly more ETH in your L1 wallet to cover gas.` - } - } - - if (token.symbol === 'ETH') { - if (Number(value) + Number(cost) > Number(feeBalance)) { - warning = true - ETHstring = `WARNING: your L1 ETH balance of ${Number( - feeBalance - ).toFixed(4)} is not sufficient to cover this transaction. -
THIS TRANSACTION WILL FAIL.` - } else if (Number(value) + Number(cost) > Number(feeBalance) * 0.96) { - warning = true - ETHstring = `CAUTION: your L1 ETH balance of ${Number( - feeBalance - ).toFixed(4)} is very close to the estimated total. -
THIS TRANSACTION MIGHT FAIL.` - } - } - } - - if (Number(logAmount(token.balance, token.decimals)) === 0) { - //no token in this account - return ( - - - Sorry, nothing to deposit - no {token.symbol} in this wallet - - - - - - ) - } - - return ( - <> - - {!isBridge && ( - - Fast Bridge to L2 - - )} - - { - setAmount(i.target.value) - setValue_Wei_String(toWei_String(i.target.value, token.decimals)) - }} - onUseMax={(i) => { - //they want to use the maximum - setAmount(maxValue) //so the input value updates for the user - setValue_Wei_String(token.balance.toString()) - }} - allowUseAll={true} - unit={token.symbol} - maxValue={maxValue} - variant="standard" - newStyle - isBridge={isBridge} - openTokenPicker={openTokenPicker} - /> - - - - {Number(LPRatio) < 0.1 && - Number(value) > Number(balanceSubPending) * 0.9 && ( - - The {token.symbol} pool's balance and balance/liquidity ratio are - low. Please use the classic bridge. - - )} - - {Number(LPRatio) < 0.1 && - Number(value) <= Number(balanceSubPending) * 0.9 && ( - - The {token.symbol} pool's balance/liquidity ratio (of{' '} - {Number(LPRatio).toFixed(2)}) is too low. Please use the classic - bridge. - - )} - - {Number(LPRatio) >= 0.1 && - Number(value) > Number(balanceSubPending) * 0.9 && ( - - The {token.symbol} pool's balance (of{' '} - {Number(balanceSubPending).toFixed(2)} including inflight bridges) - is too low. Please use the classic bridge or reduce the amount. - - )} - - {warning && ( - - {parse(ETHstring)} - - )} - - {!!token && token.symbol === 'OMG' && ( - - The OMG Token was minted in 2017 and it does not confirm to the - ERC20 token standard. In some cases, three interactions with - MetaMask are needed. - - )} - - {!isBridge && (depositLoading || approvalLoading) && ( - - This window will automatically close when your transaction has been - signed and submitted. - - )} - - - - - - - - ) -} - -export default React.memo(InputStepFast) diff --git a/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepMultiChain.js b/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepMultiChain.js deleted file mode 100644 index b32b5b03bc..0000000000 --- a/packages/boba/gateway/src/containers/modals/deposit/steps/InputStepMultiChain.js +++ /dev/null @@ -1,241 +0,0 @@ - -import React, { useState, useEffect } from 'react' -import { useDispatch, useSelector } from 'react-redux' - -import { depositErc20ToL1 } from 'actions/networkAction' -import { openAlert, setActiveHistoryTab } from 'actions/uiAction' - -import Button from 'components/button/Button' -import Input from 'components/input/Input' - -import { selectLoading, selectLookupPrice,selectAltL1DepositCost, selectL1FeeBalance } from 'selectors' -import { - amountToUsd, logAmount, - // toWei_String -} from 'util/amountConvert' -import { getCoinImage } from 'util/coinImage' - -import { Box, Typography, useMediaQuery, useTheme} from '@mui/material' - -import { WrapperActionsModal } from 'components/modal/styles' - -import BN from 'bignumber.js' -import parse from 'html-react-parser' -import Select from 'components/select/Select' -import { fetchAltL1DepositFee, fetchL1FeeBalance } from 'actions/balanceAction' - -import networkService from 'services/networkService' - -/** - * @NOTE - * Cross Chain Bridging to alt L1 is only supported for BOBA as of now! - * - */ - -function InputStepMultiChain({ handleClose, token, isBridge, openTokenPicker }) { - - const getImageComponent = (symbol) => { - return {symbol} - } - - const options = [ - { value: 'BNB', label: 'BNB', title: 'BNB', image: getImageComponent("BNB") }, - { value: 'Avalanche', label: 'Avalanche', title: 'Avalanche', image: getImageComponent('AVAX') } - ].filter(i => networkService.supportedAltL1Chains.includes(i.value)) - - const dispatch = useDispatch() - const theme = useTheme() - - const isMobile = useMediaQuery(theme.breakpoints.down('md')) - - const [ value, setValue ] = useState('') - const [ altL1Bridge, setAltL1Bridge ] = useState('') - - const [ validValue, setValidValue ] = useState(false) - const depositLoading = useSelector(selectLoading([ 'DEPOSIT_ALTL1/CREATE' ])) - - const lookupPrice = useSelector(selectLookupPrice) - const depositFees = useSelector(selectAltL1DepositCost) - const feeBalance = useSelector(selectL1FeeBalance) //amount of ETH on L1 to pay gas - - const maxValue = logAmount(token.balance, token.decimals) - - function setAmount(value) { - - const tooSmall = new BN(value).lte(new BN(0.0)) - const tooBig = new BN(value).gt(new BN(maxValue)) - - if (tooSmall || tooBig) { - setValidValue(false) - } else { - setValidValue(true) - } - - setValue(value) - } - - async function doDeposit() { - - const res = await dispatch(depositErc20ToL1({ - value: value, - type: altL1Bridge - })) - - if (res) { - dispatch(openAlert(`Successfully bridge ${token.symbol} to alt L1 ${altL1Bridge}!`)) - dispatch(setActiveHistoryTab('Bridge between L1s')) - handleClose() - } else { - console.log(`šŸ¤¦ opps something wrong!`) - handleClose() - } - } - - useEffect(() => { - dispatch(fetchL1FeeBalance()) //ETH balance for paying gas - dispatch(fetchAltL1DepositFee()) - },[dispatch]) - - let buttonLabel_1 = 'Cancel' - if (depositLoading) buttonLabel_1 = 'Close' - - let convertToUSD = false - - if (Object.keys(lookupPrice) && - !!value && - validValue && - !!amountToUsd(value, lookupPrice, token) - ) { - convertToUSD = true - } - - if (Number(logAmount(token.balance, token.decimals)) === 0) { - //no token in this account - return ( - - - Sorry, nothing to deposit - no {token.symbol} in this wallet - - - ) - } - - const onBridgeChange = (e) => { - setAltL1Bridge(e.target.value) - } - - const customStyles = { - option: (provided, state) => ({ - ...provided, - color: state.isSelected ? '#282828' : '#909090', - }), - } - - let ETHstring = '' - let warning = false - - if (depositFees[altL1Bridge]) { - if(Number(depositFees[altL1Bridge].fee) > Number(feeBalance)) { - warning = true - ETHstring = `WARNING: your L1 ${networkService.L1NativeTokenSymbol} balance of ${Number(feeBalance).toFixed(4)} is not sufficient to cover this transaction.` - } - } - - return ( - <> - - - Bridge {token && token.symbol ? token.symbol : ''} to Alt L1s - - - - { - setAmount(i.target.value) - // setValue_Wei_String(toWei_String(i.target.value, token.decimals)) - }} - onUseMax={(i) => {//they want to use the maximum - setAmount(maxValue) //so the input value updates for the user - just for display purposes - // setValue_Wei_String(token.balance.toString()) //this is the one that matters - }} - allowUseAll={true} - unit={token.symbol} - maxValue={maxValue} - variant="standard" - newStyle - isBridge={isBridge} - openTokenPicker={openTokenPicker} - /> - - - {!!altL1Bridge && depositFees? <> - - Estimated fee for bridging {value} {token.symbol} is {depositFees[altL1Bridge].fee} ETH - - : null} - - {!!convertToUSD && ( - - {`Amount in USD ${amountToUsd(value, lookupPrice, token).toFixed(2)}`} - - )} - - {warning && ( - - {parse(ETHstring)} - - )} - - - - - - - - ) -} - -export default React.memo(InputStepMultiChain) diff --git a/packages/boba/gateway/src/containers/modals/exit/ExitModal.js b/packages/boba/gateway/src/containers/modals/exit/ExitModal.js deleted file mode 100644 index 13a9e49dab..0000000000 --- a/packages/boba/gateway/src/containers/modals/exit/ExitModal.js +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React from 'react' -import { useDispatch } from 'react-redux' - -import Modal from 'components/modal/Modal' -import { closeModal } from 'actions/uiAction' - -import DoExitStep from './steps/DoExitStep' -import DoExitStepFast from './steps/DoExitStepFast' -import { fetchTransactions } from 'actions/networkAction' - -function ExitModal({ open, token, fast }) { - - const dispatch = useDispatch() - - function handleClose() { - dispatch(closeModal('exitModal')) - dispatch(fetchTransactions()) - } - - return ( - - {!!fast ? ( - - ) : ( - - )} - - ) -} - -export default React.memo(ExitModal) diff --git a/packages/boba/gateway/src/containers/modals/exit/steps/DoExitStep.js b/packages/boba/gateway/src/containers/modals/exit/steps/DoExitStep.js deleted file mode 100644 index 49d611f250..0000000000 --- a/packages/boba/gateway/src/containers/modals/exit/steps/DoExitStep.js +++ /dev/null @@ -1,412 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState, useEffect } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { utils } from 'ethers' - - - -import { Box, Typography, useMediaQuery,useTheme } from '@mui/material' - -import { exitBOBA } from 'actions/networkAction' -import { openModal } from 'actions/uiAction' -import { setCDMCompletion } from 'actions/transactionAction' - -import Button from 'components/button/Button' -import Input from 'components/input/Input' -import BridgeFee from 'components/bridgeFee/BridgeFee' - -import { - selectLoading, - selectSignatureStatus_exitTRAD, - selectLookupPrice, - selectBobaFeeChoice, - selectBobaPriceRatio, - selectClassicExitCost, //estimated total cost of this exit - selectL2BalanceETH, - selectL2BalanceBOBA, - selectExitFee, -} from 'selectors' - - - - -import { amountToUsd, logAmount, toWei_String } from 'util/amountConvert' - -import { WrapperActionsModal } from 'components/modal/styles' - - -import BN from 'bignumber.js' - -import { - fetchClassicExitCost, - fetchL2BalanceETH, - fetchL2BalanceBOBA, - fetchExitFee, -} from 'actions/balanceAction' - -import networkService from 'services/networkService' - -function DoExitStep({ handleClose, token, isBridge, openTokenPicker }) { - - const dispatch = useDispatch() - - const [ value, setValue ] = useState('') - const [ value_Wei_String, setValue_Wei_String ] = useState('0') // support for Use Max - amount to transfer in wei_string - const [ max_Float, setMax_Float ] = useState(0.0) // support for Use Max - a number like 0.09 ETH - const [ errorString, setErrorString ] = useState('') - - - const [ feeETH, setFeeETH ] = useState(0.0) - const [ feeBOBA, setFeeBOBA ] = useState(0.0) - - const [ validValue, setValidValue ] = useState(false) - const loading = useSelector(selectLoading(['EXIT/CREATE'])) - - const signatureStatus = useSelector(selectSignatureStatus_exitTRAD) - const lookupPrice = useSelector(selectLookupPrice) - - const cost = useSelector(selectClassicExitCost) - - const feeBalanceETH = useSelector(selectL2BalanceETH) - const feeBalanceBOBA = useSelector(selectL2BalanceBOBA) - - const feeUseBoba = useSelector(selectBobaFeeChoice()) - const feePriceRatio = useSelector(selectBobaPriceRatio()) - - const exitFee = useSelector(selectExitFee) - - - function setAmount(value) { - // (Number(value) + feeBOBA + exitFee) > balance) - - - const balance = Number(logAmount(token.balance, token.decimals)) - - const tooSmall = new BN(value).lte(new BN(0.0)) - const tooBig = new BN(value).gt(new BN(max_Float)) - - setErrorString('') - - if (value <= 0) { - setValidValue(false) - setValue(value) - return false - } - else if (tooSmall) { - setValidValue(false) - setValue(value) - return false - } - else if (tooBig) { - setValidValue(false) - setValue(value) - return false - } - else if ( - exitFee > Number(feeBalanceBOBA)) { - setErrorString(`Insufficient BOBA balance to cover xChain message relay. You need at least ${exitFee} BOBA.`) - setValidValue(false) - setValue(value) - return false - } - else if ( - token.symbol === 'ETH' && - (Number(value) + feeETH) > balance) { - if(feeUseBoba) - setErrorString('Warning: ETH amount + fees > balance. Even if you pay in BOBA, you still need to maintain a minimum ETH balance in your wallet') - else - setErrorString('Warning: ETH amount + fees > balance') - setValidValue(false) - setValue(value) - return false - } - else if ( - //pay BOBA, exit BOBA - check BOBA amount - feeUseBoba && - token.symbol === 'BOBA' && - (Number(value) + feeBOBA + exitFee) > balance) - { - // insufficient BOBA to cover the BOBA amount plus gas plus exitFee - setErrorString('Warning: BOBA amount + fees > balance') - setValidValue(false) - setValue(value) - return false - } - else if ( - // insufficient ETH to cover exit fees - // it does not matter if you are paying in ETH or BOBA - feeETH > Number(feeBalanceETH)) - { - // insufficient ETH to cover exit fees - if(feeUseBoba) - setErrorString('Warning: ETH balance too low. Even if you pay in BOBA, you still need to maintain a minimum ETH balance in your wallet') - else - setErrorString('Warning: ETH balance too low to cover gas') - setValidValue(false) - setValue(value) - return false - } - else if ( - // insufficient BOBA to cover exit fees - feeUseBoba && - (feeBOBA + exitFee) > Number(feeBalanceBOBA)) - { - setErrorString('Warning: BOBA balance too low to cover gas/fees') - setValidValue(false) - setValue(value) - return false - } else { - //Whew, finally! - setValidValue(true) - setValue(value) - return true - } - - } - - async function doExit() { - - const receipt = await dispatch( - exitBOBA( - token.address, - value_Wei_String - ) - ) - - if (receipt) { - dispatch(setCDMCompletion({ - CDMType: 'L2StandardBridge', - CDMMessage: { token: `${utils.formatUnits(value_Wei_String, token.decimals)} ${token.symbol}` }, - CDMTransaction: { transactionHash: receipt.hash } - })) - dispatch(openModal('CDMCompletionModal')) - handleClose() - } - } - - const theme = useTheme() - const isMobile = useMediaQuery(theme.breakpoints.down('md')) - - let buttonLabel = 'Cancel' - if( loading ) buttonLabel = 'Close' - - useEffect(() => { - if (signatureStatus && loading) { - //we are all set - can close the window - //transaction has been sent and signed - handleClose() - } - }, [ signatureStatus, loading, handleClose ]) - - useEffect(() => { - if (typeof(token) !== 'undefined') { - dispatch(fetchClassicExitCost(token.address)) - dispatch(fetchL2BalanceETH()) - dispatch(fetchL2BalanceBOBA()) - dispatch(fetchExitFee()) - } - }, [ token, dispatch ]) - - useEffect(() => { - - function estimateMax() { - - const safeCost = Number(cost) * 1.04 // 1.04 = safety margin on the cost - - setFeeETH(safeCost) - setFeeBOBA(safeCost * feePriceRatio) - - const balance = Number(logAmount(token.balance, token.decimals)) - - // because of MetaMask issue always have to limit ETH - // if(token.symbol === 'ETH') { - if(token.symbol === networkService.L1NativeTokenSymbol) { - if(balance - safeCost > 0.0) - setMax_Float(balance - safeCost) - else - setMax_Float(0.0) - } - else if (token.symbol === 'BOBA' && feeUseBoba) { - if(balance - (safeCost * feePriceRatio) - exitFee > 0.0) - setMax_Float(balance - (safeCost * feePriceRatio) - exitFee) - else - setMax_Float(0.0) - } - else if (token.symbol === 'BOBA' && !feeUseBoba) { - if(balance - exitFee > 0.0) - setMax_Float(balance - exitFee) - else - setMax_Float(0.0) - } - else { - setMax_Float(balance) - } - } - if (Number(cost) > 0) estimateMax() - }, [ token, cost, feeUseBoba, feePriceRatio, exitFee ]) - - let estGas = '' - - - if(feeETH && Number(feeETH) > 0) { - if(feeUseBoba) { - estGas = `${Number(feeBOBA).toFixed(4)} BOBA` - } else { - estGas = `${Number(feeETH).toFixed(4)} ${networkService.L1NativeTokenSymbol}` - } - } - - // prohibit ExitAll when paying with the token that is to be exited - let allowUseAll = true - if(token.symbol === 'ETH') { - allowUseAll = false - } - else if (token.symbol === 'BOBA' && feeUseBoba) { - allowUseAll = false - } - - let receiveL1 = `${Number(value).toFixed(3)} ${token.symbol} - ${!!amountToUsd(value, lookupPrice, token) ? `($${amountToUsd(value, lookupPrice, token).toFixed(2)})`: ''}` - - if( Number(logAmount(token.balance, token.decimals)) === 0) { - //no token in this account - return ( - - - Sorry, nothing to exit - no {token.symbol} in this wallet - - - ) - } else if ( exitFee > Number(feeBalanceBOBA) ) { - //no token in this account - return ( - - -
- BOBA balance: {Number(feeBalanceBOBA)} -
- Insufficient BOBA balance to cover xChain message relay. You need at least {exitFee} BOBA. -
- -
) - } - - return ( - <> - - - {!isBridge && - - Classic Bridge to L1 ({`${token ? token.symbol : ''}`}) - - } - - {max_Float > 0.0 && - { - setAmount(i.target.value) - setValue_Wei_String(toWei_String(i.target.value, token.decimals)) - }} - onUseMax={(i)=>{ //they want to use the maximum - setAmount(max_Float) //so the display value updates for the user - setValue_Wei_String(token.balance.toString()) - }} - allowUseAll={allowUseAll} - unit={token.symbol} - maxValue={max_Float} - variant="standard" - newStyle - isBridge={isBridge} - openTokenPicker={openTokenPicker} - /> - } - - {max_Float === 0 && - - Loading... - - } - - - - {errorString !== '' && - - {errorString} - - } - - { !isBridge && loading && ( - - This window will close when your transaction has been signed and submitted. - - )} - - - - - {token && ( - - )} - - - - ) -} - -export default React.memo(DoExitStep) diff --git a/packages/boba/gateway/src/containers/modals/exit/steps/DoExitStepFast.js b/packages/boba/gateway/src/containers/modals/exit/steps/DoExitStepFast.js deleted file mode 100644 index 4f96f673c4..0000000000 --- a/packages/boba/gateway/src/containers/modals/exit/steps/DoExitStepFast.js +++ /dev/null @@ -1,491 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState, useEffect } from 'react' - -import { useDispatch, useSelector } from 'react-redux' - -import { depositL2LP } from 'actions/networkAction' -import { openModal } from 'actions/uiAction' -import { setCDMCompletion } from 'actions/transactionAction' - -import { - selectLoading, - selectSignatureStatus_exitLP, - selectLookupPrice, - selectL1FeeRateN, - selectFastExitCost, //estimated total cost of this exit - selectL1LPBalanceString, - selectL1LPPendingString, - selectL2BalanceBOBA, - selectL2BalanceETH, - selectL1LPLiquidity, - selectExitFee, - selectBobaFeeChoice, - selectBobaPriceRatio, -} from 'selectors' - - -import Button from 'components/button/Button' -import Input from 'components/input/Input' -import BridgeFee from 'components/bridgeFee/BridgeFee' - -import { amountToUsd, logAmount, toWei_String } from 'util/amountConvert' - -import { Box, Typography, useMediaQuery,useTheme } from '@mui/material' - -import { WrapperActionsModal } from 'components/modal/styles' - -import BN from 'bignumber.js' - -import { - fetchFastExitCost, - fetchL1LPBalance, - fetchL1LPPending, - fetchL1TotalFeeRate, - fetchL1FeeRateN, - fetchL2BalanceBOBA, - fetchL2BalanceETH, - fetchL1LPLiquidity, - fetchExitFee, -} from 'actions/balanceAction' - - -import networkService from 'services/networkService' - -function DoExitStepFast({ handleClose, token, isBridge, openTokenPicker }) { - - const dispatch = useDispatch() - - const [ value, setValue ] = useState('') - const [ value_Wei_String, setValue_Wei_String ] = useState('0') - const [ max_Float, setMax_Float ] = useState(0.0) // support for Use Max - a number like 0.09 ETH - - const [ errorString, setErrorString ] = useState('') - - const [ feeETH, setFeeETH ] = useState(0.0) - const [ feeBOBA, setFeeBOBA ] = useState(0.0) - - const [ LPRatio, setLPRatio ] = useState(0) - - const LPBalance = useSelector(selectL1LPBalanceString) - const LPPending = useSelector(selectL1LPPendingString) - const LPLiquidity = useSelector(selectL1LPLiquidity) - - const feeRateN = useSelector(selectL1FeeRateN) - - const cost = useSelector(selectFastExitCost) - - const feeBalanceETH = useSelector(selectL2BalanceETH) - const feeBalanceBOBA = useSelector(selectL2BalanceBOBA) - - const feeUseBoba = useSelector(selectBobaFeeChoice()) - const feePriceRatio = useSelector(selectBobaPriceRatio()) - - const [ validValue, setValidValue ] = useState(false) - - const loading = useSelector(selectLoading(['EXIT/CREATE'])) - - const lookupPrice = useSelector(selectLookupPrice) - const signatureStatus = useSelector(selectSignatureStatus_exitLP) - - const lpUnits = logAmount(LPBalance, token.decimals) - const balanceSubPending = lpUnits - logAmount(LPPending, token.decimals) //subtract the in flight exits - - const exitFee = useSelector(selectExitFee) - - function setAmount(value) { - - const balance = Number(logAmount(token.balance, token.decimals)) - - const tooSmall = new BN(value).lte(new BN(0.0)) - const tooBig = new BN(value).gt(new BN(max_Float)) - - setErrorString('') - - if (value <= 0) { - setValidValue(false) - setValue(value) - return false - } - else if (tooSmall) { - setValidValue(false) - setValue(value) - return false - } - else if (tooBig) { - setValidValue(false) - setValue(value) - return false - } - else if ( - exitFee > Number(feeBalanceBOBA)) { - setErrorString(`Insufficient BOBA balance to cover xChain message relay. You need at least ${exitFee} BOBA`) - setValidValue(false) - setValue(value) - return false - } - else if ( - token.symbol === 'ETH' && - (Number(value) + feeETH) > balance) { - if(feeUseBoba) - setErrorString('Warning: ETH amount + fees > balance. Even if you pay in BOBA, you still need to maintain a minimum ETH balance in your wallet') - else - setErrorString('Warning: ETH amount + fees > balance') - setValidValue(false) - setValue(value) - return false - } - else if ( - //pay BOBA, exit BOBA - check BOBA amount - feeUseBoba && - token.symbol === 'BOBA' && - (Number(value) + feeBOBA + exitFee) > balance) - { - // insufficient BOBA to cover the BOBA amount plus gas plus exitFee - setErrorString('Warning: BOBA amount + fees > balance') - setValidValue(false) - setValue(value) - return false - } - else if ( - // insufficient ETH to cover exit fees - // it does not matter if you are paying in ETH or BOBA - feeETH > Number(feeBalanceETH)) - { - // insufficient ETH to cover exit fees - if(feeUseBoba) - setErrorString('Warning: ETH balance too low. Even if you pay in BOBA, you still need to maintain a minimum ETH balance in your wallet') - else - setErrorString('Warning: ETH balance too low to cover gas') - setValidValue(false) - setValue(value) - return false - } - else if ( - // insufficient BOBA to cover exit fees - feeUseBoba && - (feeBOBA + exitFee) > Number(feeBalanceBOBA)) - { - setErrorString('Warning: BOBA balance too low to cover gas/fees') - setValidValue(false) - setValue(value) - return false - } - else if (Number(LPRatio) < 0.1) { - // not enough balance/liquidity ratio - // we always want some balance for unstaking - setErrorString('Warning: Insufficient balance in pool - reduce amount or use classical exit') - setValidValue(false) - setValue(value) - return false - } - else if (Number(value) > Number(balanceSubPending) * 0.9) { - //not enough absolute balance - //we don't want one large bridge to wipe out all the balance - //NOTE - this logic still allows bridgers to drain the entire pool, but just more slowly than before - //this is because the every time someone exits, the limit is recalculated - //via Number(LPBalance) * 0.9, and LPBalance changes over time - setErrorString('Warning: Insufficient balance in pool - reduce amount or use classical exit') - setValidValue(false) - setValue(value) - return false - } else { - //Whew, finally! - setValidValue(true) - setValue(value) - return true - } - - } - - const receivableAmount = (value) => { - return (Number(value) * ((100 - Number(feeRateN)) / 100)).toFixed(3) - } - - async function doExit() { - - let receipt = await dispatch( - depositL2LP( - token.address, - value_Wei_String - ) - ) - - if (receipt) { - dispatch(setCDMCompletion({ - CDMType: 'L2FastBridge', - CDMMessage: { - token: `${token.symbol}`, - receivedToken: `${receivableAmount(Number(value))} ${token.symbol}` - }, - CDMTransaction: { transactionHash: receipt.hash } - })) - dispatch(openModal('CDMCompletionModal')) - handleClose() - } - - } - - useEffect(() => { - if (typeof(token) !== 'undefined') { - dispatch(fetchL1LPBalance(token.addressL1)) - dispatch(fetchL1LPLiquidity(token.addressL1)) - dispatch(fetchL1LPPending(token.addressL2)) //lookup is, confusingly, via L2 token address - dispatch(fetchL1TotalFeeRate()) - dispatch(fetchL1FeeRateN(token.addressL1)) - dispatch(fetchFastExitCost(token.address)) - dispatch(fetchL2BalanceETH()) - dispatch(fetchL2BalanceBOBA()) - dispatch(fetchExitFee()) - } - // to clean up state and fix the - // error in console for max state update. - return ()=>{ - dispatch({type: 'BALANCE/L1/RESET'}) - } - }, [ token, dispatch ]) - - useEffect(() => { - const lbl = Number(logAmount(LPLiquidity, token.decimals)) - if(lbl > 0){ - const lbp = Number(logAmount(LPBalance, token.decimals)) - const LPR = lbp / lbl - setLPRatio(Number(LPR).toFixed(3)) - } - }, [ LPLiquidity, LPBalance, token.decimals ]) - - useEffect(() => { - if (signatureStatus && loading) { - //we are all set - can close the window - //transaction has been sent and signed - handleClose() - } - }, [ signatureStatus, loading, handleClose ]) - - useEffect(() => { - function estimateMax() { - - const safeCost = Number(cost) * 1.04 // 1.04 = safety margin on the cost - - setFeeETH(safeCost) - setFeeBOBA(safeCost * feePriceRatio) - - const balance = Number(logAmount(token.balance, token.decimals)) - - // because of MetaMask issue always have to limit ETH - if(token.symbol === networkService.L1NativeTokenSymbol) { - if(balance - safeCost > 0.0) - setMax_Float(balance - safeCost) - else - setMax_Float(0.0) - } - else if (token.symbol === 'BOBA' && feeUseBoba) { - if(balance - (safeCost * feePriceRatio) - exitFee > 0.0) - setMax_Float(balance - (safeCost * feePriceRatio) - exitFee) - else - setMax_Float(0.0) - } - else if (token.symbol === 'BOBA' && !feeUseBoba) { - if(balance - exitFee > 0.0) - setMax_Float(balance - exitFee) - else - setMax_Float(0.0) - } - else { - setMax_Float(balance) - } - } - if (Number(cost) > 0) estimateMax() - }, [ token, cost, feeUseBoba, feePriceRatio, exitFee ]) - - const theme = useTheme() - const isMobile = useMediaQuery(theme.breakpoints.down('md')) - - let buttonLabel = 'Cancel' - if( loading ) buttonLabel = 'Close' - - let estGas = '' - if(feeETH && Number(feeETH) > 0) { - if(feeUseBoba) { - estGas = `${Number(feeBOBA).toFixed(4)} BOBA` - } else { - estGas = `${Number(feeETH).toFixed(4)} ${networkService.L1NativeTokenSymbol}` - } - } - - // prohibit ExitAll when paying with the token that is to be exited - let allowUseAll = true - if(token.symbol === networkService.L1NativeTokenSymbol) { - allowUseAll = false - } - - else if (token.symbol === 'BOBA' && feeUseBoba) { - allowUseAll = false - } - - let receiveL1 = `${receivableAmount(value)} ${token.symbol} - ${!!amountToUsd(value, lookupPrice, token) ? `($${amountToUsd(value, lookupPrice, token).toFixed(2)})`: ''}` - - if( Number(logAmount(token.balance, token.decimals)) === 0) { - //no token in this account - return ( - - - Sorry, nothing to exit - no {token.symbol} in this wallet - - - ) - } else if ( exitFee > Number(feeBalanceBOBA) ) { - //no token in this account - return ( - - -
- BOBA balance: {Number(feeBalanceBOBA)} -
- Insufficient BOBA balance to cover xChain message relay. You need at least {exitFee} BOBA. -
- -
) - } - - return ( - <> - - {!isBridge && - - Fast Bridge to L1 - - } - - {max_Float > 0.0 && - { - setAmount(i.target.value) - setValue_Wei_String(toWei_String(i.target.value, token.decimals)) - }} - onUseMax={(i)=>{ // they want to use the maximum - setAmount(max_Float) // so the display value updates for the user - setValue_Wei_String(token.balance.toString()) // this is ok because BridgeAll is blocked for both ETH and BOBA - }} - allowUseAll={allowUseAll} - unit={token.symbol} - maxValue={max_Float} - variant="standard" - newStyle - loading={loading} - isBridge={isBridge} - openTokenPicker={openTokenPicker} - /> - } - - {max_Float === 0 && - - Loading... - - } - - - - {errorString !== '' && - - {errorString} - - } - - {(Number(LPRatio) < 0.10 && Number(value) > Number(balanceSubPending) * 0.90) && ( - - The pool's balance and balance/liquidity ratio are too low. - Please use the classic bridge. - - )} - - {(Number(LPRatio) < 0.10 && Number(value) <= Number(balanceSubPending) * 0.90) && ( - - The pool's balance/liquidity ratio (of {Number(LPRatio).toFixed(2)}) is too low. - Please use the classic bridge. - - )} - - {(Number(LPRatio) >= 0.10 && Number(value) > Number(balanceSubPending) * 0.90) && ( - - The pool's balance (of {Number(balanceSubPending).toFixed(2)} including inflight bridges) is too low. - Please use the classic bridge or reduce the amount. - - )} - - {!isBridge && loading && ( - - This window will automatically close when your transaction has been signed and submitted. - - )} - - - - - - - - ) -} - -export default React.memo(DoExitStepFast) diff --git a/packages/boba/gateway/src/containers/modals/index.tsx b/packages/boba/gateway/src/containers/modals/index.tsx index 55c2ea5d29..2c6a27a6af 100644 --- a/packages/boba/gateway/src/containers/modals/index.tsx +++ b/packages/boba/gateway/src/containers/modals/index.tsx @@ -1,22 +1,18 @@ import React from 'react' import { useSelector } from 'react-redux' -import { selectBridgeType, selectModalState } from 'selectors' +import { selectModalState } from 'selectors' import CDMCompletionModal from './CDMCompletion/CDMCompletionModal' import CastVoteModal from './dao/CastVoteModal' import DelegateDaoModal from './dao/DelegateDaoModal' import NewProposalModal from './dao/NewProposalModal' -import DepositBatchModal from './deposit/DepositBatchModal' -import DepositModal from './deposit/DepositModal' + import EarnDepositModal from './earn/EarnDepositModal' import EarnWithdrawModal from './earn/EarnWithdrawModal' -import ExitModal from './exit/ExitModal' import InstallMetaMaskModal from './noMetaMask/InstallMetaMaskModal/InstallMetaMaskModal' import NoMetaMaskModal from './noMetaMask/NoMetaMaskModal' import SwitchNetworkModal from './switchNetwork/SwitchNetworkModal' import TokenPickerModal from './tokenPicker/TokenPickerModal' import TransferModal from './transfer/TransferModal' -import TransferNFTModal from './transfer/TransferNFTModal' -import ManageLockModal from './veBoba/ManageLockModal' import WrongNetworkModal from './wrongNetwork/WrongNetworkModal' import TransferPendingModal from './transferPending/TransferPending' import WalletSelectorModal from './walletSelector/WalletSelectorModal' @@ -33,17 +29,7 @@ import TransactionSuccessModal from './TransactionSuccessModal' */ const ModalContainer = () => { - const depositModalState = useSelector(selectModalState('depositModal')) - const depositBatchModalState = useSelector( - selectModalState('depositBatchModal') - ) - const transferModalState = useSelector(selectModalState('transferModal')) - const transferNFTModalState = useSelector( - selectModalState('transferNFTModal') - ) - - const exitModalState = useSelector(selectModalState('exitModal')) const tokenPickerModalState = useSelector(selectModalState('tokenPicker')) const transferPendingModalState = useSelector( selectModalState('transferPending') @@ -55,7 +41,6 @@ const ModalContainer = () => { const installMetaMaskModalState = useSelector( selectModalState('installMetaMaskModal') ) - const manageLockModalState = useSelector(selectModalState('manageLock')) const walletSelectorModalState = useSelector( selectModalState('walletSelectorModal') ) @@ -110,21 +95,9 @@ const ModalContainer = () => { return ( <> - {!!depositModalState && ( - - )} - {!!depositBatchModalState && ( - - )} {!!transferModalState && ( )} - {!!transferNFTModalState && ( - - )} - {!!exitModalState && ( - - )} {!!EarnDepositModalState && ( )} @@ -161,9 +134,6 @@ const ModalContainer = () => { {!!installMetaMaskModalState && ( )} - {!!manageLockModalState && ( - - )} {!!walletSelectorModalState && ( )} diff --git a/packages/boba/gateway/src/containers/modals/transfer/TransferNFTModal.js b/packages/boba/gateway/src/containers/modals/transfer/TransferNFTModal.js deleted file mode 100644 index c11a7454a1..0000000000 --- a/packages/boba/gateway/src/containers/modals/transfer/TransferNFTModal.js +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' - -import { transferNFT } from 'actions/networkAction' -import { closeModal, openAlert } from 'actions/uiAction' -import { selectLoading } from 'selectors' - -import { Box, Typography, useMediaQuery,useTheme } from '@mui/material' - - -import Button from 'components/button/Button' -import Modal from 'components/modal/Modal' -import Input from 'components/input/Input' - -import { WrapperActionsModal } from 'components/modal/styles' - -function TransferNFTModal ({ open, token }) { - - const dispatch = useDispatch() - - const [ recipient, setRecipient ] = useState('') - - const loading = useSelector(selectLoading([ 'TRANSFER/CREATE' ])) - - const theme = useTheme() - const isMobile = useMediaQuery(theme.breakpoints.down('md')) - - async function submit () { - if ( token.address && recipient ) - { - const transferResponseGood = await dispatch( - transferNFT(recipient, token) - ) - if (transferResponseGood) dispatch(openAlert('NFT transfer submitted')) - handleClose() - } - } - - function handleClose () { - setRecipient('') - dispatch(closeModal('transferNFTModal')) - } - - return ( - - - - Transfer an NFT to another Boba wallet - - - - To L2 Address: - - - - setRecipient(i.target.value)} - fullWidth - paste - sx={{fontSize: '50px', marginBottom: '20px'}} - /> - - - - - CAUTION: This function is only for transfering an NFT from one Boba wallet to another Boba wallet. - You cannot directly transfer an NFT from a Boba wallet to an L1 address or to another chain. - Your NFT will be lost if you try to do so. You can bridge NFTs to other chains on NFT marketplaces - that support bridging. - - - - - {!isMobile ? ( - - ) : null} - - - - ); -} - -export default React.memo(TransferNFTModal) diff --git a/packages/boba/gateway/src/containers/modals/veBoba/IncreaseLock.js b/packages/boba/gateway/src/containers/modals/veBoba/IncreaseLock.js deleted file mode 100644 index 4233a80bed..0000000000 --- a/packages/boba/gateway/src/containers/modals/veBoba/IncreaseLock.js +++ /dev/null @@ -1,221 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; - -import {convertDate, Now, addYear, addDays} from 'util/dates' -import DatePicker from 'react-datepicker'; - -import { Box, IconButton, Typography, useTheme } from '@mui/material'; - -import { BigNumber, utils } from 'ethers'; - -import { openAlert } from 'actions/uiAction'; -import { extendLockTime, increaseLockAmount } from 'actions/veBobaAction'; -import { - selectlayer2Balance, - selectAccountEnabled, - selectLayer, - selectLoading -} from 'selectors'; - -import Button from 'components/button/Button'; -import CalenderIcon from 'components/icons/CalenderIcon'; -import Input from 'components/input/Input'; - -import { useRef } from 'react'; -import "react-datepicker/dist/react-datepicker.css"; -import { toWei_String } from 'util/amountConvert'; - -import Styles from './ManageLockModal.module.scss'; -import * as S from './ManageLockModal.styles'; -import * as G from 'containers/Global.styles'; - -function IncreaseLock({ - handleClose, - lockInfo -}) { - - const { - tokenId, - lockedAmount, - expiry, - balance - } = lockInfo - - const dispatch = useDispatch() - const theme = useTheme() - - const layer = useSelector(selectLayer()) - const accountEnabled = useSelector(selectAccountEnabled()) - const layer2 = useSelector(selectlayer2Balance) - - const increaseLoading = useSelector(selectLoading([ 'LOCK/INCREASE_AMOUNT' ])) - const extendLoading = useSelector(selectLoading([ 'LOCK/EXTEND_TIME' ])) - - const datePickerRef = useRef() - - const [ amountTo, setAmountTo ] = useState(''); - const [ votingPower, setVotingPower ] = useState(0); - const [ expirtyTo, setExpiryTo ] = useState(convertDate(expiry, 'YYYY-MM-DD')); - - const [ maxBalance, setMaxBalance ] = useState(0); - - useEffect(() => { - if (expiry) { - setExpiryTo(convertDate(expiry, 'YYYY-MM-DD')); - } - }, [ expiry ]) - - useEffect(() => { - const endD = convertDate(expirtyTo); - const currD = Now(); - let secondsYear = 365 * 24 * 3600; - let secondsTillExpiry = endD.diff(currD, 'days') * 24 * 3600 - let vpower = (secondsTillExpiry / secondsYear) * (Number(lockedAmount) + Number(amountTo)); - setVotingPower(vpower.toFixed(2)) - }, [ amountTo, lockedAmount, expirtyTo ]) - - useEffect(() => { - if (layer2 && layer2.length > 0) { - const token = Object.values(layer2).find((t) => t[ 'symbolL2' ] === 'BOBA') - if (token) { - let max_BN = BigNumber.from(token.balance.toString()) - setMaxBalance(utils.formatUnits(max_BN, token.decimals)) - } - } - - }, [ layer2 ]); - - const onExtendTime = async () => { - const endD = convertDate(expirtyTo); - const currD = Now(); - // expiry duration in seconds - const diffD = endD.diff(currD, 'days') * 24 * 3600; - - const res = await dispatch(extendLockTime({ - tokenId, - lock_duration: diffD - })); - if (res) { - dispatch(openAlert('Lock time extended.')) - } - - handleClose(true); - } - - const onIncreaseAmount = async () => { - - const res = await dispatch(increaseLockAmount( - { - value_Wei_String: toWei_String(amountTo, 18), - tokenId - } - )); - - if (res) { - dispatch(openAlert('Lock amount increased.')) - } - - handleClose(true); - } - - const openDatePicker = () => { - let ele = datePickerRef.current; - ele.setFocus(true); - } - - - return - - - BOBA Balance: - {maxBalance} - - { setAmountTo(i.target.value) }} - onUseMax={i => { setAmountTo(maxBalance) }} - newStyle - disabled={!accountEnabled || layer !== 'L2'} - variant="standard" - /> - - - - - - - Lock for - - - - { setExpiryTo(convertDate(date,'yyyy-MM-DD')) }} - calendarClassName={theme.palette.mode} - /> - - - { - openDatePicker() - }} component="span"> - - - - - - - - - - - - Your voting power will be - - - {balance} {'->'} {votingPower}' - - - - - {lockedAmount} locked - - - until {convertDate(expiry,'YYYY/MM/DD')} - - - - -} - -export default IncreaseLock; diff --git a/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.js b/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.js deleted file mode 100644 index 92e744f292..0000000000 --- a/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.js +++ /dev/null @@ -1,58 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { useDispatch } from 'react-redux' - -import Modal from 'components/modal/Modal' - -import { closeModal } from 'actions/uiAction' - -import WithdrawLock from './WithdrawLock' -import {Now,convertDate} from 'util/dates' -import IncreaseLock from './IncreaseLock' -import { fetchLockRecords } from 'actions/veBobaAction' - - -function ManageLockModal({ - open, - lock -}) { - const dispatch = useDispatch() - - const [ isWithdrawable, setisWithdrawable ] = useState(false); - - useEffect(() => { - if (lock) { - let today = Now() - let expiry = convertDate(lock.expiry); - - let expired = expiry.isBefore(today); - setisWithdrawable(expired); // whether lock is withdrawable or not base expiry. - } - }, [ lock ]); - - const handleClose = (doReload = false) => { - dispatch(closeModal('manageLock')) - if (doReload) { - dispatch(fetchLockRecords()) - } - } - - return handleClose()} - maxWidth="xs" - title={'Manage Existing Lock'} - newStyle={true} - > - {isWithdrawable ? - - : - } - -} - -export default ManageLockModal; diff --git a/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.module.scss b/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.module.scss deleted file mode 100644 index d406772574..0000000000 --- a/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.module.scss +++ /dev/null @@ -1,31 +0,0 @@ -@import 'index.scss'; - -.datePickerInput { - position: relative; - - &::after { - content: ''; - width: 0; - height: 0; - position: absolute; - right: 10px; - font-size: 2rem; - bottom: 15px; - } - - input { - background: transparent; - border: none; - color: white; - font-weight: 300; - font-size: 2rem; - - &:focus-visible { - outline: none - } - } -} - -.popperStyle { - z-index: 3; -} diff --git a/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.styles.js b/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.styles.js deleted file mode 100644 index 8c5797244b..0000000000 --- a/packages/boba/gateway/src/containers/modals/veBoba/ManageLockModal.styles.js +++ /dev/null @@ -1,26 +0,0 @@ -import { Box, Grid } from "@mui/material"; -import { styled } from '@mui/material/styles'; - -export const Container = styled(Box)(({ theme }) => ({ - -})) - -export const LockFormContainer = styled(Grid)(({ theme }) => ({ - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.secondary, - display: 'flex', - flexDirection: 'column', - width: '100%' -})); - -export const LockRecordTitle = styled(Box)(({ theme }) => ({ - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.secondary -})) - -export const InlineContainer = styled(Box)(({ theme, children, ...props }) => ({ - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - ...props -})) diff --git a/packages/boba/gateway/src/containers/modals/veBoba/WithdrawLock.js b/packages/boba/gateway/src/containers/modals/veBoba/WithdrawLock.js deleted file mode 100644 index 63da2a8aff..0000000000 --- a/packages/boba/gateway/src/containers/modals/veBoba/WithdrawLock.js +++ /dev/null @@ -1,80 +0,0 @@ -import React from 'react'; -import { useDispatch } from 'react-redux'; -import { Box, Typography } from '@mui/material'; - -import { openAlert } from 'actions/uiAction'; -import { withdrawLock } from 'actions/veBobaAction'; - -import Button from 'components/button/Button'; - -import BobaNFTGlass from 'assets/images/boba2/BobaNFTGlass.svg'; - -import * as G from 'containers/Global.styles'; - -import {convertDate} from 'util/dates' - -function WithdrawLock({ - handleClose, - lockInfo -}) { - - const { - tokenId, - lockedAmount, - expiry - } = lockInfo - - const dispatch = useDispatch() - - const onWithdraw = async (tokenId) => { - const res = await dispatch(withdrawLock({tokenId})); - if (res) { - dispatch(openAlert('Lock Withdraw successful.')) - } - - handleClose(true); - } - - return - - - glass - - - - NFT ID: - - - #{tokenId} - - - - - - Lock Expiry : - - - {convertDate(expiry,'yyyy-MM-DD')} - - - - - Available Withdraw Amount - - - {lockedAmount} Boba - - - - -} - -export default WithdrawLock; diff --git a/packages/boba/gateway/src/containers/save/Save.tsx b/packages/boba/gateway/src/containers/save/Save.tsx index 49def22aa1..29660ea1ec 100644 --- a/packages/boba/gateway/src/containers/save/Save.tsx +++ b/packages/boba/gateway/src/containers/save/Save.tsx @@ -23,7 +23,7 @@ import { openModal } from 'actions/uiAction' import * as S from './Save.styles' -import Connect from 'containers/connect/Connect' +import Connect from 'containers/connect' import { toWei_String } from 'util/amountConvert' import networkService from 'services/networkService' diff --git a/packages/boba/gateway/src/containers/veboba/Lock.js b/packages/boba/gateway/src/containers/veboba/Lock.js deleted file mode 100644 index f54e26f63f..0000000000 --- a/packages/boba/gateway/src/containers/veboba/Lock.js +++ /dev/null @@ -1,61 +0,0 @@ -import { Box, Typography } from '@mui/material' -import React, { useEffect } from 'react' -import { fetchLockRecords } from 'actions/veBobaAction' -import AreaChart from 'components/areaChart/AreaChart' - -import * as G from '../Global.styles' -import * as S from './Lock.styles' - -import CreateLock from './createLock/CreateLock' -import LockRecords from './Records/Records' -import { useDispatch, useSelector } from 'react-redux' -import { selectAccountEnabled, selectLayer } from 'selectors' - -const data = [ - { name: '0', uv: 0 }, - { name: '3M', uv: 25 }, - { name: '6M', uv: 50 }, - { name: '12M', uv: 100 } -] - - -function Lock() { - const dispatch = useDispatch(); - const accountEnabled = useSelector(selectAccountEnabled()) - const layer = useSelector(selectLayer()) - - useEffect(() => { - if (!!accountEnabled && layer === 'L2') { - dispatch(fetchLockRecords()); - } - }, [ accountEnabled,layer, dispatch ]); - - - return - - - - Lock for Vote - More tokens locked for longer = greater voting power = higher rewards - - Locking Period vs Convert Ratio - 100 Boba locked for 6M = 50 veBoba - - - - - - - - - Lock Records - - - - - - -} - - -export default React.memo(Lock) diff --git a/packages/boba/gateway/src/containers/veboba/Lock.styles.js b/packages/boba/gateway/src/containers/veboba/Lock.styles.js deleted file mode 100644 index 9ac49b2579..0000000000 --- a/packages/boba/gateway/src/containers/veboba/Lock.styles.js +++ /dev/null @@ -1,36 +0,0 @@ -import { Box, Grid } from "@mui/material"; -import { styled } from '@mui/material/styles'; - -export const PageContainer = styled(Box)(({ theme }) => ({ - margin: '20px auto', - display: 'flex', - flexDirection: 'column', - justifyContent: 'space-around', - padding: '10px', - width: '70%', - [ theme.breakpoints.between('md', 'lg') ]: { - width: '90%', - padding: '0px', - }, - [ theme.breakpoints.between('sm', 'md') ]: { - width: '90%', - padding: '0px', - }, - [ theme.breakpoints.down('sm') ]: { - width: '100%', - padding: '0px', - }, -})); - -export const LockFormContainer = styled(Grid)(({ theme }) => ({ - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.secondary, - display: 'flex', - flexDirection: 'column', - width: '100%' -})); - -export const LockRecordTitle = styled(Box)(({ theme }) => ({ - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.secondary -})) diff --git a/packages/boba/gateway/src/containers/veboba/Records/RecordItem.js b/packages/boba/gateway/src/containers/veboba/Records/RecordItem.js deleted file mode 100644 index 38e707b3a8..0000000000 --- a/packages/boba/gateway/src/containers/veboba/Records/RecordItem.js +++ /dev/null @@ -1,74 +0,0 @@ -import { Box, Grid, Typography } from '@mui/material' -import Button from 'components/button/Button' -import * as G from 'containers/Global.styles' -import BobaNFTGlass from 'assets/images/boba2/BobaNFTGlass.svg' -import {isSameMonth, isSameWeek, isBeforeDate, convertDate} from 'util/dates' -import React from 'react' - -function RecordItem({ - onManage, - lock -}) { - - const { - tokenId, - lockedAmount, - balance, - expiry } = lock - - const expired = isBeforeDate(expiry); - - const sameMonth = isSameMonth(expiry); - const sameWeek = isSameWeek(expiry); - - let expiryText = ''; - if (sameMonth) { - expiryText= 'Expires this month' - } - if (sameWeek) { - expiryText= 'Expires in a week' - } - - return - - - - glass - - - #{tokenId} - - { - expired ? 'Expired': - convertDate(expiry,'YYYY-MM-DD')} - {expiryText} - - - - - - - {lockedAmount.toFixed(2)} - Boba - - - - - {balance.toFixed(2)} - veBoba - - - - - - - - - -} - -export default React.memo(RecordItem); diff --git a/packages/boba/gateway/src/containers/veboba/Records/Records.js b/packages/boba/gateway/src/containers/veboba/Records/Records.js deleted file mode 100644 index 4647515908..0000000000 --- a/packages/boba/gateway/src/containers/veboba/Records/Records.js +++ /dev/null @@ -1,80 +0,0 @@ -import { Grid, Typography } from '@mui/material' -import React, { Fragment, useState } from 'react' -import RecordItem from './RecordItem' - -import * as G from 'containers/Global.styles' -import { useSelector } from 'react-redux' -import { selectLockRecords, selectLoading} from 'selectors' -import { useDispatch } from 'react-redux' -import { openModal } from 'actions/uiAction' -import { Pager } from 'components' - -const PER_PAGE = 8 - -const LockRecords = () => { - - const dispatch = useDispatch(); - const loading = useSelector(selectLoading([ 'LOCK/RECORDS' ])); - const [page, setPage] = useState(1) - - const records = useSelector(selectLockRecords); - - const onManage = (lock) => { - dispatch(openModal('manageLock', null, null, null, lock)) - } - - const startingIndex = page === 1 ? 0 : ((page - 1) * PER_PAGE) - const endingIndex = page * PER_PAGE - const paginatedRecords = records.slice(startingIndex, endingIndex) - - - let totalNumberOfPages = Math.ceil(records.length / PER_PAGE) - - //if totalNumberOfPages === 0, set to one so we don't get the strange "page 1 of 0" display - if (totalNumberOfPages === 0) totalNumberOfPages = 1 - - return <> - - - - NFT ID / Lock Expires - - - - - Lock Amount - - - - - Vote Value - - - - - - - - {loading ? - - - loading... - - - : null} - {paginatedRecords.map((nftRecord, index) => - - {(index < 4) ? : null} - )} - setPage(page + 1)} - onClickBack={() => setPage(page - 1)} - /> - - -} - -export default React.memo(LockRecords) diff --git a/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.js b/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.js deleted file mode 100644 index 49bf42d980..0000000000 --- a/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.js +++ /dev/null @@ -1,203 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { BigNumber, utils } from 'ethers' -import {Now, convertDate, addDays,addYear} from 'util/dates' -import DatePicker from 'react-datepicker' - -import { Box, FormControlLabel, Radio, Typography, useTheme, IconButton } from '@mui/material' - -import Button from 'components/button/Button' -import Input from 'components/input/Input' -import CalenderIcon from 'components/icons/CalenderIcon' - -import * as G from 'containers/Global.styles' - -import { setConnectBOBA } from 'actions/setupAction' -import { createLock, fetchLockRecords } from 'actions/veBobaAction' - -import { - selectlayer2Balance, - selectAccountEnabled, - selectLayer, - selectLoading -} from 'selectors' - -import { toWei_String } from 'util/amountConvert' -import { openAlert } from 'actions/uiAction' - -import * as S from './CreateLock.styles' -import Styles from './CreateLock.module.scss' -import "react-datepicker/dist/react-datepicker.css" -import { useRef } from 'react' -import { EXPIRY_OPTIONS } from 'util/constant' - - -function CreateLock({ - onCreateSuccess -}) { - - const dispatch = useDispatch() - - const theme = useTheme() - const datePickerRef = useRef() - - const layer = useSelector(selectLayer()) - const accountEnabled = useSelector(selectAccountEnabled()) - const layer2 = useSelector(selectlayer2Balance) - const loading = useSelector(selectLoading([ 'LOCK/CREATE' ])) - - const [ value, setValue ] = useState(''); - - const [ expiry, setExpiry ] = useState(EXPIRY_OPTIONS[ 0 ].value); - const [ maxBalance, setMaxBalance ] = useState(0); - - useEffect(() => { - if (layer2 && layer2.length > 0) { - const token = Object.values(layer2).find((t) => t[ 'symbolL2' ] === 'BOBA') - if (token) { - let max_BN = BigNumber.from(token.balance.toString()) - setMaxBalance(utils.formatUnits(max_BN, token.decimals)) - } - } - - }, [ layer2 ]); - - const optionsProps = ({ value, label }) => ({ - checked: expiry === value, - onChange: (e) => setExpiry(e.target.value), - value: value, - label: {label} - }) - - async function connectToBOBA() { - dispatch(setConnectBOBA(true)) - } - - const openDatePicker = () => { - let ele = datePickerRef.current; - ele.setFocus(true); - } - - const conversioRation = () => { - const endD = convertDate(expiry); - const currD = Now(); - let secondsYear = 365 * 24 * 3600; - let secondsTillExpiry = endD.diff(currD, 'days') * 24 * 3600 - let ratio = (secondsTillExpiry / secondsYear); - return ratio.toFixed(2); - } - - - const onCreateLock = async () => { - - const endD = convertDate(expiry); - const currD = Now(); - // expiry duration in seconds - const diffD = endD.diff(currD, 'days') * 24 * 3600; - - const res = await dispatch(createLock({ - value_Wei_String: toWei_String(value, 18), - lock_duration: diffD - })) - setValue('') - setExpiry(EXPIRY_OPTIONS[ 0 ].value) - dispatch(fetchLockRecords()); - if (res) { - dispatch(openAlert('Lock has been created!')); - } - } - - return - - Create New Lock - - - - - - BOBA Balance: - {maxBalance} - - { setValue(i.target.value) }} - onUseMax={i => { setValue(maxBalance) }} - newStyle - disabled={!accountEnabled || layer !== 'L2'} - variant="standard" - /> - - - Lock for - - - {setExpiry(convertDate(date,'yyyy-MM-DD'))}} - calendarClassName={theme.palette.mode} - /> - - { - openDatePicker() - }} component="span"> - - - - - - Expires: - - { - EXPIRY_OPTIONS.map((item) => }> - ) - } - - - - - - - Convert ve BOBA Ratio - {conversioRation()} - - - Your voting power will be - {(conversioRation() * value).toFixed(2) } ve BOBA - - { - !accountEnabled || layer !== 'L2'? - : - } - - -} - - -export default React.memo(CreateLock) diff --git a/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.module.scss b/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.module.scss deleted file mode 100644 index 2a5b9af73f..0000000000 --- a/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.module.scss +++ /dev/null @@ -1,31 +0,0 @@ -@import 'index.scss'; - -.datePickerInput { - position: relative; - - &::after { - content: ''; - width: 0; - height: 0; - position: absolute; - right: 10px; - font-size: 25px; - bottom: 15px; - } - - input { - background: transparent; - border: none; - color: white; - font-weight: 300; - font-size: 2rem; - - &:focus-visible { - outline: none - } - } -} - -.popperStyle { - z-index: 3; -} diff --git a/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.styles.js b/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.styles.js deleted file mode 100644 index 6c452386ba..0000000000 --- a/packages/boba/gateway/src/containers/veboba/createLock/CreateLock.styles.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Box, Grid } from "@mui/material"; -import { styled } from '@mui/material/styles' - -export const LockFormContainer = styled(Grid)(({ theme }) => ({ - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.secondary, - display: 'flex', - flexDirection: 'column', - width: '100%' -})); - -export const LockRecordTitle = styled(Box)(({ theme }) => ({ - borderRadius: theme.palette.primary.borderRadius, - background: theme.palette.background.secondary -})) - -export const InlineContainer = styled(Box)(({ theme, children, ...props }) => ({ - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - ...props -})) diff --git a/packages/boba/gateway/src/deployment/contracts/BaseV1Voter.json b/packages/boba/gateway/src/deployment/contracts/BaseV1Voter.json deleted file mode 100644 index dcf2ad6a4f..0000000000 --- a/packages/boba/gateway/src/deployment/contracts/BaseV1Voter.json +++ /dev/null @@ -1,726 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "BaseV1Voter", - "sourceName": "contracts/BaseV1-voter.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "__ve", - "type": "address" - }, - { - "internalType": "address", - "name": "_gauges", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "weight", - "type": "int256" - } - ], - "name": "Abstained", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "gauge", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "DistributeReward", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "gauge", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "GaugeCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "GaugeRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "reward", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NotifyReward", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "weight", - "type": "int256" - } - ], - "name": "Voted", - "type": "event" - }, - { - "inputs": [], - "name": "_ve", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "claimable", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "address", - "name": "_operator", - "type": "address" - } - ], - "name": "createGauge", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_gauges", - "type": "address[]" - } - ], - "name": "distribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gauge", - "type": "address" - } - ], - "name": "distribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finish", - "type": "uint256" - } - ], - "name": "distribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "distribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "distro", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gaugefactory", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "gauges", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_pools", - "type": "address[]" - }, - { - "internalType": "address", - "name": "_minter", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isGauge", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isRequested", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "length", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "listing_fee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minter", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "notifyRewardAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "poke", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "poolForGauge", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "poolVote", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "pools", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_pool", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "requestGauge", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "reset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "totalWeight", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "updateAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_gauges", - "type": "address[]" - } - ], - "name": "updateFor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "updateForRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gauge", - "type": "address" - } - ], - "name": "updateGauge", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "usedWeights", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "_poolVote", - "type": "address[]" - }, - { - "internalType": "int256[]", - "name": "_weights", - "type": "int256[]" - } - ], - "name": "vote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "votes", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "weights", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60e06040526001600c553480156200001657600080fd5b50604051620029543803806200295483398101604081905262000039916200014d565b6200004433620000e0565b6001600160a01b038216608081905260408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa1580156200008f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b5919062000185565b6001600160a01b0390811660a0521660c05250600180546001600160a01b03191633179055620001aa565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200014857600080fd5b919050565b600080604083850312156200016157600080fd5b6200016c8362000130565b91506200017c6020840162000130565b90509250929050565b6000602082840312156200019857600080fd5b620001a38262000130565b9392505050565b60805160a05160c0516127186200023c6000396000818161038d0152610e8801526000818161081a0152818161089301528181610af601528181610f58015261128e015260008181610439015281816105aa0152818161065e01528181610e550152818161113c015281816112030152818161139e015281816115cb015281816118a00152611bdb01526127186000f3fe608060405234801561001057600080fd5b50600436106102415760003560e01c8063794cea3c11610145578063aa79979b116100bd578063d23254b41161008c578063e4fc6b6d11610071578063e4fc6b6d1461031f578063f2fde38b1461054f578063fecdad601461056257600080fd5b8063d23254b414610511578063d560b0d71461053c57600080fd5b8063aa79979b146104aa578063ac4afa38146104cd578063b980777a146104e0578063b9a09fd5146104e857600080fd5b80638dd598fb116101145780639b6a9d72116100f95780639b6a9d7214610464578063a7cac84614610477578063a86a366d1461049757600080fd5b80638dd598fb1461043457806396c82e571461045b57600080fd5b8063794cea3c146103dd57806379e93824146103f0578063835be43c146104105780638da5cb5b1461042357600080fd5b806347b3c6ba116101d857806363453ae1116101a75780636ecbe38a1161018c5780636ecbe38a146103af578063715018a6146103c25780637625391a146103ca57600080fd5b806363453ae11461037557806368c3acb31461038857600080fd5b806347b3c6ba1461031f57806353d786931461032757806354d2184b1461032f5780636138889b1461036257600080fd5b806332145f901161021457806332145f90146102c65780633c6b16ab146102d9578063402914f5146102ec578063462d0b2e1461030c57600080fd5b806306d6a1b214610246578063075461721461028c5780631f7b6d321461029f578063310bd74b146102b1575b600080fd5b61026f610254366004611fcb565b6005602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60015461026f906001600160a01b031681565b6003545b604051908152602001610283565b6102c46102bf366004611fef565b610575565b005b6102c46102d4366004611fef565b6106c5565b6102c46102e7366004611fef565b610815565b6102a36102fa366004611fcb565b600f6020526000908152604090205481565b6102c461031a3660046120f7565b6108e7565b6102c461097a565b6102c461098b565b61035261033d366004611fcb565b600b6020526000908152604090205460ff1681565b6040519015158152602001610283565b6102c4610370366004612149565b61099a565b6102c4610383366004611fcb565b6109de565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b6102c46103bd366004611fcb565b610baa565b6102c4610bb6565b6102c46103d8366004612186565b610c39565b61026f6103eb3660046121a8565b610ca4565b6102a36103fe366004611fef565b60096020526000908152604090205481565b6102c461041e3660046121d6565b611107565b6000546001600160a01b031661026f565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b6102a360025481565b6102c4610472366004612186565b6112cf565b6102a3610485366004611fcb565b60066020526000908152604090205481565b61026f6104a5366004612186565b611335565b6103526104b8366004611fcb565b600a6020526000908152604090205460ff1681565b61026f6104db366004611fef565b61136d565b6102a3611397565b61026f6104f6366004611fcb565b6004602052600090815260409020546001600160a01b031681565b6102a361051f366004612202565b600760209081526000928352604080842090915290825290205481565b6102c461054a366004612149565b611443565b6102c461055d366004611fcb565b611483565b6102c4610570366004612273565b611596565b6040517f430c2081000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa1580156105f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061d91906122ed565b61062657600080fd5b61062f816116c1565b6040517fc1f0fb9f000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c1f0fb9f90602401600060405180830381600087803b1580156106aa57600080fd5b505af11580156106be573d6000803e3d6000fd5b5050505050565b60008181526008602090815260408083208054825181850281018501909352808352919290919083018282801561072557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610707575b5050505050905060008151905060008167ffffffffffffffff81111561074d5761074d612008565b604051908082528060200260200182016040528015610776578160200160208202803683370190505b50905060005b82811015610803576007600086815260200190815260200160002060008583815181106107ab576107ab61230f565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020548282815181106107e6576107e661230f565b6020908102919091010152806107fb8161236d565b91505061077c565b5061080f848483611863565b50505050565b6108417f0000000000000000000000000000000000000000000000000000000000000000333084611c72565b60025460009061085983670de0b6b3a76400006123a6565b6108639190612412565b905080156108835780600d600082825461087d9190612426565b90915550505b6040518281526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169033907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf508269060200160405180910390a35050565b6001546001600160a01b031633146108fe57600080fd5b60005b825181101561093e5761092c83828151811061091f5761091f61230f565b6020026020010151611d98565b806109368161236d565b915050610901565b50600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039290921691909117905550565b60035461098990600090610c39565b565b600354610989906000906112cf565b60005b81518110156109da576109c88282815181106109bb576109bb61230f565b60200260200101516109de565b806109d28161236d565b91505061099d565b5050565b600c546001146109ed57600080fd5b6002600c55600154604080517fed29fc1100000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163ed29fc119160048082019260209290919082900301816000875af1158015610a57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7b919061243e565b50610a8581611e29565b6001600160a01b0381166000908152600f602052604081205490610aac62093a8083612412565b1115610ba1576001600160a01b038281166000818152600f602052604080822091909155517fb66503cf0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000009092166004830152602482018390529063b66503cf90604401600060405180830381600087803b158015610b4857600080fd5b505af1158015610b5c573d6000803e3d6000fd5b50506040518381526001600160a01b03851692503391507f4fa9693cae526341d334e2862ca2413b2e503f1266255f9e0869fb36e6d89b179060200160405180910390a35b50506001600c55565b610bb381611e29565b50565b6000546001600160a01b03163314610c2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6109896000611f0c565b815b81811015610c9f57610c8d6004600060038481548110610c5d57610c5d61230f565b60009182526020808320909101546001600160a01b039081168452908301939093526040909101902054166109de565b80610c978161236d565b915050610c3b565b505050565b600080546001600160a01b03163314610d19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c26565b6001600160a01b038381166000908152600460205260409020541615610d9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f65786973747300000000000000000000000000000000000000000000000000006044820152606401610c26565b6001600160a01b0383166000908152600b602052604090205460ff16610e1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f21726571756573746564000000000000000000000000000000000000000000006044820152606401610c26565b6040517f1c48e0fa0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015283811660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631c48e0fa906064016020604051808303816000875af1158015610ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef79190612457565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af1158015610fa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc791906122ed565b506001600160a01b03808516600081815260046020908152604080832080549587167fffffffffffffffffffffffff000000000000000000000000000000000000000096871681179091558352600582528083208054909516909317909355600a909252902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561105f81611e29565b600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03868116918217909255604051858316815290918316907f9b8203efe7fe42185a7755b0510f87c8b693971d6a7c22520aaf683e6b1242619060200160405180910390a39392505050565b8015611285576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa15801561118b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111af9190612457565b6001600160a01b0316336001600160a01b0316146111cc57600080fd5b6111d4611397565b6040517fe7e242d4000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e7e242d490602401602060405180830381865afa158015611252573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611276919061243e565b1161128057600080fd5b6112c6565b6001546112c6907f00000000000000000000000000000000000000000000000000000000000000009033906001600160a01b03166112c1611397565b611c72565b6109da82611d98565b815b81811015610c9f5761132360046000600384815481106112f3576112f361230f565b60009182526020808320909101546001600160a01b03908116845290830193909352604090910190205416611e29565b8061132d8161236d565b9150506112d1565b6008602052816000526040600020818154811061135157600080fd5b6000918252602090912001546001600160a01b03169150829050565b6003818154811061137d57600080fd5b6000918252602090912001546001600160a01b0316905081565b60006117707f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141e919061243e565b611434906b019d971e4fe8401e74000000612474565b61143e9190612412565b905090565b60005b81518110156109da576114718282815181106114645761146461230f565b6020026020010151611e29565b8061147b8161236d565b915050611446565b6000546001600160a01b031633146114f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c26565b6001600160a01b03811661158d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c26565b610bb381611f0c565b6040517f430c2081000000000000000000000000000000000000000000000000000000008152336004820152602481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906122ed565b61164757600080fd5b82811461165357600080fd5b6106be858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201919091525061186392505050565b600081815260086020526040812080549091805b828110156118275760008482815481106116f1576116f161230f565b60009182526020808320909101548883526007825260408084206001600160a01b03909216808552919092529120549091508015611812576001600160a01b0380831660009081526004602052604090205461174d9116611e29565b6001600160a01b0382166000908152600660205260408120805483929061177590849061248b565b909155505060008781526007602090815260408083206001600160a01b0386168452909152812080548392906117ac90849061248b565b909155505060008113156117cb576117c481856124ff565b93506117d8565b6117d5818561248b565b93505b60408051888152602081018390527f6b3894ce60b9bbe9d93f1a4e6fc25b6b93cd8222e73ab6348d79c596f5b51de9910160405180910390a15b5050808061181f9061236d565b9150506116d5565b50806002600082825461183a9190612474565b909155505060008481526009602090815260408083208390556008909152812061080f91611f74565b61186c836116c1565b81516040517fe7e242d4000000000000000000000000000000000000000000000000000000008152600481018590526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e7e242d490602401602060405180830381865afa1580156118ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611913919061243e565b90506000806000805b858110156119a65760008782815181106119385761193861230f565b60200260200101511361196d578681815181106119575761195761230f565b602002602001015161196890612573565b611988565b86818151811061197f5761197f61230f565b60200260200101515b61199290856124ff565b93508061199e8161236d565b91505061191c565b5060005b85811015611ba25760008882815181106119c6576119c661230f565b6020908102919091018101516001600160a01b03808216600090815260048452604080822054909216808252600a909452205490925060ff1615611b8d57600086888b8681518110611a1a57611a1a61230f565b6020026020010151611a2c91906125ac565b611a369190612668565b60008d81526007602090815260408083206001600160a01b038816845290915290205490915015611a6657600080fd5b80611a7057600080fd5b611a7982611e29565b60008c815260086020908152604080832080546001810182559084528284200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091558352600690915281208054839290611ae69084906124ff565b909155505060008c81526007602090815260408083206001600160a01b038716845290915281208054839290611b1d9084906124ff565b90915550506000811215611b3757611b3481612573565b90505b611b4181866124ff565b9450611b4d81876124ff565b604080518e81526020810184905291975033917f1263a2295e53acd6ef8f655b8afc11fa0f2cf11925be7aa1757d741ef32a926c910160405180910390a2505b50508080611b9a9061236d565b9150506119aa565b506000811315611c40576040517ffd4a77f1000000000000000000000000000000000000000000000000000000008152600481018990527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fd4a77f190602401600060405180830381600087803b158015611c2757600080fd5b505af1158015611c3b573d6000803e3d6000fd5b505050505b8160026000828254611c529190612426565b909155505060009788526009602052604090972096909655505050505050565b6000846001600160a01b03163b11611c8957600080fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691611d1b91906126d0565b6000604051808303816000865af19150503d8060008114611d58576040519150601f19603f3d011682016040523d82523d6000602084013e611d5d565b606091505b5091509150818015611d87575080511580611d87575080806020019051810190611d8791906122ed565b611d9057600080fd5b505050505050565b6001600160a01b0381166000908152600b602052604090205460ff1615611dbe57600080fd5b6001600160a01b0381166000818152600b602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555133917ff0327cb46adc649a852254aa18a449aba7285c193557d9dbc9be7fb028d0e00f91a350565b6001600160a01b0380821660009081526005602090815260408083205490931680835260069091529181205490811315611eeb576001600160a01b0383166000908152600e602052604081208054600d549182905591611e898383612474565b90508015611d90576000670de0b6b3a7640000611ea683876123a6565b611eb09190612412565b6001600160a01b0388166000908152600f6020526040812080549293508392909190611edd908490612426565b909155505050505050505050565b600d546001600160a01b0384166000908152600e6020526040902055505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5080546000825590600052602060002090810190610bb391905b80821115611fa25760008155600101611f8e565b5090565b6001600160a01b0381168114610bb357600080fd5b8035611fc681611fa6565b919050565b600060208284031215611fdd57600080fd5b8135611fe881611fa6565b9392505050565b60006020828403121561200157600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261204857600080fd5b8135602067ffffffffffffffff8083111561206557612065612008565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811084821117156120a8576120a8612008565b6040529384528581018301938381019250878511156120c657600080fd5b83870191505b848210156120ec576120dd82611fbb565b835291830191908301906120cc565b979650505050505050565b6000806040838503121561210a57600080fd5b823567ffffffffffffffff81111561212157600080fd5b61212d85828601612037565b925050602083013561213e81611fa6565b809150509250929050565b60006020828403121561215b57600080fd5b813567ffffffffffffffff81111561217257600080fd5b61217e84828501612037565b949350505050565b6000806040838503121561219957600080fd5b50508035926020909101359150565b600080604083850312156121bb57600080fd5b82356121c681611fa6565b9150602083013561213e81611fa6565b600080604083850312156121e957600080fd5b82356121f481611fa6565b946020939093013593505050565b6000806040838503121561221557600080fd5b82359150602083013561213e81611fa6565b60008083601f84011261223957600080fd5b50813567ffffffffffffffff81111561225157600080fd5b6020830191508360208260051b850101111561226c57600080fd5b9250929050565b60008060008060006060868803121561228b57600080fd5b85359450602086013567ffffffffffffffff808211156122aa57600080fd5b6122b689838a01612227565b909650945060408801359150808211156122cf57600080fd5b506122dc88828901612227565b969995985093965092949392505050565b6000602082840312156122ff57600080fd5b81518015158114611fe857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561239f5761239f61233e565b5060010190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123de576123de61233e565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612421576124216123e3565b500490565b600082198211156124395761243961233e565b500190565b60006020828403121561245057600080fd5b5051919050565b60006020828403121561246957600080fd5b8151611fe881611fa6565b6000828210156124865761248661233e565b500390565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156124c5576124c561233e565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156124f9576124f961233e565b50500390565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156125395761253961233e565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561256d5761256d61233e565b50500190565b60007f80000000000000000000000000000000000000000000000000000000000000008214156125a5576125a561233e565b5060000390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156125ed576125ed61233e565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156126285761262861233e565b600087129250878205871284841616156126445761264461233e565b8785058712818416161561265a5761265a61233e565b505050929093029392505050565b600082612677576126776123e3565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156126cb576126cb61233e565b500590565b6000825160005b818110156126f157602081860181015185830152016126d7565b81811115612700576000828501525b50919091019291505056fea164736f6c634300080b000a", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102415760003560e01c8063794cea3c11610145578063aa79979b116100bd578063d23254b41161008c578063e4fc6b6d11610071578063e4fc6b6d1461031f578063f2fde38b1461054f578063fecdad601461056257600080fd5b8063d23254b414610511578063d560b0d71461053c57600080fd5b8063aa79979b146104aa578063ac4afa38146104cd578063b980777a146104e0578063b9a09fd5146104e857600080fd5b80638dd598fb116101145780639b6a9d72116100f95780639b6a9d7214610464578063a7cac84614610477578063a86a366d1461049757600080fd5b80638dd598fb1461043457806396c82e571461045b57600080fd5b8063794cea3c146103dd57806379e93824146103f0578063835be43c146104105780638da5cb5b1461042357600080fd5b806347b3c6ba116101d857806363453ae1116101a75780636ecbe38a1161018c5780636ecbe38a146103af578063715018a6146103c25780637625391a146103ca57600080fd5b806363453ae11461037557806368c3acb31461038857600080fd5b806347b3c6ba1461031f57806353d786931461032757806354d2184b1461032f5780636138889b1461036257600080fd5b806332145f901161021457806332145f90146102c65780633c6b16ab146102d9578063402914f5146102ec578063462d0b2e1461030c57600080fd5b806306d6a1b214610246578063075461721461028c5780631f7b6d321461029f578063310bd74b146102b1575b600080fd5b61026f610254366004611fcb565b6005602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60015461026f906001600160a01b031681565b6003545b604051908152602001610283565b6102c46102bf366004611fef565b610575565b005b6102c46102d4366004611fef565b6106c5565b6102c46102e7366004611fef565b610815565b6102a36102fa366004611fcb565b600f6020526000908152604090205481565b6102c461031a3660046120f7565b6108e7565b6102c461097a565b6102c461098b565b61035261033d366004611fcb565b600b6020526000908152604090205460ff1681565b6040519015158152602001610283565b6102c4610370366004612149565b61099a565b6102c4610383366004611fcb565b6109de565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b6102c46103bd366004611fcb565b610baa565b6102c4610bb6565b6102c46103d8366004612186565b610c39565b61026f6103eb3660046121a8565b610ca4565b6102a36103fe366004611fef565b60096020526000908152604090205481565b6102c461041e3660046121d6565b611107565b6000546001600160a01b031661026f565b61026f7f000000000000000000000000000000000000000000000000000000000000000081565b6102a360025481565b6102c4610472366004612186565b6112cf565b6102a3610485366004611fcb565b60066020526000908152604090205481565b61026f6104a5366004612186565b611335565b6103526104b8366004611fcb565b600a6020526000908152604090205460ff1681565b61026f6104db366004611fef565b61136d565b6102a3611397565b61026f6104f6366004611fcb565b6004602052600090815260409020546001600160a01b031681565b6102a361051f366004612202565b600760209081526000928352604080842090915290825290205481565b6102c461054a366004612149565b611443565b6102c461055d366004611fcb565b611483565b6102c4610570366004612273565b611596565b6040517f430c2081000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa1580156105f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061d91906122ed565b61062657600080fd5b61062f816116c1565b6040517fc1f0fb9f000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c1f0fb9f90602401600060405180830381600087803b1580156106aa57600080fd5b505af11580156106be573d6000803e3d6000fd5b5050505050565b60008181526008602090815260408083208054825181850281018501909352808352919290919083018282801561072557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610707575b5050505050905060008151905060008167ffffffffffffffff81111561074d5761074d612008565b604051908082528060200260200182016040528015610776578160200160208202803683370190505b50905060005b82811015610803576007600086815260200190815260200160002060008583815181106107ab576107ab61230f565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020548282815181106107e6576107e661230f565b6020908102919091010152806107fb8161236d565b91505061077c565b5061080f848483611863565b50505050565b6108417f0000000000000000000000000000000000000000000000000000000000000000333084611c72565b60025460009061085983670de0b6b3a76400006123a6565b6108639190612412565b905080156108835780600d600082825461087d9190612426565b90915550505b6040518281526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169033907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf508269060200160405180910390a35050565b6001546001600160a01b031633146108fe57600080fd5b60005b825181101561093e5761092c83828151811061091f5761091f61230f565b6020026020010151611d98565b806109368161236d565b915050610901565b50600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039290921691909117905550565b60035461098990600090610c39565b565b600354610989906000906112cf565b60005b81518110156109da576109c88282815181106109bb576109bb61230f565b60200260200101516109de565b806109d28161236d565b91505061099d565b5050565b600c546001146109ed57600080fd5b6002600c55600154604080517fed29fc1100000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163ed29fc119160048082019260209290919082900301816000875af1158015610a57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7b919061243e565b50610a8581611e29565b6001600160a01b0381166000908152600f602052604081205490610aac62093a8083612412565b1115610ba1576001600160a01b038281166000818152600f602052604080822091909155517fb66503cf0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000009092166004830152602482018390529063b66503cf90604401600060405180830381600087803b158015610b4857600080fd5b505af1158015610b5c573d6000803e3d6000fd5b50506040518381526001600160a01b03851692503391507f4fa9693cae526341d334e2862ca2413b2e503f1266255f9e0869fb36e6d89b179060200160405180910390a35b50506001600c55565b610bb381611e29565b50565b6000546001600160a01b03163314610c2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6109896000611f0c565b815b81811015610c9f57610c8d6004600060038481548110610c5d57610c5d61230f565b60009182526020808320909101546001600160a01b039081168452908301939093526040909101902054166109de565b80610c978161236d565b915050610c3b565b505050565b600080546001600160a01b03163314610d19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c26565b6001600160a01b038381166000908152600460205260409020541615610d9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f65786973747300000000000000000000000000000000000000000000000000006044820152606401610c26565b6001600160a01b0383166000908152600b602052604090205460ff16610e1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f21726571756573746564000000000000000000000000000000000000000000006044820152606401610c26565b6040517f1c48e0fa0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015283811660448301526000917f000000000000000000000000000000000000000000000000000000000000000090911690631c48e0fa906064016020604051808303816000875af1158015610ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef79190612457565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303816000875af1158015610fa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc791906122ed565b506001600160a01b03808516600081815260046020908152604080832080549587167fffffffffffffffffffffffff000000000000000000000000000000000000000096871681179091558352600582528083208054909516909317909355600a909252902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561105f81611e29565b600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03868116918217909255604051858316815290918316907f9b8203efe7fe42185a7755b0510f87c8b693971d6a7c22520aaf683e6b1242619060200160405180910390a39392505050565b8015611285576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa15801561118b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111af9190612457565b6001600160a01b0316336001600160a01b0316146111cc57600080fd5b6111d4611397565b6040517fe7e242d4000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e7e242d490602401602060405180830381865afa158015611252573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611276919061243e565b1161128057600080fd5b6112c6565b6001546112c6907f00000000000000000000000000000000000000000000000000000000000000009033906001600160a01b03166112c1611397565b611c72565b6109da82611d98565b815b81811015610c9f5761132360046000600384815481106112f3576112f361230f565b60009182526020808320909101546001600160a01b03908116845290830193909352604090910190205416611e29565b8061132d8161236d565b9150506112d1565b6008602052816000526040600020818154811061135157600080fd5b6000918252602090912001546001600160a01b03169150829050565b6003818154811061137d57600080fd5b6000918252602090912001546001600160a01b0316905081565b60006117707f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141e919061243e565b611434906b019d971e4fe8401e74000000612474565b61143e9190612412565b905090565b60005b81518110156109da576114718282815181106114645761146461230f565b6020026020010151611e29565b8061147b8161236d565b915050611446565b6000546001600160a01b031633146114f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c26565b6001600160a01b03811661158d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c26565b610bb381611f0c565b6040517f430c2081000000000000000000000000000000000000000000000000000000008152336004820152602481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063430c208190604401602060405180830381865afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906122ed565b61164757600080fd5b82811461165357600080fd5b6106be858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201919091525061186392505050565b600081815260086020526040812080549091805b828110156118275760008482815481106116f1576116f161230f565b60009182526020808320909101548883526007825260408084206001600160a01b03909216808552919092529120549091508015611812576001600160a01b0380831660009081526004602052604090205461174d9116611e29565b6001600160a01b0382166000908152600660205260408120805483929061177590849061248b565b909155505060008781526007602090815260408083206001600160a01b0386168452909152812080548392906117ac90849061248b565b909155505060008113156117cb576117c481856124ff565b93506117d8565b6117d5818561248b565b93505b60408051888152602081018390527f6b3894ce60b9bbe9d93f1a4e6fc25b6b93cd8222e73ab6348d79c596f5b51de9910160405180910390a15b5050808061181f9061236d565b9150506116d5565b50806002600082825461183a9190612474565b909155505060008481526009602090815260408083208390556008909152812061080f91611f74565b61186c836116c1565b81516040517fe7e242d4000000000000000000000000000000000000000000000000000000008152600481018590526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e7e242d490602401602060405180830381865afa1580156118ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611913919061243e565b90506000806000805b858110156119a65760008782815181106119385761193861230f565b60200260200101511361196d578681815181106119575761195761230f565b602002602001015161196890612573565b611988565b86818151811061197f5761197f61230f565b60200260200101515b61199290856124ff565b93508061199e8161236d565b91505061191c565b5060005b85811015611ba25760008882815181106119c6576119c661230f565b6020908102919091018101516001600160a01b03808216600090815260048452604080822054909216808252600a909452205490925060ff1615611b8d57600086888b8681518110611a1a57611a1a61230f565b6020026020010151611a2c91906125ac565b611a369190612668565b60008d81526007602090815260408083206001600160a01b038816845290915290205490915015611a6657600080fd5b80611a7057600080fd5b611a7982611e29565b60008c815260086020908152604080832080546001810182559084528284200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0388169081179091558352600690915281208054839290611ae69084906124ff565b909155505060008c81526007602090815260408083206001600160a01b038716845290915281208054839290611b1d9084906124ff565b90915550506000811215611b3757611b3481612573565b90505b611b4181866124ff565b9450611b4d81876124ff565b604080518e81526020810184905291975033917f1263a2295e53acd6ef8f655b8afc11fa0f2cf11925be7aa1757d741ef32a926c910160405180910390a2505b50508080611b9a9061236d565b9150506119aa565b506000811315611c40576040517ffd4a77f1000000000000000000000000000000000000000000000000000000008152600481018990527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fd4a77f190602401600060405180830381600087803b158015611c2757600080fd5b505af1158015611c3b573d6000803e3d6000fd5b505050505b8160026000828254611c529190612426565b909155505060009788526009602052604090972096909655505050505050565b6000846001600160a01b03163b11611c8957600080fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691611d1b91906126d0565b6000604051808303816000865af19150503d8060008114611d58576040519150601f19603f3d011682016040523d82523d6000602084013e611d5d565b606091505b5091509150818015611d87575080511580611d87575080806020019051810190611d8791906122ed565b611d9057600080fd5b505050505050565b6001600160a01b0381166000908152600b602052604090205460ff1615611dbe57600080fd5b6001600160a01b0381166000818152600b602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555133917ff0327cb46adc649a852254aa18a449aba7285c193557d9dbc9be7fb028d0e00f91a350565b6001600160a01b0380821660009081526005602090815260408083205490931680835260069091529181205490811315611eeb576001600160a01b0383166000908152600e602052604081208054600d549182905591611e898383612474565b90508015611d90576000670de0b6b3a7640000611ea683876123a6565b611eb09190612412565b6001600160a01b0388166000908152600f6020526040812080549293508392909190611edd908490612426565b909155505050505050505050565b600d546001600160a01b0384166000908152600e6020526040902055505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5080546000825590600052602060002090810190610bb391905b80821115611fa25760008155600101611f8e565b5090565b6001600160a01b0381168114610bb357600080fd5b8035611fc681611fa6565b919050565b600060208284031215611fdd57600080fd5b8135611fe881611fa6565b9392505050565b60006020828403121561200157600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261204857600080fd5b8135602067ffffffffffffffff8083111561206557612065612008565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811084821117156120a8576120a8612008565b6040529384528581018301938381019250878511156120c657600080fd5b83870191505b848210156120ec576120dd82611fbb565b835291830191908301906120cc565b979650505050505050565b6000806040838503121561210a57600080fd5b823567ffffffffffffffff81111561212157600080fd5b61212d85828601612037565b925050602083013561213e81611fa6565b809150509250929050565b60006020828403121561215b57600080fd5b813567ffffffffffffffff81111561217257600080fd5b61217e84828501612037565b949350505050565b6000806040838503121561219957600080fd5b50508035926020909101359150565b600080604083850312156121bb57600080fd5b82356121c681611fa6565b9150602083013561213e81611fa6565b600080604083850312156121e957600080fd5b82356121f481611fa6565b946020939093013593505050565b6000806040838503121561221557600080fd5b82359150602083013561213e81611fa6565b60008083601f84011261223957600080fd5b50813567ffffffffffffffff81111561225157600080fd5b6020830191508360208260051b850101111561226c57600080fd5b9250929050565b60008060008060006060868803121561228b57600080fd5b85359450602086013567ffffffffffffffff808211156122aa57600080fd5b6122b689838a01612227565b909650945060408801359150808211156122cf57600080fd5b506122dc88828901612227565b969995985093965092949392505050565b6000602082840312156122ff57600080fd5b81518015158114611fe857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561239f5761239f61233e565b5060010190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123de576123de61233e565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612421576124216123e3565b500490565b600082198211156124395761243961233e565b500190565b60006020828403121561245057600080fd5b5051919050565b60006020828403121561246957600080fd5b8151611fe881611fa6565b6000828210156124865761248661233e565b500390565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156124c5576124c561233e565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156124f9576124f961233e565b50500390565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156125395761253961233e565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561256d5761256d61233e565b50500190565b60007f80000000000000000000000000000000000000000000000000000000000000008214156125a5576125a561233e565b5060000390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156125ed576125ed61233e565b7f800000000000000000000000000000000000000000000000000000000000000060008712868205881281841616156126285761262861233e565b600087129250878205871284841616156126445761264461233e565b8785058712818416161561265a5761265a61233e565b505050929093029392505050565b600082612677576126776123e3565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156126cb576126cb61233e565b500590565b6000825160005b818110156126f157602081860181015185830152016126d7565b81811115612700576000828501525b50919091019291505056fea164736f6c634300080b000a", - "linkReferences": {}, - "deployedLinkReferences": {} - } diff --git a/packages/boba/gateway/src/deployment/contracts/crosschain/AltL1Bridge.json b/packages/boba/gateway/src/deployment/contracts/crosschain/AltL1Bridge.json deleted file mode 100644 index 2513ad08c2..0000000000 --- a/packages/boba/gateway/src/deployment/contracts/crosschain/AltL1Bridge.json +++ /dev/null @@ -1,755 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "AltL1Bridge", - "sourceName": "contracts/lzTokenBridge/AltL1Bridge.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "_l1Token", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "_l2Token", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "DepositFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "_nonce", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_payload", - "type": "bytes" - } - ], - "name": "MessageFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - } - ], - "name": "SetTrustedRemote", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "_l1Token", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "_l2Token", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "WithdrawalInitiated", - "type": "event" - }, - { - "inputs": [], - "name": "FUNCTION_TYPE_SEND", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "NO_EXTRA_GAS", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dstChainId", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "failedMessages", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - } - ], - "name": "forceResumeReceive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_version", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "_chainId", - "type": "uint16" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_configType", - "type": "uint256" - } - ], - "name": "getConfig", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_lzEndpoint", - "type": "address" - }, - { - "internalType": "uint16", - "name": "_dstChainId", - "type": "uint16" - }, - { - "internalType": "address", - "name": "_ethBridgeAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - } - ], - "name": "isTrustedRemote", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lzEndpoint", - "outputs": [ - { - "internalType": "contract ILayerZeroEndpoint", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "_nonce", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "_payload", - "type": "bytes" - } - ], - "name": "lzReceive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "maxTransferAmountPerDay", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "minDstGasLookup", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "_nonce", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "_payload", - "type": "bytes" - } - ], - "name": "nonblockingLzReceive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "_nonce", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "_payload", - "type": "bytes" - } - ], - "name": "retryMessage", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_version", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "_chainId", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "_configType", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_config", - "type": "bytes" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_maxTransferAmountPerDay", - "type": "uint256" - } - ], - "name": "setMaxTransferAmountPerDay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_dstChainId", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "_type", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_dstGasAmount", - "type": "uint256" - } - ], - "name": "setMinDstGasLookup", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_version", - "type": "uint16" - } - ], - "name": "setReceiveVersion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_version", - "type": "uint16" - } - ], - "name": "setSendVersion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_srcChainId", - "type": "uint16" - }, - { - "internalType": "bytes", - "name": "_srcAddress", - "type": "bytes" - } - ], - "name": "setTrustedRemote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_useCustomAdapterParams", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_dstGasAmount", - "type": "uint256" - } - ], - "name": "setUseCustomAdapterParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "transferTimestampCheckPoint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "name": "trustedRemoteLookup", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "useCustomAdapterParams", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_l2Token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_zroPaymentAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_adapterParams", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_l2Token", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_zroPaymentAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_adapterParams", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "withdrawTo", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b506132b0806100206000396000f3fe6080604052600436106101cc5760003560e01c80637533d788116100f7578063c8ed191011610095578063ed629c5c11610064578063ed629c5c14610578578063ede75eca14610598578063f2fde38b146105ab578063f5ecbdbc146105cb57600080fd5b8063c8ed19101461050f578063cbed8b9c14610525578063d1deba1f14610545578063eb8d72b71461055857600080fd5b8063901eec16116100d1578063901eec16146104975780639b57db5f146104ad578063af3fb21c146104cd578063b353aaa7146104e257600080fd5b80637533d788146103fe5780637e0ced091461042b5780638da5cb5b1461044b57600080fd5b806342d65a8d1161016f57806366ad5c8a1161013e57806366ad5c8a146103965780636fb2be6d146103b6578063708c0db9146103c9578063715018a6146103e957600080fd5b806342d65a8d146102fc578063447705151461031c578063512afd89146103315780635b8c41e61461034757600080fd5b806310ddb137116101ab57806310ddb1371461025e57806330c593f71461027e5780633496a68e146102ac5780633d8b38f6146102cc57600080fd5b80621d3567146101d157806307810867146101f357806307e0db171461023e575b600080fd5b3480156101dd57600080fd5b506101f16101ec3660046128a7565b6105eb565b005b3480156101ff57600080fd5b5061022b61020e36600461292c565b606760209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561024a57600080fd5b506101f1610259366004612956565b6107ae565b34801561026a57600080fd5b506101f1610279366004612956565b610899565b34801561028a57600080fd5b5060cd546102999061ffff1681565b60405161ffff9091168152602001610235565b3480156102b857600080fd5b506101f16102c7366004612971565b61095a565b3480156102d857600080fd5b506102ec6102e73660046129d3565b6109c6565b6040519015158152602001610235565b34801561030857600080fd5b506101f16103173660046129d3565b610a92565b34801561032857600080fd5b5061022b600081565b34801561033d57600080fd5b5061022b60ce5481565b34801561035357600080fd5b5061022b610362366004612a26565b609a602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156103a257600080fd5b506101f16103b13660046128a7565b610b8a565b6101f16103c4366004612aa6565b610c11565b3480156103d557600080fd5b506101f16103e4366004612b3f565b610c29565b3480156103f557600080fd5b506101f1610e0b565b34801561040a57600080fd5b5061041e610419366004612956565b610e7e565b6040516102359190612be0565b34801561043757600080fd5b506101f1610446366004612c01565b610f18565b34801561045757600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610235565b3480156104a357600080fd5b5061022b60d05481565b3480156104b957600080fd5b506101f16104c8366004612c1f565b610fcc565b3480156104d957600080fd5b5061022b600181565b3480156104ee57600080fd5b506065546104729073ffffffffffffffffffffffffffffffffffffffff1681565b34801561051b57600080fd5b5061022b60cf5481565b34801561053157600080fd5b506101f1610540366004612c52565b6110a4565b6101f16105533660046128a7565b6111a2565b34801561056457600080fd5b506101f1610573366004612cc1565b61132c565b34801561058457600080fd5b5060cd546102ec9062010000900460ff1681565b6101f16105a6366004612d0f565b6113f5565b3480156105b757600080fd5b506101f16105c6366004612dbb565b611405565b3480156105d757600080fd5b5061041e6105e6366004612ddf565b611501565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461066d5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff84166000908152606660205260408120805461068b90612e2c565b80601f01602080910402602001604051908101604052809291908181526020018280546106b790612e2c565b80156107045780601f106106d957610100808354040283529160200191610704565b820191906000526020600020905b8154815290600101906020018083116106e757829003601f168201915b5050505050905080518451148015610729575080805190602001208480519060200120145b61079b5760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610664565b6107a7858585856115c9565b5050505050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146108155760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517f07e0db1700000000000000000000000000000000000000000000000000000000815261ffff8316600482015273ffffffffffffffffffffffffffffffffffffffff909116906307e0db17906024015b600060405180830381600087803b15801561088557600080fd5b505af11580156107a7573d6000803e3d6000fd5b60335473ffffffffffffffffffffffffffffffffffffffff1633146109005760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517f10ddb13700000000000000000000000000000000000000000000000000000000815261ffff8316600482015273ffffffffffffffffffffffffffffffffffffffff909116906310ddb1379060240161086b565b60335473ffffffffffffffffffffffffffffffffffffffff1633146109c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b60ce55565b61ffff8316600090815260666020526040812080548291906109e790612e2c565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1390612e2c565b8015610a605780601f10610a3557610100808354040283529160200191610a60565b820191906000526020600020905b815481529060010190602001808311610a4357829003601f168201915b505050505090508383604051610a77929190612e80565b60405180910390208180519060200120149150509392505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610af95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517f42d65a8d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906342d65a8d90610b5390869086908690600401612ebb565b600060405180830381600087803b158015610b6d57600080fd5b505af1158015610b81573d6000803e3d6000fd5b50505050505050565b333014610bff5760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d75737420626560448201527f204c7a41707000000000000000000000000000000000000000000000000000006064820152608401610664565b610c0b848484846116d4565b50505050565b610c21863333888888888861198c565b505050505050565b600054610100900460ff1680610c42575060005460ff16155b610cb45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff16158015610cd6576000805461ffff19166101011790555b73ffffffffffffffffffffffffffffffffffffffff8416610d5f5760405162461bcd60e51b815260206004820152602260248201527f6c7a20656e64706f696e742063616e6e6f74206265207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610664565b610d6884611cfd565b60cd805461ffff191661ffff85161790556040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084901b166020820152610dc590849060340160405160208183030381529060405261132c565b4260d0556969e10de76676d080000060ce558015610c0b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610e725760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b610e7c6000611de5565b565b60666020526000908152604090208054610e9790612e2c565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec390612e2c565b8015610f105780601f10610ee557610100808354040283529160200191610f10565b820191906000526020600020905b815481529060010190602001808311610ef357829003601f168201915b505050505081565b60335473ffffffffffffffffffffffffffffffffffffffff163314610f7f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b60cd805483151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff82168117909255610fc89161ffff908116911617600183610fcc565b5050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146110335760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b600081116110835760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c6964205f647374476173416d6f756e74000000006044820152606401610664565b61ffff90921660009081526067602090815260408083209383529290522055565b60335473ffffffffffffffffffffffffffffffffffffffff16331461110b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517fcbed8b9c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063cbed8b9c906111699088908890889088908890600401612ed9565b600060405180830381600087803b15801561118357600080fd5b505af1158015611197573d6000803e3d6000fd5b505050505050505050565b61ffff84166000908152609a602052604080822090516111c3908690612f12565b908152604080516020928190038301902067ffffffffffffffff86166000908152925290205490508061125e5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201527f61676500000000000000000000000000000000000000000000000000000000006064820152608401610664565b8151602083012081146112d95760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f6160448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610664565b61ffff85166000908152609a602052604080822090516112fa908790612f12565b908152604080516020928190038301902067ffffffffffffffff8716600090815292529020556107a7858585856116d4565b60335473ffffffffffffffffffffffffffffffffffffffff1633146113935760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b61ffff8216600090815260666020908152604090912082516113b792840190612701565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab82826040516113e9929190612f2e565b60405180910390a15050565b610b81873388888888888861198c565b60335473ffffffffffffffffffffffffffffffffffffffff16331461146c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b73ffffffffffffffffffffffffffffffffffffffff81166114f55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610664565b6114fe81611de5565b50565b6065546040517ff5ecbdbc00000000000000000000000000000000000000000000000000000000815261ffff8087166004830152851660248201523060448201526064810183905260609173ffffffffffffffffffffffffffffffffffffffff169063f5ecbdbc9060840160006040518083038186803b15801561158457600080fd5b505afa158015611598573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115c09190810190612f98565b95945050505050565b6040517f66ad5c8a00000000000000000000000000000000000000000000000000000000815230906366ad5c8a9061160b908790879087908790600401612fcd565b600060405180830381600087803b15801561162557600080fd5b505af1925050508015611636575060015b610c0b578080519060200120609a60008661ffff1661ffff1681526020019081526020016000208460405161166b9190612f12565b90815260408051918290036020908101832067ffffffffffffffff87166000908152915220919091557fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d906116c7908690869086908690612fcd565b60405180910390a1610c0b565b60cd5461ffff85811691161461172c5760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420736f7572636520636861696e4964000000000000000000006044820152606401610664565b60008060008060008086806020019051810190611749919061300c565b95509550955095509550955061176685631d1d8b6360e01b611e5c565b801561181c57508473ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156117b557600080fd5b505af11580156117c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ed91906130a0565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b1561192e576040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490528616906340c10f1990604401600060405180830381600087803b15801561189157600080fd5b505af11580156118a5573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89868686604051611921939291906130bd565b60405180910390a4611980565b600086868587868660405160200161194b969594939291906130f2565b60408051601f1981840301815260cd5460208401909252600080845290935061197e9261ffff9092169184913391611e81565b505b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86166119ef5760405162461bcd60e51b815260206004820152601a60248201527f5f746f2063616e6e6f74206265207a65726f20616464726573730000000000006044820152606401610664565b60d0546119ff906201518061314d565b421015611a76578460cf6000828254611a18919061314d565b909155505060ce5460cf541115611a715760405162461bcd60e51b815260206004820152601b60248201527f6d617820616d6f756e74207065722064617920657863656564656400000000006044820152606401610664565b611a80565b60cf8590554260d0555b6040517f9dc29fac0000000000000000000000000000000000000000000000000000000081523360048201526024810186905273ffffffffffffffffffffffffffffffffffffffff891690639dc29fac90604401600060405180830381600087803b158015611aee57600080fd5b505af1158015611b02573d6000803e3d6000fd5b5050505060008873ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611b5057600080fd5b505af1158015611b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8891906130a0565b90506000818a8a8a8a8888604051602001611ba9979695949392919061318c565b60408051808303601f1901815291905260cd5490915062010000900460ff1615611be75760cd54611be29061ffff166001876000612026565b611c5b565b845115611c5b5760405162461bcd60e51b8152602060048201526024808201527f4c7a4170703a205f61646170746572506172616d73206d75737420626520656d60448201527f7074792e000000000000000000000000000000000000000000000000000000006064820152608401610664565b60cd54611c6f9061ffff1682338989611e81565b3373ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e8b8b8989604051611ce994939291906131e9565b60405180910390a450505050505050505050565b600054610100900460ff1680611d16575060005460ff16155b611d885760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff16158015611daa576000805461ffff19166101011790555b611db382612103565b8015610fc857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611e67836121c1565b8015611e785750611e788383612225565b90505b92915050565b61ffff851660009081526066602052604081208054611e9f90612e2c565b80601f0160208091040260200160405190810160405280929190818152602001828054611ecb90612e2c565b8015611f185780601f10611eed57610100808354040283529160200191611f18565b820191906000526020600020905b815481529060010190602001808311611efb57829003601f168201915b50505050509050805160001415611f975760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201527f61207472757374656420736f75726365000000000000000000000000000000006064820152608401610664565b6065546040517fc580310000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063c5803100903490611ff9908a9086908b908b908b908b9060040161321f565b6000604051808303818588803b15801561201257600080fd5b505af115801561197e573d6000803e3d6000fd5b6000612033836022015190565b61ffff861660009081526067602090815260408083208884529091528120549192509061206190849061314d565b9050600081116120b35760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610664565b80821015610c215760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610664565b600054610100900460ff168061211c575060005460ff16155b61218e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff161580156121b0576000805461ffff19166101011790555b6121b8612361565b611db38261244f565b60006121ed827f01ffc9a700000000000000000000000000000000000000000000000000000000612225565b8015611e7b575061221e827fffffffff00000000000000000000000000000000000000000000000000000000612225565b1592915050565b604080517fffffffff00000000000000000000000000000000000000000000000000000000831660248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790529051600091908290819073ffffffffffffffffffffffffffffffffffffffff871690617530906122df908690612f12565b6000604051808303818686fa925050503d806000811461231b576040519150601f19603f3d011682016040523d82523d6000602084013e612320565b606091505b509150915060208151101561233b5760009350505050611e7b565b8180156123575750808060200190518101906123579190613286565b9695505050505050565b600054610100900460ff168061237a575060005460ff16155b6123ec5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff1615801561240e576000805461ffff19166101011790555b61241661256e565b61241e61264b565b80156114fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b600054610100900460ff1680612468575060005460ff16155b6124da5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff161580156124fc576000805461ffff19166101011790555b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790558015610fc857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b600054610100900460ff1680612587575060005460ff16155b6125f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff1615801561241e576000805461ffff191661010117905580156114fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b600054610100900460ff1680612664575060005460ff16155b6126d65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff161580156126f8576000805461ffff19166101011790555b61241e33611de5565b82805461270d90612e2c565b90600052602060002090601f01602090048101928261272f5760008555612775565b82601f1061274857805160ff1916838001178555612775565b82800160010185558215612775579182015b8281111561277557825182559160200191906001019061275a565b50612781929150612785565b5090565b5b808211156127815760008155600101612786565b803561ffff811681146127ac57600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612809576128096127b1565b604052919050565b600067ffffffffffffffff82111561282b5761282b6127b1565b50601f01601f191660200190565b600082601f83011261284a57600080fd5b813561285d61285882612811565b6127e0565b81815284602083860101111561287257600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146127ac57600080fd5b600080600080608085870312156128bd57600080fd5b6128c68561279a565b9350602085013567ffffffffffffffff808211156128e357600080fd5b6128ef88838901612839565b94506128fd6040880161288f565b9350606087013591508082111561291357600080fd5b5061292087828801612839565b91505092959194509250565b6000806040838503121561293f57600080fd5b6129488361279a565b946020939093013593505050565b60006020828403121561296857600080fd5b611e788261279a565b60006020828403121561298357600080fd5b5035919050565b60008083601f84011261299c57600080fd5b50813567ffffffffffffffff8111156129b457600080fd5b6020830191508360208285010111156129cc57600080fd5b9250929050565b6000806000604084860312156129e857600080fd5b6129f18461279a565b9250602084013567ffffffffffffffff811115612a0d57600080fd5b612a198682870161298a565b9497909650939450505050565b600080600060608486031215612a3b57600080fd5b612a448461279a565b9250602084013567ffffffffffffffff811115612a6057600080fd5b612a6c86828701612839565b925050612a7b6040850161288f565b90509250925092565b73ffffffffffffffffffffffffffffffffffffffff811681146114fe57600080fd5b60008060008060008060a08789031215612abf57600080fd5b8635612aca81612a84565b9550602087013594506040870135612ae181612a84565b9350606087013567ffffffffffffffff80821115612afe57600080fd5b612b0a8a838b01612839565b94506080890135915080821115612b2057600080fd5b50612b2d89828a0161298a565b979a9699509497509295939492505050565b600080600060608486031215612b5457600080fd5b8335612b5f81612a84565b9250612b6d6020850161279a565b91506040840135612b7d81612a84565b809150509250925092565b60005b83811015612ba3578181015183820152602001612b8b565b83811115610c0b5750506000910152565b60008151808452612bcc816020860160208601612b88565b601f01601f19169290920160200192915050565b602081526000611e786020830184612bb4565b80151581146114fe57600080fd5b60008060408385031215612c1457600080fd5b823561294881612bf3565b600080600060608486031215612c3457600080fd5b612c3d8461279a565b95602085013595506040909401359392505050565b600080600080600060808688031215612c6a57600080fd5b612c738661279a565b9450612c816020870161279a565b935060408601359250606086013567ffffffffffffffff811115612ca457600080fd5b612cb08882890161298a565b969995985093965092949392505050565b60008060408385031215612cd457600080fd5b612cdd8361279a565b9150602083013567ffffffffffffffff811115612cf957600080fd5b612d0585828601612839565b9150509250929050565b600080600080600080600060c0888a031215612d2a57600080fd5b8735612d3581612a84565b96506020880135612d4581612a84565b9550604088013594506060880135612d5c81612a84565b9350608088013567ffffffffffffffff80821115612d7957600080fd5b612d858b838c01612839565b945060a08a0135915080821115612d9b57600080fd5b50612da88a828b0161298a565b989b979a50959850939692959293505050565b600060208284031215612dcd57600080fd5b8135612dd881612a84565b9392505050565b60008060008060808587031215612df557600080fd5b612dfe8561279a565b9350612e0c6020860161279a565b92506040850135612e1c81612a84565b9396929550929360600135925050565b600181811c90821680612e4057607f821691505b60208210811415612e7a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b61ffff841681526040602082015260006115c0604083018486612e90565b600061ffff808816835280871660208401525084604083015260806060830152612f07608083018486612e90565b979650505050505050565b60008251612f24818460208701612b88565b9190910192915050565b61ffff83168152604060208201526000612f4b6040830184612bb4565b949350505050565b600082601f830112612f6457600080fd5b8151612f7261285882612811565b818152846020838601011115612f8757600080fd5b612f4b826020830160208701612b88565b600060208284031215612faa57600080fd5b815167ffffffffffffffff811115612fc157600080fd5b612f4b84828501612f53565b61ffff85168152608060208201526000612fea6080830186612bb4565b67ffffffffffffffff851660408401528281036060840152612f078185612bb4565b60008060008060008060c0878903121561302557600080fd5b865161303081612a84565b602088015190965061304181612a84565b604088015190955061305281612a84565b606088015190945061306381612a84565b608088015160a0890151919450925067ffffffffffffffff81111561308757600080fd5b61309389828a01612f53565b9150509295509295509295565b6000602082840312156130b257600080fd5b8151612dd881612a84565b73ffffffffffffffffffffffffffffffffffffffff841681528260208201526060604082015260006115c06060830184612bb4565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a083015261314160c0830184612bb4565b98975050505050505050565b60008219821115613187577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a08301526131dc60c083018486612e90565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152606060408201526000612357606083018486612e90565b61ffff8716815260c06020820152600061323c60c0830188612bb4565b828103604084015261324e8188612bb4565b73ffffffffffffffffffffffffffffffffffffffff87811660608601528616608085015283810360a085015290506131dc8185612bb4565b60006020828403121561329857600080fd5b8151612dd881612bf356fea164736f6c6343000809000a", - "deployedBytecode": "0x6080604052600436106101cc5760003560e01c80637533d788116100f7578063c8ed191011610095578063ed629c5c11610064578063ed629c5c14610578578063ede75eca14610598578063f2fde38b146105ab578063f5ecbdbc146105cb57600080fd5b8063c8ed19101461050f578063cbed8b9c14610525578063d1deba1f14610545578063eb8d72b71461055857600080fd5b8063901eec16116100d1578063901eec16146104975780639b57db5f146104ad578063af3fb21c146104cd578063b353aaa7146104e257600080fd5b80637533d788146103fe5780637e0ced091461042b5780638da5cb5b1461044b57600080fd5b806342d65a8d1161016f57806366ad5c8a1161013e57806366ad5c8a146103965780636fb2be6d146103b6578063708c0db9146103c9578063715018a6146103e957600080fd5b806342d65a8d146102fc578063447705151461031c578063512afd89146103315780635b8c41e61461034757600080fd5b806310ddb137116101ab57806310ddb1371461025e57806330c593f71461027e5780633496a68e146102ac5780633d8b38f6146102cc57600080fd5b80621d3567146101d157806307810867146101f357806307e0db171461023e575b600080fd5b3480156101dd57600080fd5b506101f16101ec3660046128a7565b6105eb565b005b3480156101ff57600080fd5b5061022b61020e36600461292c565b606760209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561024a57600080fd5b506101f1610259366004612956565b6107ae565b34801561026a57600080fd5b506101f1610279366004612956565b610899565b34801561028a57600080fd5b5060cd546102999061ffff1681565b60405161ffff9091168152602001610235565b3480156102b857600080fd5b506101f16102c7366004612971565b61095a565b3480156102d857600080fd5b506102ec6102e73660046129d3565b6109c6565b6040519015158152602001610235565b34801561030857600080fd5b506101f16103173660046129d3565b610a92565b34801561032857600080fd5b5061022b600081565b34801561033d57600080fd5b5061022b60ce5481565b34801561035357600080fd5b5061022b610362366004612a26565b609a602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156103a257600080fd5b506101f16103b13660046128a7565b610b8a565b6101f16103c4366004612aa6565b610c11565b3480156103d557600080fd5b506101f16103e4366004612b3f565b610c29565b3480156103f557600080fd5b506101f1610e0b565b34801561040a57600080fd5b5061041e610419366004612956565b610e7e565b6040516102359190612be0565b34801561043757600080fd5b506101f1610446366004612c01565b610f18565b34801561045757600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610235565b3480156104a357600080fd5b5061022b60d05481565b3480156104b957600080fd5b506101f16104c8366004612c1f565b610fcc565b3480156104d957600080fd5b5061022b600181565b3480156104ee57600080fd5b506065546104729073ffffffffffffffffffffffffffffffffffffffff1681565b34801561051b57600080fd5b5061022b60cf5481565b34801561053157600080fd5b506101f1610540366004612c52565b6110a4565b6101f16105533660046128a7565b6111a2565b34801561056457600080fd5b506101f1610573366004612cc1565b61132c565b34801561058457600080fd5b5060cd546102ec9062010000900460ff1681565b6101f16105a6366004612d0f565b6113f5565b3480156105b757600080fd5b506101f16105c6366004612dbb565b611405565b3480156105d757600080fd5b5061041e6105e6366004612ddf565b611501565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461066d5760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff84166000908152606660205260408120805461068b90612e2c565b80601f01602080910402602001604051908101604052809291908181526020018280546106b790612e2c565b80156107045780601f106106d957610100808354040283529160200191610704565b820191906000526020600020905b8154815290600101906020018083116106e757829003601f168201915b5050505050905080518451148015610729575080805190602001208480519060200120145b61079b5760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610664565b6107a7858585856115c9565b5050505050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146108155760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517f07e0db1700000000000000000000000000000000000000000000000000000000815261ffff8316600482015273ffffffffffffffffffffffffffffffffffffffff909116906307e0db17906024015b600060405180830381600087803b15801561088557600080fd5b505af11580156107a7573d6000803e3d6000fd5b60335473ffffffffffffffffffffffffffffffffffffffff1633146109005760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517f10ddb13700000000000000000000000000000000000000000000000000000000815261ffff8316600482015273ffffffffffffffffffffffffffffffffffffffff909116906310ddb1379060240161086b565b60335473ffffffffffffffffffffffffffffffffffffffff1633146109c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b60ce55565b61ffff8316600090815260666020526040812080548291906109e790612e2c565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1390612e2c565b8015610a605780601f10610a3557610100808354040283529160200191610a60565b820191906000526020600020905b815481529060010190602001808311610a4357829003601f168201915b505050505090508383604051610a77929190612e80565b60405180910390208180519060200120149150509392505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610af95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517f42d65a8d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906342d65a8d90610b5390869086908690600401612ebb565b600060405180830381600087803b158015610b6d57600080fd5b505af1158015610b81573d6000803e3d6000fd5b50505050505050565b333014610bff5760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d75737420626560448201527f204c7a41707000000000000000000000000000000000000000000000000000006064820152608401610664565b610c0b848484846116d4565b50505050565b610c21863333888888888861198c565b505050505050565b600054610100900460ff1680610c42575060005460ff16155b610cb45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff16158015610cd6576000805461ffff19166101011790555b73ffffffffffffffffffffffffffffffffffffffff8416610d5f5760405162461bcd60e51b815260206004820152602260248201527f6c7a20656e64706f696e742063616e6e6f74206265207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610664565b610d6884611cfd565b60cd805461ffff191661ffff85161790556040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084901b166020820152610dc590849060340160405160208183030381529060405261132c565b4260d0556969e10de76676d080000060ce558015610c0b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610e725760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b610e7c6000611de5565b565b60666020526000908152604090208054610e9790612e2c565b80601f0160208091040260200160405190810160405280929190818152602001828054610ec390612e2c565b8015610f105780601f10610ee557610100808354040283529160200191610f10565b820191906000526020600020905b815481529060010190602001808311610ef357829003601f168201915b505050505081565b60335473ffffffffffffffffffffffffffffffffffffffff163314610f7f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b60cd805483151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff82168117909255610fc89161ffff908116911617600183610fcc565b5050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146110335760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b600081116110835760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c6964205f647374476173416d6f756e74000000006044820152606401610664565b61ffff90921660009081526067602090815260408083209383529290522055565b60335473ffffffffffffffffffffffffffffffffffffffff16331461110b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b6065546040517fcbed8b9c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063cbed8b9c906111699088908890889088908890600401612ed9565b600060405180830381600087803b15801561118357600080fd5b505af1158015611197573d6000803e3d6000fd5b505050505050505050565b61ffff84166000908152609a602052604080822090516111c3908690612f12565b908152604080516020928190038301902067ffffffffffffffff86166000908152925290205490508061125e5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201527f61676500000000000000000000000000000000000000000000000000000000006064820152608401610664565b8151602083012081146112d95760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f6160448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608401610664565b61ffff85166000908152609a602052604080822090516112fa908790612f12565b908152604080516020928190038301902067ffffffffffffffff8716600090815292529020556107a7858585856116d4565b60335473ffffffffffffffffffffffffffffffffffffffff1633146113935760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b61ffff8216600090815260666020908152604090912082516113b792840190612701565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab82826040516113e9929190612f2e565b60405180910390a15050565b610b81873388888888888861198c565b60335473ffffffffffffffffffffffffffffffffffffffff16331461146c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610664565b73ffffffffffffffffffffffffffffffffffffffff81166114f55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610664565b6114fe81611de5565b50565b6065546040517ff5ecbdbc00000000000000000000000000000000000000000000000000000000815261ffff8087166004830152851660248201523060448201526064810183905260609173ffffffffffffffffffffffffffffffffffffffff169063f5ecbdbc9060840160006040518083038186803b15801561158457600080fd5b505afa158015611598573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115c09190810190612f98565b95945050505050565b6040517f66ad5c8a00000000000000000000000000000000000000000000000000000000815230906366ad5c8a9061160b908790879087908790600401612fcd565b600060405180830381600087803b15801561162557600080fd5b505af1925050508015611636575060015b610c0b578080519060200120609a60008661ffff1661ffff1681526020019081526020016000208460405161166b9190612f12565b90815260408051918290036020908101832067ffffffffffffffff87166000908152915220919091557fe6f254030bcb01ffd20558175c13fcaed6d1520be7becee4c961b65f79243b0d906116c7908690869086908690612fcd565b60405180910390a1610c0b565b60cd5461ffff85811691161461172c5760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420736f7572636520636861696e4964000000000000000000006044820152606401610664565b60008060008060008086806020019051810190611749919061300c565b95509550955095509550955061176685631d1d8b6360e01b611e5c565b801561181c57508473ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156117b557600080fd5b505af11580156117c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ed91906130a0565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b1561192e576040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490528616906340c10f1990604401600060405180830381600087803b15801561189157600080fd5b505af11580156118a5573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd89868686604051611921939291906130bd565b60405180910390a4611980565b600086868587868660405160200161194b969594939291906130f2565b60408051601f1981840301815260cd5460208401909252600080845290935061197e9261ffff9092169184913391611e81565b505b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff86166119ef5760405162461bcd60e51b815260206004820152601a60248201527f5f746f2063616e6e6f74206265207a65726f20616464726573730000000000006044820152606401610664565b60d0546119ff906201518061314d565b421015611a76578460cf6000828254611a18919061314d565b909155505060ce5460cf541115611a715760405162461bcd60e51b815260206004820152601b60248201527f6d617820616d6f756e74207065722064617920657863656564656400000000006044820152606401610664565b611a80565b60cf8590554260d0555b6040517f9dc29fac0000000000000000000000000000000000000000000000000000000081523360048201526024810186905273ffffffffffffffffffffffffffffffffffffffff891690639dc29fac90604401600060405180830381600087803b158015611aee57600080fd5b505af1158015611b02573d6000803e3d6000fd5b5050505060008873ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611b5057600080fd5b505af1158015611b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8891906130a0565b90506000818a8a8a8a8888604051602001611ba9979695949392919061318c565b60408051808303601f1901815291905260cd5490915062010000900460ff1615611be75760cd54611be29061ffff166001876000612026565b611c5b565b845115611c5b5760405162461bcd60e51b8152602060048201526024808201527f4c7a4170703a205f61646170746572506172616d73206d75737420626520656d60448201527f7074792e000000000000000000000000000000000000000000000000000000006064820152608401610664565b60cd54611c6f9061ffff1682338989611e81565b3373ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e8b8b8989604051611ce994939291906131e9565b60405180910390a450505050505050505050565b600054610100900460ff1680611d16575060005460ff16155b611d885760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff16158015611daa576000805461ffff19166101011790555b611db382612103565b8015610fc857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611e67836121c1565b8015611e785750611e788383612225565b90505b92915050565b61ffff851660009081526066602052604081208054611e9f90612e2c565b80601f0160208091040260200160405190810160405280929190818152602001828054611ecb90612e2c565b8015611f185780601f10611eed57610100808354040283529160200191611f18565b820191906000526020600020905b815481529060010190602001808311611efb57829003601f168201915b50505050509050805160001415611f975760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201527f61207472757374656420736f75726365000000000000000000000000000000006064820152608401610664565b6065546040517fc580310000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063c5803100903490611ff9908a9086908b908b908b908b9060040161321f565b6000604051808303818588803b15801561201257600080fd5b505af115801561197e573d6000803e3d6000fd5b6000612033836022015190565b61ffff861660009081526067602090815260408083208884529091528120549192509061206190849061314d565b9050600081116120b35760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f74207365740000000000006044820152606401610664565b80821015610c215760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f7700000000006044820152606401610664565b600054610100900460ff168061211c575060005460ff16155b61218e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff161580156121b0576000805461ffff19166101011790555b6121b8612361565b611db38261244f565b60006121ed827f01ffc9a700000000000000000000000000000000000000000000000000000000612225565b8015611e7b575061221e827fffffffff00000000000000000000000000000000000000000000000000000000612225565b1592915050565b604080517fffffffff00000000000000000000000000000000000000000000000000000000831660248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790529051600091908290819073ffffffffffffffffffffffffffffffffffffffff871690617530906122df908690612f12565b6000604051808303818686fa925050503d806000811461231b576040519150601f19603f3d011682016040523d82523d6000602084013e612320565b606091505b509150915060208151101561233b5760009350505050611e7b565b8180156123575750808060200190518101906123579190613286565b9695505050505050565b600054610100900460ff168061237a575060005460ff16155b6123ec5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff1615801561240e576000805461ffff19166101011790555b61241661256e565b61241e61264b565b80156114fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b600054610100900460ff1680612468575060005460ff16155b6124da5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff161580156124fc576000805461ffff19166101011790555b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790558015610fc857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b600054610100900460ff1680612587575060005460ff16155b6125f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff1615801561241e576000805461ffff191661010117905580156114fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b600054610100900460ff1680612664575060005460ff16155b6126d65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610664565b600054610100900460ff161580156126f8576000805461ffff19166101011790555b61241e33611de5565b82805461270d90612e2c565b90600052602060002090601f01602090048101928261272f5760008555612775565b82601f1061274857805160ff1916838001178555612775565b82800160010185558215612775579182015b8281111561277557825182559160200191906001019061275a565b50612781929150612785565b5090565b5b808211156127815760008155600101612786565b803561ffff811681146127ac57600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612809576128096127b1565b604052919050565b600067ffffffffffffffff82111561282b5761282b6127b1565b50601f01601f191660200190565b600082601f83011261284a57600080fd5b813561285d61285882612811565b6127e0565b81815284602083860101111561287257600080fd5b816020850160208301376000918101602001919091529392505050565b803567ffffffffffffffff811681146127ac57600080fd5b600080600080608085870312156128bd57600080fd5b6128c68561279a565b9350602085013567ffffffffffffffff808211156128e357600080fd5b6128ef88838901612839565b94506128fd6040880161288f565b9350606087013591508082111561291357600080fd5b5061292087828801612839565b91505092959194509250565b6000806040838503121561293f57600080fd5b6129488361279a565b946020939093013593505050565b60006020828403121561296857600080fd5b611e788261279a565b60006020828403121561298357600080fd5b5035919050565b60008083601f84011261299c57600080fd5b50813567ffffffffffffffff8111156129b457600080fd5b6020830191508360208285010111156129cc57600080fd5b9250929050565b6000806000604084860312156129e857600080fd5b6129f18461279a565b9250602084013567ffffffffffffffff811115612a0d57600080fd5b612a198682870161298a565b9497909650939450505050565b600080600060608486031215612a3b57600080fd5b612a448461279a565b9250602084013567ffffffffffffffff811115612a6057600080fd5b612a6c86828701612839565b925050612a7b6040850161288f565b90509250925092565b73ffffffffffffffffffffffffffffffffffffffff811681146114fe57600080fd5b60008060008060008060a08789031215612abf57600080fd5b8635612aca81612a84565b9550602087013594506040870135612ae181612a84565b9350606087013567ffffffffffffffff80821115612afe57600080fd5b612b0a8a838b01612839565b94506080890135915080821115612b2057600080fd5b50612b2d89828a0161298a565b979a9699509497509295939492505050565b600080600060608486031215612b5457600080fd5b8335612b5f81612a84565b9250612b6d6020850161279a565b91506040840135612b7d81612a84565b809150509250925092565b60005b83811015612ba3578181015183820152602001612b8b565b83811115610c0b5750506000910152565b60008151808452612bcc816020860160208601612b88565b601f01601f19169290920160200192915050565b602081526000611e786020830184612bb4565b80151581146114fe57600080fd5b60008060408385031215612c1457600080fd5b823561294881612bf3565b600080600060608486031215612c3457600080fd5b612c3d8461279a565b95602085013595506040909401359392505050565b600080600080600060808688031215612c6a57600080fd5b612c738661279a565b9450612c816020870161279a565b935060408601359250606086013567ffffffffffffffff811115612ca457600080fd5b612cb08882890161298a565b969995985093965092949392505050565b60008060408385031215612cd457600080fd5b612cdd8361279a565b9150602083013567ffffffffffffffff811115612cf957600080fd5b612d0585828601612839565b9150509250929050565b600080600080600080600060c0888a031215612d2a57600080fd5b8735612d3581612a84565b96506020880135612d4581612a84565b9550604088013594506060880135612d5c81612a84565b9350608088013567ffffffffffffffff80821115612d7957600080fd5b612d858b838c01612839565b945060a08a0135915080821115612d9b57600080fd5b50612da88a828b0161298a565b989b979a50959850939692959293505050565b600060208284031215612dcd57600080fd5b8135612dd881612a84565b9392505050565b60008060008060808587031215612df557600080fd5b612dfe8561279a565b9350612e0c6020860161279a565b92506040850135612e1c81612a84565b9396929550929360600135925050565b600181811c90821680612e4057607f821691505b60208210811415612e7a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b61ffff841681526040602082015260006115c0604083018486612e90565b600061ffff808816835280871660208401525084604083015260806060830152612f07608083018486612e90565b979650505050505050565b60008251612f24818460208701612b88565b9190910192915050565b61ffff83168152604060208201526000612f4b6040830184612bb4565b949350505050565b600082601f830112612f6457600080fd5b8151612f7261285882612811565b818152846020838601011115612f8757600080fd5b612f4b826020830160208701612b88565b600060208284031215612faa57600080fd5b815167ffffffffffffffff811115612fc157600080fd5b612f4b84828501612f53565b61ffff85168152608060208201526000612fea6080830186612bb4565b67ffffffffffffffff851660408401528281036060840152612f078185612bb4565b60008060008060008060c0878903121561302557600080fd5b865161303081612a84565b602088015190965061304181612a84565b604088015190955061305281612a84565b606088015190945061306381612a84565b608088015160a0890151919450925067ffffffffffffffff81111561308757600080fd5b61309389828a01612f53565b9150509295509295509295565b6000602082840312156130b257600080fd5b8151612dd881612a84565b73ffffffffffffffffffffffffffffffffffffffff841681528260208201526060604082015260006115c06060830184612bb4565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a083015261314160c0830184612bb4565b98975050505050505050565b60008219821115613187577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500190565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a08301526131dc60c083018486612e90565b9998505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152606060408201526000612357606083018486612e90565b61ffff8716815260c06020820152600061323c60c0830188612bb4565b828103604084015261324e8188612bb4565b73ffffffffffffffffffffffffffffffffffffffff87811660608601528616608085015283810360a085015290506131dc8185612bb4565b60006020828403121561329857600080fd5b8151612dd881612bf356fea164736f6c6343000809000a", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/packages/boba/gateway/src/deployment/contracts/ve.json b/packages/boba/gateway/src/deployment/contracts/ve.json deleted file mode 100644 index 995e543899..0000000000 --- a/packages/boba/gateway/src/deployment/contracts/ve.json +++ /dev/null @@ -1,1145 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "ve", - "sourceName": "contracts/ve.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "token_addr", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "locktime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "enum ve.DepositType", - "name": "deposit_type", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ts", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "prevSupply", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "supply", - "type": "uint256" - } - ], - "name": "Supply", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ts", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "abstain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_approved", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_block", - "type": "uint256" - } - ], - "name": "balanceOfAtNFT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "balanceOfNFT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_t", - "type": "uint256" - } - ], - "name": "balanceOfNFTAt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "block_number", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "checkpoint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_lock_duration", - "type": "uint256" - } - ], - "name": "create_lock", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_lock_duration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - } - ], - "name": "create_lock_for", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "deposit_for", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "epoch", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "get_last_user_slope", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "increase_amount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_lock_duration", - "type": "uint256" - } - ], - "name": "increase_unlock_time", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "isApprovedOrOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "locked", - "outputs": [ - { - "internalType": "int128", - "name": "amount", - "type": "int128" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "locked__end", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_from", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_to", - "type": "uint256" - } - ], - "name": "merge", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "ownership_change", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "point_history", - "outputs": [ - { - "internalType": "int128", - "name": "bias", - "type": "int128" - }, - { - "internalType": "int128", - "name": "slope", - "type": "int128" - }, - { - "internalType": "uint256", - "name": "ts", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blk", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "_approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_voter", - "type": "address" - } - ], - "name": "setVoter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "slope_changes", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "supply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "_interfaceID", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenIndex", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "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": "uint256", - "name": "_block", - "type": "uint256" - } - ], - "name": "totalSupplyAt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "t", - "type": "uint256" - } - ], - "name": "totalSupplyAtT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "user_point_epoch", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "user_point_history", - "outputs": [ - { - "internalType": "int128", - "name": "bias", - "type": "int128" - }, - { - "internalType": "int128", - "name": "slope", - "type": "int128" - }, - { - "internalType": "uint256", - "name": "ts", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blk", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_idx", - "type": "uint256" - } - ], - "name": "user_point_history__ts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_timestamp", - "type": "uint256" - } - ], - "name": "ve_for_at", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "voted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "voter", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "voting", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60a06040526012805460ff191660011790553480156200001e57600080fd5b506040516200479e3803806200479e833981016040819052620000419162000181565b6001600160a01b038116608052600980546001600160a01b03191633179055437f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ee55427f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed5560116020527f3e87c36c65d41f2d1f93bff6c6912ffb5eecfa7a08ec62ba64f325e6f54b62b6805460ff1990811660019081179092557fed0c07505a792b35dc46d92d52f3aa9b2eb49320f7593a35750fca7038c91f428054821683179055635b5e139f60e01b60009081527f7fe31c34b300e6139c230f3de8239aaceec0a6887735a4aa356c95bf048c388880549092169092179055600a54604051909130916000805160206200477e833981519152908290a4600a5460405160009030906000805160206200477e833981519152908390a450620001b3565b6000602082840312156200019457600080fd5b81516001600160a01b0381168114620001ac57600080fd5b9392505050565b6080516145a1620001dd6000396000818161091401528181610d1f0152612e0201526145a16000f3fe608060405234801561001057600080fd5b50600436106103365760003560e01c806371197484116101b2578063c2c4c5c1116100f9578063e441135c116100a2578063ee99fe281161007c578063ee99fe28146108d8578063f8a05763146108eb578063fc0c546a1461090f578063fd4a77f11461093657600080fd5b8063e441135c1461085c578063e7e242d41461087c578063e985e9c51461088f57600080fd5b8063d1febfb9116100d3578063d1febfb9146107eb578063d4e54c3b14610836578063e0514aba1461084957600080fd5b8063c2c4c5c1146107bd578063c87b56dd146107c5578063d1c2babb146107d857600080fd5b8063a183af521161015b578063b45a3c0e11610135578063b45a3c0e1461074f578063b88d4fde14610797578063c1f0fb9f146107aa57600080fd5b8063a183af5214610716578063a22cb46514610729578063a4d855df1461073c57600080fd5b8063900cf0cf1161018c578063900cf0cf146106fa57806395d89b41146103ac578063981b24d01461070357600080fd5b806371197484146106a15780638c2c9baf146106c45780638fbb38ff146106d757600080fd5b8063313ce5671161028157806354fd4d501161022a578063688098891161020457806368809889146106485780636f5488371461065b57806370a082311461067b5780637116c60c1461068e57600080fd5b806354fd4d50146105c35780636352211e146105ff57806365fc38731461063557600080fd5b8063461f711c1161025b578063461f711c1461056a57806346c96aac146105905780634bc2a657146105b057600080fd5b8063313ce5671461052a57806342842e0e14610544578063430c20811461055757600080fd5b806318160ddd116102e357806325a58b56116102bd57806325a58b56146104ce5780632e1a7d4d146104d45780632f745c59146104e757600080fd5b806318160ddd146104a05780631c984bc3146104a857806323b872dd146104bb57600080fd5b8063081812fc11610314578063081812fc146103f5578063095ea7b3146104505780631376f3da1461046557600080fd5b806301ffc9a71461033b578063047fc9aa1461039557806306fdde03146103ac575b600080fd5b6103806103493660046137ed565b7fffffffff000000000000000000000000000000000000000000000000000000001660009081526011602052604090205460ff1690565b60405190151581526020015b60405180910390f35b61039e60005481565b60405190815260200161038c565b6103e86040518060400160405280600681526020017f7665424f4241000000000000000000000000000000000000000000000000000081525081565b60405161038c9190613880565b61042b610403366004613893565b6000908152600c602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161038c565b61046361045e3660046138d5565b610949565b005b6104786104733660046138ff565b610a8b565b60408051600f95860b81529390940b602084015292820152606081019190915260800161038c565b61039e610adf565b61039e6104b63660046138ff565b610aef565b6104636104c9366004613921565b610b22565b4361039e565b6104636104e2366004613893565b610b33565b61039e6104f53660046138d5565b73ffffffffffffffffffffffffffffffffffffffff919091166000908152600e60209081526040808320938352929052205490565b610532601281565b60405160ff909116815260200161038c565b610463610552366004613921565b610e4f565b6103806105653660046138d5565b610e6a565b61057d610578366004613893565b610e7d565b604051600f9190910b815260200161038c565b60095461042b9073ffffffffffffffffffffffffffffffffffffffff1681565b6104636105be36600461395d565b610ecd565b6103e86040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b61042b61060d366004613893565b6000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b61039e6106433660046138ff565b610f38565b61039e6106563660046138ff565b610f7a565b61039e610669366004613893565b60026020526000908152604090205481565b61039e61068936600461395d565b61105a565b61039e61069c366004613893565b611085565b61057d6106af366004613893565b600760205260009081526040902054600f0b81565b61039e6106d23660046138ff565b6110f2565b6103806106e5366004613893565b60086020526000908152604090205460ff1681565b61039e60035481565b61039e610711366004613893565b6110fe565b6104636107243660046138ff565b6112ba565b610463610737366004613986565b611415565b61046361074a3660046138ff565b6114b4565b61077d61075d366004613893565b60016020819052600091825260409091208054910154600f9190910b9082565b60408051600f9390930b835260208301919091520161038c565b6104636107a53660046139ec565b6116b3565b6104636107b8366004613893565b61182f565b61046361186b565b6103e86107d3366004613893565b6118ab565b6104636107e63660046138ff565b611965565b6104786107f9366004613893565b600460205260009081526040902080546001820154600290920154600f82810b93700100000000000000000000000000000000909304900b919084565b61039e610844366004613ae6565b611b09565b61039e6108573660046138ff565b611b4c565b61039e61086a366004613893565b60066020526000908152604090205481565b61039e61088a366004613893565b611b58565b61038061089d366004613b1b565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260106020908152604080832093909416825291909152205460ff1690565b6104636108e63660046138ff565b611b80565b61039e6108f9366004613893565b6000908152600160208190526040909120015490565b61042b7f000000000000000000000000000000000000000000000000000000000000000081565b610463610944366004613893565b611cb0565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff168061097857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109b157600080fd5b6000828152600b602090815260408083205473ffffffffffffffffffffffffffffffffffffffff85811685526010845282852033808752945291909320549216149060ff1681806109ff5750805b610a0857600080fd5b6000848152600c602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff89811691821790925591518793918716917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a45050505050565b600560205281600052604060002081633b9aca008110610aaa57600080fd5b6003020180546001820154600290920154600f82810b955070010000000000000000000000000000000090920490910b925084565b6000610aea42611085565b905090565b600082815260056020526040812082633b9aca008110610b1157610b11613b4e565b600302016001015490505b92915050565b610b2e83838333611cef565b505050565b60125460ff16600114610b4557600080fd5b6012805460ff19166002179055610b5c3382611dda565b610b6857610b68613b7d565b60008181526008602052604090205460ff1615610bcc5760405162461bcd60e51b815260206004820152600860248201527f617474616368656400000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008181526001602081815260409283902083518085019094528054600f0b845290910154908201819052421015610c465760405162461bcd60e51b815260206004820152601660248201527f546865206c6f636b206469646e277420657870697265000000000000000000006044820152606401610bc3565b805160408051808201825260008082526020808301828152878352600191829052938220925183547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9091161783559251919092015554600f9190910b90610cc08282613bdb565b600081905550610cea848460405180604001604052806000600f0b81526020016000815250611e4d565b6040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af1158015610d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da19190613bf2565b610dad57610dad613b7d565b610db6846124fd565b60408051858152602081018490524281830152905133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94919081900360600190a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c81610e248482613bdb565b6040805192835260208301919091520160405180910390a150506012805460ff191660011790555050565b610b2e838383604051806020016040528060008152506116b3565b6000610e768383611dda565b9392505050565b6000818152600660209081526040808320546005909252822081633b9aca008110610eaa57610eaa613b4e565b60030201547001000000000000000000000000000000009004600f0b9392505050565b60095473ffffffffffffffffffffffffffffffffffffffff163314610ef157600080fd5b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60125460009060ff16600114610f4d57600080fd5b6012805460ff19166002179055610f658383336125d6565b90506012805460ff1916600117905592915050565b60008281526006602052604081205481610f9585858461273e565b60008681526005602052604081209192509082633b9aca008110610fbb57610fbb613b4e565b60408051608081018252600392909202929092018054600f81810b8452700100000000000000000000000000000000909104900b6020830152600181015492820183905260020154606082015291506110149086613bdb565b81602001516110239190613c0f565b81518290611032908390613cc5565b600f90810b90915282516000910b1215905061104d57600081525b51600f0b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600d6020526040812054610b1c565b600354600081815260046020908152604080832081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608201529091906110ea818561282d565b949350505050565b6000610e768383612938565b60004382111561111057611110613b7d565b600354600061111f8483612c40565b600081815260046020908152604080832081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608201529192508383101561124857600060048161118f866001613d36565b8152602080820192909252604090810160002081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608083018290528501519192501461124257826060015181606001516112089190613bdb565b8360400151826040015161121c9190613bdb565b606085015161122b908a613bdb565b6112359190613d4e565b61123f9190613dba565b91505b50611297565b438260600151146112975760608201516112629043613bdb565b60408301516112719042613bdb565b60608401516112809089613bdb565b61128a9190613d4e565b6112949190613dba565b90505b6112b0828284604001516112ab9190613d36565b61282d565b9695505050505050565b60125460ff166001146112cc57600080fd5b6012805460ff191660021790556112e33383611dda565b6112ef576112ef613b7d565b60008281526001602081815260409283902083518085019094528054600f0b845290910154908201528161132557611325613b7d565b60008160000151600f0b1361137c5760405162461bcd60e51b815260206004820152601660248201527f4e6f206578697374696e67206c6f636b20666f756e64000000000000000000006044820152606401610bc3565b428160200151116113f45760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f742061646420746f2065787069726564206c6f636b2e205769746860448201527f64726177000000000000000000000000000000000000000000000000000000006064820152608401610bc3565b61140383836000846002612cca565b50506012805460ff1916600117905550565b73ffffffffffffffffffffffffffffffffffffffff821633141561143b5761143b613b7d565b33600081815260106020908152604080832073ffffffffffffffffffffffffffffffffffffffff871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60125460ff166001146114c657600080fd5b6012805460ff191660021790556114dd3383611dda565b6114e9576114e9613b7d565b600082815260016020818152604080842081518083019092528054600f0b825290920154908201529062093a80806115218542613d36565b61152b9190613dba565b6115359190613d4e565b90504282602001511161158a5760405162461bcd60e51b815260206004820152600c60248201527f4c6f636b206578706972656400000000000000000000000000000000000000006044820152606401610bc3565b60008260000151600f0b136115e15760405162461bcd60e51b815260206004820152601160248201527f4e6f7468696e67206973206c6f636b65640000000000000000000000000000006044820152606401610bc3565b816020015181116116345760405162461bcd60e51b815260206004820152601f60248201527f43616e206f6e6c7920696e637265617365206c6f636b206475726174696f6e006044820152606401610bc3565b611642630784ce0042613d36565b8111156116915760405162461bcd60e51b815260206004820152601e60248201527f566f74696e67206c6f636b2063616e2062652034207965617273206d617800006044820152606401610bc3565b6116a084600083856003612cca565b50506012805460ff191660011790555050565b6116bf84848433611cef565b823b15611829576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84169063150b7a029061171e903390889087908790600401613dce565b6020604051808303816000875af1925050508015611777575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261177491810190613e0d565b60015b611827573d8080156117a5576040519150601f19603f3d011682016040523d82523d6000602084013e6117aa565b606091505b50805161181f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610bc3565b805181602001fd5b505b50505050565b60095473ffffffffffffffffffffffffffffffffffffffff16331461185357600080fd5b6000908152600860205260409020805460ff19169055565b6118a9600060405180604001604052806000600f0b8152602001600081525060405180604001604052806000600f0b81526020016000815250611e4d565b565b6000818152600b602052604090205460609073ffffffffffffffffffffffffffffffffffffffff1661191f5760405162461bcd60e51b815260206004820152601b60248201527f517565727920666f72206e6f6e6578697374656e7420746f6b656e00000000006044820152606401610bc3565b60008281526001602081815260409283902083518085019094528054600f0b84529091015490820152610e76836119568142612f23565b60208401518451600f0b613002565b60008281526008602052604090205460ff16156119c45760405162461bcd60e51b815260206004820152600860248201527f61747461636865640000000000000000000000000000000000000000000000006044820152606401610bc3565b808214156119d157600080fd5b6119db3383611dda565b6119e457600080fd5b6119ee3382611dda565b6119f757600080fd5b6000828152600160208181526040808420815180830183528154600f90810b82529185015481850190815287875285855283872084518086019095528054840b855290950154938301849052805194519095929490910b921115611a5f578260200151611a65565b83602001515b604080518082018252600080825260208083018281528b83526001808352858420945185547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9091161785559051930192909255825180840190935280835290820152909150611aea9087908690611e4d565b611af3866124fd565b611b01858383866004612cca565b505050505050565b60125460009060ff16600114611b1e57600080fd5b6012805460ff19166002179055611b368484846125d6565b90506012805460ff191660011790559392505050565b6000610e768383612f23565b600081815260026020526040812054431415611b7657506000919050565b610b1c8242612f23565b60125460ff16600114611b9257600080fd5b6012805460ff1916600217905560008281526001602081815260409283902083518085019094528054600f0b8452909101549082015281611bd257600080fd5b60008160000151600f0b13611c295760405162461bcd60e51b815260206004820152601660248201527f4e6f206578697374696e67206c6f636b20666f756e64000000000000000000006044820152606401610bc3565b42816020015111611ca15760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f742061646420746f2065787069726564206c6f636b2e205769746860448201527f64726177000000000000000000000000000000000000000000000000000000006064820152608401610bc3565b61140383836000846000612cca565b60095473ffffffffffffffffffffffffffffffffffffffff163314611cd457600080fd5b6000908152600860205260409020805460ff19166001179055565b60008281526008602052604090205460ff1615611d4e5760405162461bcd60e51b815260206004820152600860248201527f61747461636865640000000000000000000000000000000000000000000000006044820152606401610bc3565b611d588183611dda565b611d6157600080fd5b611d6b8483613139565b611d7584836131d2565b611d7f8383613285565b60008281526002602052604080822043905551839173ffffffffffffffffffffffffffffffffffffffff80871692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450505050565b6000818152600b6020908152604080832054600c83528184205473ffffffffffffffffffffffffffffffffffffffff9182168086526010855283862088841680885295529285205492938085149392909116149060ff168280611e3a5750815b80611e425750805b979650505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260035460009081908715611fb957428760200151118015611ebd575060008760000151600f0b135b15611f02578651611ed390630784ce0090613e2a565b600f0b602080870191909152870151611eed904290613bdb565b8560200151611efc9190613c0f565b600f0b85525b428660200151118015611f1c575060008660000151600f0b135b15611f61578551611f3290630784ce0090613e2a565b600f0b602080860191909152860151611f4c904290613bdb565b8460200151611f5b9190613c0f565b600f0b84525b602080880151600090815260078252604090205490870151600f9190910b935015611fb957866020015186602001511415611f9e57829150611fb9565b602080870151600090815260079091526040902054600f0b91505b60408051608081018252600080825260208201524291810191909152436060820152811561203b575060008181526004602090815260409182902082516080810184528154600f81810b8352700100000000000000000000000000000000909104900b9281019290925260018101549282019290925260029091015460608201525b60408101518160004283101561208857604084015161205a9042613bdb565b60608501516120699043613bdb565b61207b90670de0b6b3a7640000613d4e565b6120859190613dba565b90505b600062093a806120988186613dba565b6120a29190613d4e565b905060005b60ff811015612233576120bd62093a8083613d36565b91506000428311156120d1574292506120e5565b50600082815260076020526040902054600f0b5b6120ef8684613bdb565b87602001516120fe9190613c0f565b8751889061210d908390613cc5565b600f0b905250602087018051829190612127908390613e9e565b600f90810b90915288516000910b1215905061214257600087525b60008760200151600f0b121561215a57600060208801525b60408088018490528501519295508592670de0b6b3a76400009061217e9085613bdb565b6121889086613d4e565b6121929190613dba565b85606001516121a19190613d36565b60608801526121b1600189613d36565b9750428314156121c75750436060870152612233565b6000888152600460209081526040918290208951918a01516fffffffffffffffffffffffffffffffff90811670010000000000000000000000000000000002921691909117815590880151600182015560608801516002909101555061222c81613f0e565b90506120a7565b505060038590558b156122be57886020015188602001516122549190613cc5565b846020018181516122659190613e9e565b600f0b905250885188516122799190613cc5565b84518590612288908390613e9e565b600f90810b90915260208601516000910b121590506122a957600060208501525b60008460000151600f0b12156122be57600084525b6000858152600460209081526040918290208651918701516fffffffffffffffffffffffffffffffff90811670010000000000000000000000000000000002921691909117815590850151600182015560608501516002909101558b156124ef57428b6020015111156123ad57602089015161233a9088613e9e565b96508a602001518a60200151141561235e57602088015161235b9088613cc5565b96505b60208b810151600090815260079091526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff89161790555b428a602001511115612429578a602001518a6020015111156124295760208801516123d89087613cc5565b60208b810151600090815260079091526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff831617905595505b60008c815260066020526040812054612443906001613d36565b905080600660008f815260200190815260200160002081905550428960400181815250504389606001818152505088600560008f815260200190815260200160002082633b9aca00811061249957612499613b4e565b825160208401516fffffffffffffffffffffffffffffffff908116700100000000000000000000000000000000029116176003919091029190910190815560408201516001820155606090910151600290910155505b505050505050505050505050565b6125073382611dda565b6125535760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f74206f776e6572206e6f7220617070726f7665646044820152606401610bc3565b6000818152600b602052604081205473ffffffffffffffffffffffffffffffffffffffff16906125839083610949565b61258d33836131d2565b604051829060009073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008062093a80806125e88642613d36565b6125f29190613dba565b6125fc9190613d4e565b90506000851161260b57600080fd5b4281116126805760405162461bcd60e51b815260206004820152602660248201527f43616e206f6e6c79206c6f636b20756e74696c2074696d6520696e207468652060448201527f66757475726500000000000000000000000000000000000000000000000000006064820152608401610bc3565b61268e630784ce0042613d36565b8111156126dd5760405162461bcd60e51b815260206004820152601e60248201527f566f74696e67206c6f636b2063616e2062652034207965617273206d617800006044820152606401610bc3565b600a600081546126ec90613f0e565b90915550600a546126fd848261334d565b5060008181526001602081815260409283902083518085019094528054600f0b84528201549083015261273591839189918691612cca565b95945050505050565b60008082815b60808110156128225781831061275957612822565b600060026127678486613d36565b612772906002613d36565b61277c9190613dba565b60008981526005602052604081209192509082633b9aca0081106127a2576127a2613b4e565b60408051608081018252600392909202929092018054600f81810b8452700100000000000000000000000000000000909104900b60208301526001810154928201839052600201546060820152915088106127ff5781945061280d565b61280a600183613bdb565b93505b5050808061281a90613f0e565b915050612744565b509095945050505050565b600080839050600062093a808083604001516128499190613dba565b6128539190613d4e565b905060005b60ff8110156129075761286e62093a8083613d36565b915060008583111561288257859250612896565b50600082815260076020526040902054600f0b5b60408401516128a59084613bdb565b84602001516128b49190613c0f565b845185906128c3908390613cc5565b600f0b905250828614156128d75750612907565b80846020018181516128e99190613e9e565b600f0b905250506040830182905261290081613f0e565b9050612858565b5060008260000151600f0b121561291d57600082525b50516fffffffffffffffffffffffffffffffff169392505050565b60004382111561294a5761294a613b7d565b600083815260066020526040812054815b60808110156129ee57818310612970576129ee565b6000600261297e8486613d36565b612989906001613d36565b6129939190613dba565b6000888152600560205260409020909150869082633b9aca0081106129ba576129ba613b4e565b6003020160020154116129cf578093506129dd565b6129da600182613bdb565b92505b506129e781613f0e565b905061295b565b50600085815260056020526040812083633b9aca008110612a1157612a11613b4e565b604080516080810182526003928302939093018054600f81810b8652700100000000000000000000000000000000909104900b6020850152600181015491840191909152600201546060830152549091506000612a6e8783612c40565b600081815260046020908152604080832081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608201529192508084841015612b67576000600481612adf876001613d36565b8152602080820192909252604090810160002081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b93810193909352600181015491830191909152600201546060808301829052860151919250612b499190613bdb565b925083604001518160400151612b5f9190613bdb565b915050612b8b565b6060830151612b769043613bdb565b9150826040015142612b889190613bdb565b90505b60408301518215612bc8578284606001518c612ba79190613bdb565b612bb19084613d4e565b612bbb9190613dba565b612bc59082613d36565b90505b6040870151612bd79082613bdb565b8760200151612be69190613c0f565b87518890612bf5908390613cc5565b600f90810b90915288516000910b129050612c2e57505093516fffffffffffffffffffffffffffffffff169650610b1c95505050505050565b60009950505050505050505050610b1c565b60008082815b6080811015612cc057818310612c5b57612cc0565b60006002612c698486613d36565b612c74906001613d36565b612c7e9190613dba565b6000818152600460205260409020600201549091508710612ca157809350612caf565b612cac600182613bdb565b92505b50612cb981613f0e565b9050612c46565b5090949350505050565b6000548290612cd98682613d36565b6000908155604080518082019091528181526020810191909152825160208085015190830152600f0b8152825187908490612d15908390613e9e565b600f0b9052508515612d2957602083018690525b6000888152600160208181526040909220855181547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff90911617815591850151910155612d89888285611e4d565b338715801590612dab57506004856004811115612da857612da8613f47565b14155b15612e7b576040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152306024830152604482018a90527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015612e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e6f9190613bf2565b612e7b57612e7b613b7d565b83602001518173ffffffffffffffffffffffffffffffffffffffff167fff04ccafc360e16b67d682d17bd9503c4c6b9a131f6be6325762dc9ffc7de6248b8b8942604051612ecc9493929190613f76565b60405180910390a37f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c83612f008a82613d36565b6040805192835260208301919091520160405180910390a1505050505050505050565b60008281526006602052604081205480612f41576000915050610b1c565b600084815260056020526040812082633b9aca008110612f6357612f63613b4e565b60408051608081018252600392909202929092018054600f81810b8452700100000000000000000000000000000000909104900b602083015260018101549282018390526002015460608201529150612fbc9085613fcd565b8160200151612fcb9190613c0f565b81518290612fda908390613cc5565b600f90810b90915282516000910b12159050612ff557600081525b51600f0b9150610b1c9050565b606060405180610120016040528060fd815260200161445860fd913990508061302a866133ca565b60405160200161303b929190614041565b604051602081830303815290604052905080613056856133ca565b6040516020016130679291906140e9565b604051602081830303815290604052905080613082846133ca565b604051602001613093929190614191565b6040516020818303038152906040529050806130ae836133ca565b6040516020016130bf929190614239565b6040516020818303038152906040529050600061310c6130de876133ca565b6130e7846134fc565b6040516020016130f89291906142bb565b6040516020818303038152906040526134fc565b90508060405160200161311f91906143fe565b604051602081830303815290604052915050949350505050565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff83811691161461316f5761316f613b7d565b6000818152600c602052604090205473ffffffffffffffffffffffffffffffffffffffff16156131ce576000818152600c6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b5050565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff83811691161461320857613208613b7d565b6000818152600b6020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561324682826136d5565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d6020526040812080546001929061327c908490613bdb565b90915550505050565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff16156132b7576132b7613b7d565b6000818152600b6020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716908117909155808452600d8084528285208054600e86528487208188528652848720889055878752600f86529386209390935590845290915280546001929061327c908490613d36565b600073ffffffffffffffffffffffffffffffffffffffff831661337257613372613b7d565b61337c8383613285565b604051829073ffffffffffffffffffffffffffffffffffffffff8516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a450600192915050565b60608161340a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613434578061341e81613f0e565b915061342d9050600a83613dba565b915061340e565b60008167ffffffffffffffff81111561344f5761344f6139bd565b6040519080825280601f01601f191660200182016040528015613479576020820181803683370190505b5090505b84156110ea5761348e600183613bdb565b915061349b600a86614443565b6134a6906030613d36565b60f81b8183815181106134bb576134bb613b4e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506134f5600a86613dba565b945061347d565b80516060908061351c575050604080516020810190915260008152919050565b6000600361352b836002613d36565b6135359190613dba565b613540906004613d4e565b9050600061354f826020613d36565b67ffffffffffffffff811115613567576135676139bd565b6040519080825280601f01601f191660200182016040528015613591576020820181803683370190505b5090506000604051806060016040528060408152602001614555604091399050600181016020830160005b8681101561361d576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016135bc565b5060038606600181146136375760028114613681576136c7565b7f3d3d0000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8301526136c7565b7f3d000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8301525b505050918152949350505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d602052604081205461370790600190613bdb565b6000838152600f6020526040902054909150808214156137645773ffffffffffffffffffffffffffffffffffffffff84166000908152600e602090815260408083208584528252808320839055858352600f909152812055611829565b73ffffffffffffffffffffffffffffffffffffffff939093166000908152600e6020908152604080832093835292815282822080548684528484208190558352600f9091528282209490945592839055908252812055565b7fffffffff00000000000000000000000000000000000000000000000000000000811681146137ea57600080fd5b50565b6000602082840312156137ff57600080fd5b8135610e76816137bc565b60005b8381101561382557818101518382015260200161380d565b838111156118295750506000910152565b6000815180845261384e81602086016020860161380a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610e766020830184613836565b6000602082840312156138a557600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146138d057600080fd5b919050565b600080604083850312156138e857600080fd5b6138f1836138ac565b946020939093013593505050565b6000806040838503121561391257600080fd5b50508035926020909101359150565b60008060006060848603121561393657600080fd5b61393f846138ac565b925061394d602085016138ac565b9150604084013590509250925092565b60006020828403121561396f57600080fd5b610e76826138ac565b80151581146137ea57600080fd5b6000806040838503121561399957600080fd5b6139a2836138ac565b915060208301356139b281613978565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060008060808587031215613a0257600080fd5b613a0b856138ac565b9350613a19602086016138ac565b925060408501359150606085013567ffffffffffffffff80821115613a3d57600080fd5b818701915087601f830112613a5157600080fd5b813581811115613a6357613a636139bd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715613aa957613aa96139bd565b816040528281528a6020848701011115613ac257600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080600060608486031215613afb57600080fd5b8335925060208401359150613b12604085016138ac565b90509250925092565b60008060408385031215613b2e57600080fd5b613b37836138ac565b9150613b45602084016138ac565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613bed57613bed613bac565b500390565b600060208284031215613c0457600080fd5b8151610e7681613978565b600081600f0b83600f0b6f7fffffffffffffffffffffffffffffff600082136000841383830485118282161615613c4857613c48613bac565b7fffffffffffffffffffffffffffffffff800000000000000000000000000000006000851286820586128184161615613c8357613c83613bac565b60008712925085820587128484161615613c9f57613c9f613bac565b85850587128184161615613cb557613cb5613bac565b5050509290910295945050505050565b600081600f0b83600f0b60008112817fffffffffffffffffffffffffffffffff8000000000000000000000000000000001831281151615613d0857613d08613bac565b816f7fffffffffffffffffffffffffffffff018313811615613d2c57613d2c613bac565b5090039392505050565b60008219821115613d4957613d49613bac565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613d8657613d86613bac565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613dc957613dc9613d8b565b500490565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526112b06080830184613836565b600060208284031215613e1f57600080fd5b8151610e76816137bc565b600081600f0b83600f0b80613e4157613e41613d8b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81147fffffffffffffffffffffffffffffffff8000000000000000000000000000000083141615613e9557613e95613bac565b90059392505050565b600081600f0b83600f0b60008212826f7fffffffffffffffffffffffffffffff03821381151615613ed157613ed1613bac565b827fffffffffffffffffffffffffffffffff80000000000000000000000000000000038212811615613f0557613f05613bac565b50019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613f4057613f40613bac565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b848152602081018490526080810160058410613fbb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60408201939093526060015292915050565b6000808312837f80000000000000000000000000000000000000000000000000000000000000000183128115161561400757614007613bac565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831381161561403b5761403b613bac565b50500390565b6000835161405381846020880161380a565b7f746f6b656e200000000000000000000000000000000000000000000000000000908301908152835161408d81600684016020880161380a565b7f3c2f746578743e3c7465787420783d2231302220793d2234302220636c617373600692909101918201527f3d2262617365223e0000000000000000000000000000000000000000000000006026820152602e01949350505050565b600083516140fb81846020880161380a565b7f62616c616e63654f662000000000000000000000000000000000000000000000908301908152835161413581600a84016020880161380a565b7f3c2f746578743e3c7465787420783d2231302220793d2236302220636c617373600a92909101918201527f3d2262617365223e000000000000000000000000000000000000000000000000602a820152603201949350505050565b600083516141a381846020880161380a565b7f6c6f636b65645f656e642000000000000000000000000000000000000000000090830190815283516141dd81600b84016020880161380a565b7f3c2f746578743e3c7465787420783d2231302220793d2238302220636c617373600b92909101918201527f3d2262617365223e000000000000000000000000000000000000000000000000602b820152603301949350505050565b6000835161424b81846020880161380a565b7f76616c7565200000000000000000000000000000000000000000000000000000908301908152835161428581600684016020880161380a565b7f3c2f746578743e3c2f7376673e0000000000000000000000000000000000000060069290910191820152601301949350505050565b7f7b226e616d65223a20226c6f636b2023000000000000000000000000000000008152600083516142f381601085016020880161380a565b7f222c20226465736372697074696f6e223a2022536f6c69646c79206c6f636b736010918401918201527f2c2063616e206265207573656420746f20626f6f73742067617567652079696560308201527f6c64732c20766f7465206f6e20746f6b656e20656d697373696f6e2c20616e6460508201527f207265636569766520627269626573222c2022696d616765223a20226461746160708201527f3a696d6167652f7376672b786d6c3b6261736536342c00000000000000000000609082015283516143c88160a684016020880161380a565b7f227d00000000000000000000000000000000000000000000000000000000000060a6929091019182015260a801949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161443681601d85016020870161380a565b91909101601d0192915050565b60008261445257614452613d8b565b50069056fe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e3c7465787420783d2231302220793d2232302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa164736f6c634300080b000addf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106103365760003560e01c806371197484116101b2578063c2c4c5c1116100f9578063e441135c116100a2578063ee99fe281161007c578063ee99fe28146108d8578063f8a05763146108eb578063fc0c546a1461090f578063fd4a77f11461093657600080fd5b8063e441135c1461085c578063e7e242d41461087c578063e985e9c51461088f57600080fd5b8063d1febfb9116100d3578063d1febfb9146107eb578063d4e54c3b14610836578063e0514aba1461084957600080fd5b8063c2c4c5c1146107bd578063c87b56dd146107c5578063d1c2babb146107d857600080fd5b8063a183af521161015b578063b45a3c0e11610135578063b45a3c0e1461074f578063b88d4fde14610797578063c1f0fb9f146107aa57600080fd5b8063a183af5214610716578063a22cb46514610729578063a4d855df1461073c57600080fd5b8063900cf0cf1161018c578063900cf0cf146106fa57806395d89b41146103ac578063981b24d01461070357600080fd5b806371197484146106a15780638c2c9baf146106c45780638fbb38ff146106d757600080fd5b8063313ce5671161028157806354fd4d501161022a578063688098891161020457806368809889146106485780636f5488371461065b57806370a082311461067b5780637116c60c1461068e57600080fd5b806354fd4d50146105c35780636352211e146105ff57806365fc38731461063557600080fd5b8063461f711c1161025b578063461f711c1461056a57806346c96aac146105905780634bc2a657146105b057600080fd5b8063313ce5671461052a57806342842e0e14610544578063430c20811461055757600080fd5b806318160ddd116102e357806325a58b56116102bd57806325a58b56146104ce5780632e1a7d4d146104d45780632f745c59146104e757600080fd5b806318160ddd146104a05780631c984bc3146104a857806323b872dd146104bb57600080fd5b8063081812fc11610314578063081812fc146103f5578063095ea7b3146104505780631376f3da1461046557600080fd5b806301ffc9a71461033b578063047fc9aa1461039557806306fdde03146103ac575b600080fd5b6103806103493660046137ed565b7fffffffff000000000000000000000000000000000000000000000000000000001660009081526011602052604090205460ff1690565b60405190151581526020015b60405180910390f35b61039e60005481565b60405190815260200161038c565b6103e86040518060400160405280600681526020017f7665424f4241000000000000000000000000000000000000000000000000000081525081565b60405161038c9190613880565b61042b610403366004613893565b6000908152600c602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161038c565b61046361045e3660046138d5565b610949565b005b6104786104733660046138ff565b610a8b565b60408051600f95860b81529390940b602084015292820152606081019190915260800161038c565b61039e610adf565b61039e6104b63660046138ff565b610aef565b6104636104c9366004613921565b610b22565b4361039e565b6104636104e2366004613893565b610b33565b61039e6104f53660046138d5565b73ffffffffffffffffffffffffffffffffffffffff919091166000908152600e60209081526040808320938352929052205490565b610532601281565b60405160ff909116815260200161038c565b610463610552366004613921565b610e4f565b6103806105653660046138d5565b610e6a565b61057d610578366004613893565b610e7d565b604051600f9190910b815260200161038c565b60095461042b9073ffffffffffffffffffffffffffffffffffffffff1681565b6104636105be36600461395d565b610ecd565b6103e86040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b61042b61060d366004613893565b6000908152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b61039e6106433660046138ff565b610f38565b61039e6106563660046138ff565b610f7a565b61039e610669366004613893565b60026020526000908152604090205481565b61039e61068936600461395d565b61105a565b61039e61069c366004613893565b611085565b61057d6106af366004613893565b600760205260009081526040902054600f0b81565b61039e6106d23660046138ff565b6110f2565b6103806106e5366004613893565b60086020526000908152604090205460ff1681565b61039e60035481565b61039e610711366004613893565b6110fe565b6104636107243660046138ff565b6112ba565b610463610737366004613986565b611415565b61046361074a3660046138ff565b6114b4565b61077d61075d366004613893565b60016020819052600091825260409091208054910154600f9190910b9082565b60408051600f9390930b835260208301919091520161038c565b6104636107a53660046139ec565b6116b3565b6104636107b8366004613893565b61182f565b61046361186b565b6103e86107d3366004613893565b6118ab565b6104636107e63660046138ff565b611965565b6104786107f9366004613893565b600460205260009081526040902080546001820154600290920154600f82810b93700100000000000000000000000000000000909304900b919084565b61039e610844366004613ae6565b611b09565b61039e6108573660046138ff565b611b4c565b61039e61086a366004613893565b60066020526000908152604090205481565b61039e61088a366004613893565b611b58565b61038061089d366004613b1b565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260106020908152604080832093909416825291909152205460ff1690565b6104636108e63660046138ff565b611b80565b61039e6108f9366004613893565b6000908152600160208190526040909120015490565b61042b7f000000000000000000000000000000000000000000000000000000000000000081565b610463610944366004613893565b611cb0565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff168061097857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109b157600080fd5b6000828152600b602090815260408083205473ffffffffffffffffffffffffffffffffffffffff85811685526010845282852033808752945291909320549216149060ff1681806109ff5750805b610a0857600080fd5b6000848152600c602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff89811691821790925591518793918716917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a45050505050565b600560205281600052604060002081633b9aca008110610aaa57600080fd5b6003020180546001820154600290920154600f82810b955070010000000000000000000000000000000090920490910b925084565b6000610aea42611085565b905090565b600082815260056020526040812082633b9aca008110610b1157610b11613b4e565b600302016001015490505b92915050565b610b2e83838333611cef565b505050565b60125460ff16600114610b4557600080fd5b6012805460ff19166002179055610b5c3382611dda565b610b6857610b68613b7d565b60008181526008602052604090205460ff1615610bcc5760405162461bcd60e51b815260206004820152600860248201527f617474616368656400000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60008181526001602081815260409283902083518085019094528054600f0b845290910154908201819052421015610c465760405162461bcd60e51b815260206004820152601660248201527f546865206c6f636b206469646e277420657870697265000000000000000000006044820152606401610bc3565b805160408051808201825260008082526020808301828152878352600191829052938220925183547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9091161783559251919092015554600f9190910b90610cc08282613bdb565b600081905550610cea848460405180604001604052806000600f0b81526020016000815250611e4d565b6040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af1158015610d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da19190613bf2565b610dad57610dad613b7d565b610db6846124fd565b60408051858152602081018490524281830152905133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94919081900360600190a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c81610e248482613bdb565b6040805192835260208301919091520160405180910390a150506012805460ff191660011790555050565b610b2e838383604051806020016040528060008152506116b3565b6000610e768383611dda565b9392505050565b6000818152600660209081526040808320546005909252822081633b9aca008110610eaa57610eaa613b4e565b60030201547001000000000000000000000000000000009004600f0b9392505050565b60095473ffffffffffffffffffffffffffffffffffffffff163314610ef157600080fd5b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60125460009060ff16600114610f4d57600080fd5b6012805460ff19166002179055610f658383336125d6565b90506012805460ff1916600117905592915050565b60008281526006602052604081205481610f9585858461273e565b60008681526005602052604081209192509082633b9aca008110610fbb57610fbb613b4e565b60408051608081018252600392909202929092018054600f81810b8452700100000000000000000000000000000000909104900b6020830152600181015492820183905260020154606082015291506110149086613bdb565b81602001516110239190613c0f565b81518290611032908390613cc5565b600f90810b90915282516000910b1215905061104d57600081525b51600f0b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600d6020526040812054610b1c565b600354600081815260046020908152604080832081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608201529091906110ea818561282d565b949350505050565b6000610e768383612938565b60004382111561111057611110613b7d565b600354600061111f8483612c40565b600081815260046020908152604080832081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608201529192508383101561124857600060048161118f866001613d36565b8152602080820192909252604090810160002081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608083018290528501519192501461124257826060015181606001516112089190613bdb565b8360400151826040015161121c9190613bdb565b606085015161122b908a613bdb565b6112359190613d4e565b61123f9190613dba565b91505b50611297565b438260600151146112975760608201516112629043613bdb565b60408301516112719042613bdb565b60608401516112809089613bdb565b61128a9190613d4e565b6112949190613dba565b90505b6112b0828284604001516112ab9190613d36565b61282d565b9695505050505050565b60125460ff166001146112cc57600080fd5b6012805460ff191660021790556112e33383611dda565b6112ef576112ef613b7d565b60008281526001602081815260409283902083518085019094528054600f0b845290910154908201528161132557611325613b7d565b60008160000151600f0b1361137c5760405162461bcd60e51b815260206004820152601660248201527f4e6f206578697374696e67206c6f636b20666f756e64000000000000000000006044820152606401610bc3565b428160200151116113f45760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f742061646420746f2065787069726564206c6f636b2e205769746860448201527f64726177000000000000000000000000000000000000000000000000000000006064820152608401610bc3565b61140383836000846002612cca565b50506012805460ff1916600117905550565b73ffffffffffffffffffffffffffffffffffffffff821633141561143b5761143b613b7d565b33600081815260106020908152604080832073ffffffffffffffffffffffffffffffffffffffff871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60125460ff166001146114c657600080fd5b6012805460ff191660021790556114dd3383611dda565b6114e9576114e9613b7d565b600082815260016020818152604080842081518083019092528054600f0b825290920154908201529062093a80806115218542613d36565b61152b9190613dba565b6115359190613d4e565b90504282602001511161158a5760405162461bcd60e51b815260206004820152600c60248201527f4c6f636b206578706972656400000000000000000000000000000000000000006044820152606401610bc3565b60008260000151600f0b136115e15760405162461bcd60e51b815260206004820152601160248201527f4e6f7468696e67206973206c6f636b65640000000000000000000000000000006044820152606401610bc3565b816020015181116116345760405162461bcd60e51b815260206004820152601f60248201527f43616e206f6e6c7920696e637265617365206c6f636b206475726174696f6e006044820152606401610bc3565b611642630784ce0042613d36565b8111156116915760405162461bcd60e51b815260206004820152601e60248201527f566f74696e67206c6f636b2063616e2062652034207965617273206d617800006044820152606401610bc3565b6116a084600083856003612cca565b50506012805460ff191660011790555050565b6116bf84848433611cef565b823b15611829576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84169063150b7a029061171e903390889087908790600401613dce565b6020604051808303816000875af1925050508015611777575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261177491810190613e0d565b60015b611827573d8080156117a5576040519150601f19603f3d011682016040523d82523d6000602084013e6117aa565b606091505b50805161181f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610bc3565b805181602001fd5b505b50505050565b60095473ffffffffffffffffffffffffffffffffffffffff16331461185357600080fd5b6000908152600860205260409020805460ff19169055565b6118a9600060405180604001604052806000600f0b8152602001600081525060405180604001604052806000600f0b81526020016000815250611e4d565b565b6000818152600b602052604090205460609073ffffffffffffffffffffffffffffffffffffffff1661191f5760405162461bcd60e51b815260206004820152601b60248201527f517565727920666f72206e6f6e6578697374656e7420746f6b656e00000000006044820152606401610bc3565b60008281526001602081815260409283902083518085019094528054600f0b84529091015490820152610e76836119568142612f23565b60208401518451600f0b613002565b60008281526008602052604090205460ff16156119c45760405162461bcd60e51b815260206004820152600860248201527f61747461636865640000000000000000000000000000000000000000000000006044820152606401610bc3565b808214156119d157600080fd5b6119db3383611dda565b6119e457600080fd5b6119ee3382611dda565b6119f757600080fd5b6000828152600160208181526040808420815180830183528154600f90810b82529185015481850190815287875285855283872084518086019095528054840b855290950154938301849052805194519095929490910b921115611a5f578260200151611a65565b83602001515b604080518082018252600080825260208083018281528b83526001808352858420945185547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9091161785559051930192909255825180840190935280835290820152909150611aea9087908690611e4d565b611af3866124fd565b611b01858383866004612cca565b505050505050565b60125460009060ff16600114611b1e57600080fd5b6012805460ff19166002179055611b368484846125d6565b90506012805460ff191660011790559392505050565b6000610e768383612f23565b600081815260026020526040812054431415611b7657506000919050565b610b1c8242612f23565b60125460ff16600114611b9257600080fd5b6012805460ff1916600217905560008281526001602081815260409283902083518085019094528054600f0b8452909101549082015281611bd257600080fd5b60008160000151600f0b13611c295760405162461bcd60e51b815260206004820152601660248201527f4e6f206578697374696e67206c6f636b20666f756e64000000000000000000006044820152606401610bc3565b42816020015111611ca15760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f742061646420746f2065787069726564206c6f636b2e205769746860448201527f64726177000000000000000000000000000000000000000000000000000000006064820152608401610bc3565b61140383836000846000612cca565b60095473ffffffffffffffffffffffffffffffffffffffff163314611cd457600080fd5b6000908152600860205260409020805460ff19166001179055565b60008281526008602052604090205460ff1615611d4e5760405162461bcd60e51b815260206004820152600860248201527f61747461636865640000000000000000000000000000000000000000000000006044820152606401610bc3565b611d588183611dda565b611d6157600080fd5b611d6b8483613139565b611d7584836131d2565b611d7f8383613285565b60008281526002602052604080822043905551839173ffffffffffffffffffffffffffffffffffffffff80871692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450505050565b6000818152600b6020908152604080832054600c83528184205473ffffffffffffffffffffffffffffffffffffffff9182168086526010855283862088841680885295529285205492938085149392909116149060ff168280611e3a5750815b80611e425750805b979650505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260035460009081908715611fb957428760200151118015611ebd575060008760000151600f0b135b15611f02578651611ed390630784ce0090613e2a565b600f0b602080870191909152870151611eed904290613bdb565b8560200151611efc9190613c0f565b600f0b85525b428660200151118015611f1c575060008660000151600f0b135b15611f61578551611f3290630784ce0090613e2a565b600f0b602080860191909152860151611f4c904290613bdb565b8460200151611f5b9190613c0f565b600f0b84525b602080880151600090815260078252604090205490870151600f9190910b935015611fb957866020015186602001511415611f9e57829150611fb9565b602080870151600090815260079091526040902054600f0b91505b60408051608081018252600080825260208201524291810191909152436060820152811561203b575060008181526004602090815260409182902082516080810184528154600f81810b8352700100000000000000000000000000000000909104900b9281019290925260018101549282019290925260029091015460608201525b60408101518160004283101561208857604084015161205a9042613bdb565b60608501516120699043613bdb565b61207b90670de0b6b3a7640000613d4e565b6120859190613dba565b90505b600062093a806120988186613dba565b6120a29190613d4e565b905060005b60ff811015612233576120bd62093a8083613d36565b91506000428311156120d1574292506120e5565b50600082815260076020526040902054600f0b5b6120ef8684613bdb565b87602001516120fe9190613c0f565b8751889061210d908390613cc5565b600f0b905250602087018051829190612127908390613e9e565b600f90810b90915288516000910b1215905061214257600087525b60008760200151600f0b121561215a57600060208801525b60408088018490528501519295508592670de0b6b3a76400009061217e9085613bdb565b6121889086613d4e565b6121929190613dba565b85606001516121a19190613d36565b60608801526121b1600189613d36565b9750428314156121c75750436060870152612233565b6000888152600460209081526040918290208951918a01516fffffffffffffffffffffffffffffffff90811670010000000000000000000000000000000002921691909117815590880151600182015560608801516002909101555061222c81613f0e565b90506120a7565b505060038590558b156122be57886020015188602001516122549190613cc5565b846020018181516122659190613e9e565b600f0b905250885188516122799190613cc5565b84518590612288908390613e9e565b600f90810b90915260208601516000910b121590506122a957600060208501525b60008460000151600f0b12156122be57600084525b6000858152600460209081526040918290208651918701516fffffffffffffffffffffffffffffffff90811670010000000000000000000000000000000002921691909117815590850151600182015560608501516002909101558b156124ef57428b6020015111156123ad57602089015161233a9088613e9e565b96508a602001518a60200151141561235e57602088015161235b9088613cc5565b96505b60208b810151600090815260079091526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff89161790555b428a602001511115612429578a602001518a6020015111156124295760208801516123d89087613cc5565b60208b810151600090815260079091526040902080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff831617905595505b60008c815260066020526040812054612443906001613d36565b905080600660008f815260200190815260200160002081905550428960400181815250504389606001818152505088600560008f815260200190815260200160002082633b9aca00811061249957612499613b4e565b825160208401516fffffffffffffffffffffffffffffffff908116700100000000000000000000000000000000029116176003919091029190910190815560408201516001820155606090910151600290910155505b505050505050505050505050565b6125073382611dda565b6125535760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f74206f776e6572206e6f7220617070726f7665646044820152606401610bc3565b6000818152600b602052604081205473ffffffffffffffffffffffffffffffffffffffff16906125839083610949565b61258d33836131d2565b604051829060009073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008062093a80806125e88642613d36565b6125f29190613dba565b6125fc9190613d4e565b90506000851161260b57600080fd5b4281116126805760405162461bcd60e51b815260206004820152602660248201527f43616e206f6e6c79206c6f636b20756e74696c2074696d6520696e207468652060448201527f66757475726500000000000000000000000000000000000000000000000000006064820152608401610bc3565b61268e630784ce0042613d36565b8111156126dd5760405162461bcd60e51b815260206004820152601e60248201527f566f74696e67206c6f636b2063616e2062652034207965617273206d617800006044820152606401610bc3565b600a600081546126ec90613f0e565b90915550600a546126fd848261334d565b5060008181526001602081815260409283902083518085019094528054600f0b84528201549083015261273591839189918691612cca565b95945050505050565b60008082815b60808110156128225781831061275957612822565b600060026127678486613d36565b612772906002613d36565b61277c9190613dba565b60008981526005602052604081209192509082633b9aca0081106127a2576127a2613b4e565b60408051608081018252600392909202929092018054600f81810b8452700100000000000000000000000000000000909104900b60208301526001810154928201839052600201546060820152915088106127ff5781945061280d565b61280a600183613bdb565b93505b5050808061281a90613f0e565b915050612744565b509095945050505050565b600080839050600062093a808083604001516128499190613dba565b6128539190613d4e565b905060005b60ff8110156129075761286e62093a8083613d36565b915060008583111561288257859250612896565b50600082815260076020526040902054600f0b5b60408401516128a59084613bdb565b84602001516128b49190613c0f565b845185906128c3908390613cc5565b600f0b905250828614156128d75750612907565b80846020018181516128e99190613e9e565b600f0b905250506040830182905261290081613f0e565b9050612858565b5060008260000151600f0b121561291d57600082525b50516fffffffffffffffffffffffffffffffff169392505050565b60004382111561294a5761294a613b7d565b600083815260066020526040812054815b60808110156129ee57818310612970576129ee565b6000600261297e8486613d36565b612989906001613d36565b6129939190613dba565b6000888152600560205260409020909150869082633b9aca0081106129ba576129ba613b4e565b6003020160020154116129cf578093506129dd565b6129da600182613bdb565b92505b506129e781613f0e565b905061295b565b50600085815260056020526040812083633b9aca008110612a1157612a11613b4e565b604080516080810182526003928302939093018054600f81810b8652700100000000000000000000000000000000909104900b6020850152600181015491840191909152600201546060830152549091506000612a6e8783612c40565b600081815260046020908152604080832081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b938101939093526001810154918301919091526002015460608201529192508084841015612b67576000600481612adf876001613d36565b8152602080820192909252604090810160002081516080810183528154600f81810b8352700100000000000000000000000000000000909104900b93810193909352600181015491830191909152600201546060808301829052860151919250612b499190613bdb565b925083604001518160400151612b5f9190613bdb565b915050612b8b565b6060830151612b769043613bdb565b9150826040015142612b889190613bdb565b90505b60408301518215612bc8578284606001518c612ba79190613bdb565b612bb19084613d4e565b612bbb9190613dba565b612bc59082613d36565b90505b6040870151612bd79082613bdb565b8760200151612be69190613c0f565b87518890612bf5908390613cc5565b600f90810b90915288516000910b129050612c2e57505093516fffffffffffffffffffffffffffffffff169650610b1c95505050505050565b60009950505050505050505050610b1c565b60008082815b6080811015612cc057818310612c5b57612cc0565b60006002612c698486613d36565b612c74906001613d36565b612c7e9190613dba565b6000818152600460205260409020600201549091508710612ca157809350612caf565b612cac600182613bdb565b92505b50612cb981613f0e565b9050612c46565b5090949350505050565b6000548290612cd98682613d36565b6000908155604080518082019091528181526020810191909152825160208085015190830152600f0b8152825187908490612d15908390613e9e565b600f0b9052508515612d2957602083018690525b6000888152600160208181526040909220855181547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff90911617815591850151910155612d89888285611e4d565b338715801590612dab57506004856004811115612da857612da8613f47565b14155b15612e7b576040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152306024830152604482018a90527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015612e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e6f9190613bf2565b612e7b57612e7b613b7d565b83602001518173ffffffffffffffffffffffffffffffffffffffff167fff04ccafc360e16b67d682d17bd9503c4c6b9a131f6be6325762dc9ffc7de6248b8b8942604051612ecc9493929190613f76565b60405180910390a37f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c83612f008a82613d36565b6040805192835260208301919091520160405180910390a1505050505050505050565b60008281526006602052604081205480612f41576000915050610b1c565b600084815260056020526040812082633b9aca008110612f6357612f63613b4e565b60408051608081018252600392909202929092018054600f81810b8452700100000000000000000000000000000000909104900b602083015260018101549282018390526002015460608201529150612fbc9085613fcd565b8160200151612fcb9190613c0f565b81518290612fda908390613cc5565b600f90810b90915282516000910b12159050612ff557600081525b51600f0b9150610b1c9050565b606060405180610120016040528060fd815260200161445860fd913990508061302a866133ca565b60405160200161303b929190614041565b604051602081830303815290604052905080613056856133ca565b6040516020016130679291906140e9565b604051602081830303815290604052905080613082846133ca565b604051602001613093929190614191565b6040516020818303038152906040529050806130ae836133ca565b6040516020016130bf929190614239565b6040516020818303038152906040529050600061310c6130de876133ca565b6130e7846134fc565b6040516020016130f89291906142bb565b6040516020818303038152906040526134fc565b90508060405160200161311f91906143fe565b604051602081830303815290604052915050949350505050565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff83811691161461316f5761316f613b7d565b6000818152600c602052604090205473ffffffffffffffffffffffffffffffffffffffff16156131ce576000818152600c6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b5050565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff83811691161461320857613208613b7d565b6000818152600b6020526040902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561324682826136d5565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d6020526040812080546001929061327c908490613bdb565b90915550505050565b6000818152600b602052604090205473ffffffffffffffffffffffffffffffffffffffff16156132b7576132b7613b7d565b6000818152600b6020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716908117909155808452600d8084528285208054600e86528487208188528652848720889055878752600f86529386209390935590845290915280546001929061327c908490613d36565b600073ffffffffffffffffffffffffffffffffffffffff831661337257613372613b7d565b61337c8383613285565b604051829073ffffffffffffffffffffffffffffffffffffffff8516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a450600192915050565b60608161340a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613434578061341e81613f0e565b915061342d9050600a83613dba565b915061340e565b60008167ffffffffffffffff81111561344f5761344f6139bd565b6040519080825280601f01601f191660200182016040528015613479576020820181803683370190505b5090505b84156110ea5761348e600183613bdb565b915061349b600a86614443565b6134a6906030613d36565b60f81b8183815181106134bb576134bb613b4e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506134f5600a86613dba565b945061347d565b80516060908061351c575050604080516020810190915260008152919050565b6000600361352b836002613d36565b6135359190613dba565b613540906004613d4e565b9050600061354f826020613d36565b67ffffffffffffffff811115613567576135676139bd565b6040519080825280601f01601f191660200182016040528015613591576020820181803683370190505b5090506000604051806060016040528060408152602001614555604091399050600181016020830160005b8681101561361d576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016135bc565b5060038606600181146136375760028114613681576136c7565b7f3d3d0000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8301526136c7565b7f3d000000000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8301525b505050918152949350505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600d602052604081205461370790600190613bdb565b6000838152600f6020526040902054909150808214156137645773ffffffffffffffffffffffffffffffffffffffff84166000908152600e602090815260408083208584528252808320839055858352600f909152812055611829565b73ffffffffffffffffffffffffffffffffffffffff939093166000908152600e6020908152604080832093835292815282822080548684528484208190558352600f9091528282209490945592839055908252812055565b7fffffffff00000000000000000000000000000000000000000000000000000000811681146137ea57600080fd5b50565b6000602082840312156137ff57600080fd5b8135610e76816137bc565b60005b8381101561382557818101518382015260200161380d565b838111156118295750506000910152565b6000815180845261384e81602086016020860161380a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610e766020830184613836565b6000602082840312156138a557600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146138d057600080fd5b919050565b600080604083850312156138e857600080fd5b6138f1836138ac565b946020939093013593505050565b6000806040838503121561391257600080fd5b50508035926020909101359150565b60008060006060848603121561393657600080fd5b61393f846138ac565b925061394d602085016138ac565b9150604084013590509250925092565b60006020828403121561396f57600080fd5b610e76826138ac565b80151581146137ea57600080fd5b6000806040838503121561399957600080fd5b6139a2836138ac565b915060208301356139b281613978565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060008060808587031215613a0257600080fd5b613a0b856138ac565b9350613a19602086016138ac565b925060408501359150606085013567ffffffffffffffff80821115613a3d57600080fd5b818701915087601f830112613a5157600080fd5b813581811115613a6357613a636139bd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715613aa957613aa96139bd565b816040528281528a6020848701011115613ac257600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080600060608486031215613afb57600080fd5b8335925060208401359150613b12604085016138ac565b90509250925092565b60008060408385031215613b2e57600080fd5b613b37836138ac565b9150613b45602084016138ac565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613bed57613bed613bac565b500390565b600060208284031215613c0457600080fd5b8151610e7681613978565b600081600f0b83600f0b6f7fffffffffffffffffffffffffffffff600082136000841383830485118282161615613c4857613c48613bac565b7fffffffffffffffffffffffffffffffff800000000000000000000000000000006000851286820586128184161615613c8357613c83613bac565b60008712925085820587128484161615613c9f57613c9f613bac565b85850587128184161615613cb557613cb5613bac565b5050509290910295945050505050565b600081600f0b83600f0b60008112817fffffffffffffffffffffffffffffffff8000000000000000000000000000000001831281151615613d0857613d08613bac565b816f7fffffffffffffffffffffffffffffff018313811615613d2c57613d2c613bac565b5090039392505050565b60008219821115613d4957613d49613bac565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613d8657613d86613bac565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613dc957613dc9613d8b565b500490565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526112b06080830184613836565b600060208284031215613e1f57600080fd5b8151610e76816137bc565b600081600f0b83600f0b80613e4157613e41613d8b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81147fffffffffffffffffffffffffffffffff8000000000000000000000000000000083141615613e9557613e95613bac565b90059392505050565b600081600f0b83600f0b60008212826f7fffffffffffffffffffffffffffffff03821381151615613ed157613ed1613bac565b827fffffffffffffffffffffffffffffffff80000000000000000000000000000000038212811615613f0557613f05613bac565b50019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613f4057613f40613bac565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b848152602081018490526080810160058410613fbb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60408201939093526060015292915050565b6000808312837f80000000000000000000000000000000000000000000000000000000000000000183128115161561400757614007613bac565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831381161561403b5761403b613bac565b50500390565b6000835161405381846020880161380a565b7f746f6b656e200000000000000000000000000000000000000000000000000000908301908152835161408d81600684016020880161380a565b7f3c2f746578743e3c7465787420783d2231302220793d2234302220636c617373600692909101918201527f3d2262617365223e0000000000000000000000000000000000000000000000006026820152602e01949350505050565b600083516140fb81846020880161380a565b7f62616c616e63654f662000000000000000000000000000000000000000000000908301908152835161413581600a84016020880161380a565b7f3c2f746578743e3c7465787420783d2231302220793d2236302220636c617373600a92909101918201527f3d2262617365223e000000000000000000000000000000000000000000000000602a820152603201949350505050565b600083516141a381846020880161380a565b7f6c6f636b65645f656e642000000000000000000000000000000000000000000090830190815283516141dd81600b84016020880161380a565b7f3c2f746578743e3c7465787420783d2231302220793d2238302220636c617373600b92909101918201527f3d2262617365223e000000000000000000000000000000000000000000000000602b820152603301949350505050565b6000835161424b81846020880161380a565b7f76616c7565200000000000000000000000000000000000000000000000000000908301908152835161428581600684016020880161380a565b7f3c2f746578743e3c2f7376673e0000000000000000000000000000000000000060069290910191820152601301949350505050565b7f7b226e616d65223a20226c6f636b2023000000000000000000000000000000008152600083516142f381601085016020880161380a565b7f222c20226465736372697074696f6e223a2022536f6c69646c79206c6f636b736010918401918201527f2c2063616e206265207573656420746f20626f6f73742067617567652079696560308201527f6c64732c20766f7465206f6e20746f6b656e20656d697373696f6e2c20616e6460508201527f207265636569766520627269626573222c2022696d616765223a20226461746160708201527f3a696d6167652f7376672b786d6c3b6261736536342c00000000000000000000609082015283516143c88160a684016020880161380a565b7f227d00000000000000000000000000000000000000000000000000000000000060a6929091019182015260a801949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161443681601d85016020870161380a565b91909101601d0192915050565b60008261445257614452613d8b565b50069056fe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e3c7465787420783d2231302220793d2232302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa164736f6c634300080b000a", - "linkReferences": {}, - "deployedLinkReferences": {} - } diff --git a/packages/boba/gateway/src/deployment/rinkeby/addresses.json b/packages/boba/gateway/src/deployment/rinkeby/addresses.json deleted file mode 100644 index 161f45d503..0000000000 --- a/packages/boba/gateway/src/deployment/rinkeby/addresses.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "L1CrossDomainMessenger":"0x04059a546419f54db4bfafFae9d4af3b081C2a8D", - "L1MultiMessageRelayer":"0x5C6263BCAa00C7f5988E148dB3CA178e1262E69f", - "AddressManager":"0x93A96D6A5beb1F661cf052722A1424CDDA3e9418", - "Proxy__L1CrossDomainMessenger":"0xF10EEfC14eB5b7885Ea9F7A631a21c7a82cf5D76", - "Proxy__L1StandardBridge":"0xDe085C82536A06b40D20654c2AbA342F2abD7077", - "TOKENS": { - "USDT": { - "L1": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", - "L2": "0x9d0364c866A73e34649869525CD7576080259A42" - }, - "DAI": { - "L1": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", - "L2": "0x0630f97C8938051a44b0A64e9D4d484295393Fe4" - }, - "USDC": { - "L1": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", - "L2": "0xB24898De59C8E259F9742bCF2C16Fd613DCeA8F7" - }, - "WBTC": { - "L1": "0x577D296678535e4903D59A4C929B718e1D575e0A", - "L2": "0x3074A3d2570e06F74F06913965adDcd1161D7fDC" - }, - "REP": { - "L1": "0x6e894660985207feb7cf89Faf048998c71E8EE89", - "L2": "0x7896be8b69069bd39d71b3Fc987C6c0AFF7c3b95" - }, - "BAT": { - "L1": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", - "L2": "0x3C07C6627Aa879cD6988A5256E9A04D69DbD9530" - }, - "ZRX": { - "L1": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", - "L2": "0x23b274b0856C2F55C392d4F051BD252dF6C202D7" - }, - "SUSHI": { - "L1": "0xA434947525699FfbbF74260947c2906831FafD98", - "L2": "0x799F1f4045AFd00DFaE47Ab01Fb94AdB2f120B2C" - }, - "LINK": { - "L1": "0x01BE23585060835E02B77ef475b0Cc51aA1e0709", - "L2": "0x1cC8d6d2f14ac432605558A30461ebF501EaE427" - }, - "UNI": { - "L1": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", - "L2": "0x803Ec6089Ab7CC320840EDBd4bB99399467E57E0" - }, - "OMG": { - "L1": "0x2B203de02AD6109521e09985b3aF9B8c62541Cd6", - "L2": "0xC5086AA4BB6F18B3D966381E18Bcc317CeD9507c" - }, - "FRAX": { - "L1": "0x54717398c107ab24ec82bca3f3c2d4dda34c5f1a", - "L2": "0xaB7e355455BE7256222Ea2EBeED77dF499c96DD4" - }, - "FXS": { - "L1": "0x8ca351669fcb3434fb7a174309db3ae252e96c8c", - "L2": "0xBe11B9665c502F8966999f4B2d0E883512f0D124" - }, - "BOBA": { - "L1": "0x6A6676813d3D4317442CF84667425C13553F4a76", - "L2": "0xF5B97a4860c1D81A1e915C40EcCB5E4a5E6b8309" - } - }, - "NFTs": {}, - "L1CrossDomainMessengerFast": "0x2f28C228C2d9C8dB957E3A842C34E1c3f03f38CB", - "Proxy__L1CrossDomainMessengerFast": "0xe2a82CE9671A283190DD5E3f077027979F2c039E", - "L2LiquidityPool": "0x58E48905AbFcBd6eDcb7D7b4fA07C66C5eE5Fe56", - "L1LiquidityPool": "0xBce090E95cc724f3A4dC9c770d46AFF10f9E49d6", - "Proxy__L1LiquidityPool": "0x12F8d1cD442cf1CF94417cE6309c6D2461Bd91a3", - "Proxy__L2LiquidityPool": "0x56851CB42F315D0B90496c86E849167B8Cf7108a", - "L2TokenPool": "0x0DC3084Fd6aabb0CA9EFD20BcC791D5e6820564d", - "L1Message": "0xDCeDc3dD78F11acDD53F4a56e085E99FF7CD970a", - "L2Message": "0x5D349Ca5F9C8E99a2E6d2DddC6b15736ad0A233a", - "AtomicSwap": "0x903cABDe08F7765d201B470178e19ED1b4f48006", - "L2ERC721": "0xEdf91A2fBB745e4651eb57659929813bC3C01f14", - "L2ERC721Reg": "0xf296469f3303760D20197C2a2c9Ab2aDe02bfDEB", - "L1NFTBridge": "0x48b66666E38c0C7b4b8F863D8caEf607262183Ac", - "L2NFTBridge": "0x9b175c83d6238cB4a48E6f3C025D43E35b04391f", - "Proxy__L1NFTBridge": "0x40394f7EAb5aeB995132ba3bd3e46035FB66143a", - "Proxy__L2NFTBridge": "0x92a5dfc88F58A01fB4dBfDccE13368f9a0D418c5", - "L1MultiMessageRelayerFast": "0xEe4A28080C7785A1F14Bc143A8083b2F02B94f88" -} \ No newline at end of file diff --git a/packages/boba/gateway/src/deployment/rinkeby/rinkeby_0x93A96D6A5beb1F661cf052722A1424CDDA3e9418.json b/packages/boba/gateway/src/deployment/rinkeby/rinkeby_0x93A96D6A5beb1F661cf052722A1424CDDA3e9418.json deleted file mode 100644 index 021010bb28..0000000000 --- a/packages/boba/gateway/src/deployment/rinkeby/rinkeby_0x93A96D6A5beb1F661cf052722A1424CDDA3e9418.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "L1CrossDomainMessenger":"0x04059a546419f54db4bfafFae9d4af3b081C2a8D", - "L1MultiMessageRelayer":"0x5C6263BCAa00C7f5988E148dB3CA178e1262E69f", - "Proxy__L1CrossDomainMessenger":"0xF10EEfC14eB5b7885Ea9F7A631a21c7a82cf5D76", - "Proxy__L1StandardBridge":"0xDe085C82536A06b40D20654c2AbA342F2abD7077", - "TK_L1USDT": "0xD9BA894E0097f8cC2BBc9D24D308b98e36dc6D02", - "TK_L2USDT": "0x9d0364c866A73e34649869525CD7576080259A42", - "TK_L1DAI": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa", - "TK_L2DAI": "0x0630f97C8938051a44b0A64e9D4d484295393Fe4", - "TK_L1USDC": "0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b", - "TK_L2USDC": "0xB24898De59C8E259F9742bCF2C16Fd613DCeA8F7", - "TK_L1WBTC": "0x577D296678535e4903D59A4C929B718e1D575e0A", - "TK_L2WBTC": "0x3074A3d2570e06F74F06913965adDcd1161D7fDC", - "TK_L1REP": "0x6e894660985207feb7cf89Faf048998c71E8EE89", - "TK_L2REP": "0x7896be8b69069bd39d71b3Fc987C6c0AFF7c3b95", - "TK_L1BAT": "0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99", - "TK_L2BAT": "0x3C07C6627Aa879cD6988A5256E9A04D69DbD9530", - "TK_L1ZRX": "0xddea378A6dDC8AfeC82C36E9b0078826bf9e68B6", - "TK_L2ZRX": "0x23b274b0856C2F55C392d4F051BD252dF6C202D7", - "TK_L1SUSHI": "0xA434947525699FfbbF74260947c2906831FafD98", - "TK_L2SUSHI": "0x799F1f4045AFd00DFaE47Ab01Fb94AdB2f120B2C", - "TK_L1LINK": "0x01BE23585060835E02B77ef475b0Cc51aA1e0709", - "TK_L2LINK": "0x1cC8d6d2f14ac432605558A30461ebF501EaE427", - "TK_L1UNI": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", - "TK_L2UNI": "0x803Ec6089Ab7CC320840EDBd4bB99399467E57E0", - "TK_L1OMG": "0x2B203de02AD6109521e09985b3aF9B8c62541Cd6", - "TK_L2OMG": "0xC5086AA4BB6F18B3D966381E18Bcc317CeD9507c", - "TK_L1FRAX": "0xa23A5D188C8E2f4b3E029815a793972C58D89890", - "TK_L2FRAX": "0x6FF9c8FF8F0B6a0763a3030540c21aFC721A9148", - "TK_L1FXS": "0xb1efaEC30db0da6CD2ADbDE71D82A73DcA6aF182", - "TK_L2FXS": "0x991AaC49780774D1e358ceA459070f9351022139", - "TK_L1BOBA": "0x6A6676813d3D4317442CF84667425C13553F4a76", - "TK_L2BOBA": "0xF5B97a4860c1D81A1e915C40EcCB5E4a5E6b8309", - "TK_L1UST": "0x012e4C202b1153183F7B0e7A90348C4cCE15d2c9", - "TK_L2UST": "0x429582bDe1B0E011C48d883354050938f194743F", - "TK_L1BUSD": "0x697Eda570FE014832456b4B3d2Dff8591eA3f4fc", - "TK_L2BUSD": "0x01c9DC8B9c66D61a56Db7bF3F5303Cd9E9c85B1F", - "TK_L1BNB": "0xeB72FaBBEF4D4F59bCA384123977eD9529c9bd2e", - "TK_L2BNB": "0x42356f071B65FD0FBA2b74566EB1D3634F008CDa", - "TK_L1FTM": "0x72fe8933fca2c14a8e2b3bf050e3d81e90efeb60", - "TK_L2FTM": "0xc346Ab3D382521296dB7b52d71b062dDEC54e9Db", - "TK_L1MATIC": "0x3ac6affed629a16ffccd1c865ad6e10dc0a1076a", - "TK_L2MATIC": "0xbcA151440F29c10BeBA5a410c52914e236Fc9845", - "TK_L2xBOBA": "0xebE42F5cEA2184F6b416bFFAB0744b11281AE95b", - "NFT_L1BOBA": "0xa0b66988270154d7e2b5f4707682bbb7c7a8671f", - "NFT_L2BOBA": "0x21Cb36a422b75388aFe3b7291b34c7b3c976A05A", - "NFT_L1BOBO": "0x151325621966039835F1Ce7a1E3c5bA88A4F05d6", - "NFT_L2BOBO": "0x66C893019bC366eB497f49c8Df79e63AF73124eA", - "L1CrossDomainMessengerFast": "0x2f28C228C2d9C8dB957E3A842C34E1c3f03f38CB", - "Proxy__L1CrossDomainMessengerFast": "0xe2a82CE9671A283190DD5E3f077027979F2c039E", - "L2LiquidityPool": "0x270216Baf279Ec201D490A26911dfa4F555B26F2", - "L1LiquidityPool": "0xfF7CBEA9a9EC58B02D14906f7C98314686829645", - "Proxy__L1LiquidityPool": "0x12F8d1cD442cf1CF94417cE6309c6D2461Bd91a3", - "Proxy__L2LiquidityPool": "0x56851CB42F315D0B90496c86E849167B8Cf7108a", - "L2TokenPool": "0x0DC3084Fd6aabb0CA9EFD20BcC791D5e6820564d", - "L1Message": "0xDCeDc3dD78F11acDD53F4a56e085E99FF7CD970a", - "L2Message": "0x5D349Ca5F9C8E99a2E6d2DddC6b15736ad0A233a", - "AtomicSwap": "0x903cABDe08F7765d201B470178e19ED1b4f48006", - "L2ERC721": "0xEdf91A2fBB745e4651eb57659929813bC3C01f14", - "L2ERC721Reg": "0xf296469f3303760D20197C2a2c9Ab2aDe02bfDEB", - "L1NFTBridge": "0x054DB39B7C859d1bCBfc156d3f7a5a2d00252115", - "L2NFTBridge": "0xB94bD836eBB6f3733e1a48534938224281fC3A9E", - "Proxy__L1NFTBridge": "0x01F5d5D6de3a8c7A157B22FD331A1F177b7bE043", - "Proxy__L2NFTBridge": "0x5E368E9dce71B624D7DdB155f360E7A4969eB7aA", - "L1MultiMessageRelayerFast": "0xEe4A28080C7785A1F14Bc143A8083b2F02B94f88", - "Timelock": "0xa21B916bC0E7787aAB6b7ba3402cfafF546FEF34", - "GovernorBravoDelegate": "0xBdD8Cb5D75F7375A9A45F40779e055596af7F581", - "GovernorBravoDelegator": "0x472e5C097C790c6a44366a89a987Ec996A4d83e0", - "DiscretionaryExitBurn": "0xF121Fd008A17c8C76DF1f003f19523130060B5BA", - "BobaFixedSavings": "0x87668fD78F3a56Fe0bE323e03A09A120559942c4", - "Proxy__BobaFixedSavings": "0x1fd7e7D032dBB3739791F8AaC2cA59073705F2aE", - "BobaAirdropL1": "0x3067398621D1C1bfe10Fb4C321bF1005fa5BFc3E" -} diff --git a/packages/boba/gateway/src/hooks/useFeeSwitcher.ts b/packages/boba/gateway/src/hooks/useFeeSwitcher.ts index 37eda27989..f98ecfadb0 100644 --- a/packages/boba/gateway/src/hooks/useFeeSwitcher.ts +++ b/packages/boba/gateway/src/hooks/useFeeSwitcher.ts @@ -1,7 +1,7 @@ import { switchFee } from 'actions/setupAction' import { openAlert, openError } from 'actions/uiAction' import BN from 'bignumber.js' -import { isEqual } from 'lodash' +import { isEqual } from 'util/lodash' import { useCallback } from 'react' import { useDispatch, useSelector } from 'react-redux' import { selectBobaFeeChoice, selectlayer2Balance } from 'selectors' diff --git a/packages/boba/gateway/src/index.scss b/packages/boba/gateway/src/index.scss index 2b4365c013..bfa633a9fd 100644 --- a/packages/boba/gateway/src/index.scss +++ b/packages/boba/gateway/src/index.scss @@ -65,59 +65,6 @@ $white500: rgba(255, 255, 255, 0.5); } } -.react-datepicker.dark { - background: #09162B; - box-shadow: -13px 15px 19px rgb(0 0 0 / 15%), inset 53px 36px 120px rgb(255 255 255 / 6%); - border-radius: 12px; - border: none; - .react-datepicker__header { - background: transparent; - border: none; - } - - .react-datepicker__triangle { - &::after { - border-bottom-color: #09162B !important; - } - - &::before { - border-bottom-color: #09162B !important; - } - } - .react-datepicker__month { - padding: 5px; - } - - .react-datepicker__day-name, .react-datepicker__day, .react-datepicker__time-name { - color: #FFFFFF !important; - } - - .react-datepicker__current-month { - color: #FFFFFF !important; - } - - .react-datepicker__day--disabled { - opacity: 0.4 - } - .react-datepicker__day { - &:hover { - background-color: transparent; - color: #fff; - border-radius: 50%; - border: 0.2px solid #CCFF00; - } - } - .react-datepicker__day--keyboard-selected, - .react-datepicker__month-text--keyboard-selected, - .react-datepicker__quarter-text--keyboard-selected, - .react-datepicker__year-text--keyboard-selected { - border-radius: 50%; - background-color: #3C5DFC; - color: #fff; - } -} - - input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; diff --git a/packages/boba/gateway/src/layout/routes/index.js b/packages/boba/gateway/src/layout/routes/index.js index 528ac5d807..1a9704de5d 100644 --- a/packages/boba/gateway/src/layout/routes/index.js +++ b/packages/boba/gateway/src/layout/routes/index.js @@ -6,7 +6,6 @@ import { selectActiveNetwork } from 'selectors'; import { useRoutes } from 'react-router-dom'; import { intersection } from 'util/lodash'; - export const Router = () => { const routeList = ROUTE_LIST; diff --git a/packages/boba/gateway/src/layout/routes/routeList.js b/packages/boba/gateway/src/layout/routes/routeList.js index 3db6982f7f..5fbebb8a15 100644 --- a/packages/boba/gateway/src/layout/routes/routeList.js +++ b/packages/boba/gateway/src/layout/routes/routeList.js @@ -1,18 +1,16 @@ import React from 'react'; +import { Navigate } from 'react-router-dom'; -import { DISABLE_VE_DAO, ROUTES_PATH } from "util/constant"; +import { ROUTES_PATH } from "util/constant"; -import Bridging from 'containers/Bridging'; -import Vote from 'containers/VoteAndDao/Vote/Vote'; -import BobaScope from 'containers/bobaScope/BobaScope'; -import OldDao from 'containers/dao/OldDao'; -import DevTools from 'containers/devtools/DevTools'; -import EarnWrapper from 'containers/earn/EarnWrapper'; -import Home from "containers/home/Home"; -import SaveWrapper from 'containers/save/SaveWrapper'; -import Lock from 'containers/veboba/Lock'; -import { Navigate } from 'react-router-dom'; -import History from 'containers/history/History'; +const Bridging = React.lazy(() => import('containers/Bridging')); +const BobaScope = React.lazy(() => import('containers/bobaScope/BobaScope')); +const OldDao = React.lazy(() => import('containers/dao/OldDao')); +const DevTools = React.lazy(() => import('containers/devtools/DevTools')); +const EarnWrapper = React.lazy(() => import('containers/earn/EarnWrapper')); +const Home = React.lazy(() => import('containers/home/Home')); +const SaveWrapper = React.lazy(() => import('containers/save/SaveWrapper')); +const History = React.lazy(() => import('containers/history/History')); export const COMMON_ROUTES = [ { @@ -61,19 +59,7 @@ export const ROUTE_LIST = [ path: ROUTES_PATH.DAO, element: , key: 'DAO', - }, - { - path: ROUTES_PATH.LOCK, - element: , - key: 'DAO', - disable: !!Number(DISABLE_VE_DAO), - }, - { - path: ROUTES_PATH.VOTE_DAO, - element: , - key: 'DAO', - disable: !!Number(DISABLE_VE_DAO), - }, + } ] } ] diff --git a/packages/boba/gateway/src/reducers/index.js b/packages/boba/gateway/src/reducers/index.js index d772a64c10..c7042aaba3 100644 --- a/packages/boba/gateway/src/reducers/index.js +++ b/packages/boba/gateway/src/reducers/index.js @@ -31,7 +31,6 @@ import daoReducer from './daoReducer' import fixedReducer from './fixedReducer' import verifierReducer from './verifierReducer'; import bridgeReducer from './bridgeReducer'; -import veBobaReducer from './veBobaReducer'; import devToolsReducer from './devToolsReducer'; import networkReducer from './networkReducer'; @@ -52,7 +51,6 @@ const rootReducer = combineReducers({ fixed: fixedReducer, verifier: verifierReducer, bridge: bridgeReducer, - veboba: veBobaReducer, devTools: devToolsReducer, network: networkReducer }) diff --git a/packages/boba/gateway/src/reducers/uiReducer.js b/packages/boba/gateway/src/reducers/uiReducer.js index ba36b764aa..b6045c57de 100644 --- a/packages/boba/gateway/src/reducers/uiReducer.js +++ b/packages/boba/gateway/src/reducers/uiReducer.js @@ -15,11 +15,7 @@ limitations under the License. */ const initialState = { theme: 'dark', - depositModal: false, - depositBatchModal: false, transferModal: false, - transferNFTModal: false, - exitModal: false, bridgeTypeSwitch: false, tokenPicker: false, transferPending: false, diff --git a/packages/boba/gateway/src/reducers/veBobaReducer.js b/packages/boba/gateway/src/reducers/veBobaReducer.js deleted file mode 100644 index f40f9c8c40..0000000000 --- a/packages/boba/gateway/src/reducers/veBobaReducer.js +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2022-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -const initialState = { - records: [], - pools: [] -} - -function veBobaReducer(state = initialState, action) { - switch (action.type) { - case 'LOCK/RECORDS/SUCCESS': - return { ...state, ...action.payload } - case 'VOTE/POOLS/SUCCESS': - return { ...state, ...action.payload } - - default: - return state - } -} - -export default veBobaReducer diff --git a/packages/boba/gateway/src/selectors/daoSelector.js b/packages/boba/gateway/src/selectors/daoSelector.js index b6439aabe1..ff7f3edcc3 100644 --- a/packages/boba/gateway/src/selectors/daoSelector.js +++ b/packages/boba/gateway/src/selectors/daoSelector.js @@ -34,10 +34,6 @@ export function selectProposals(state) { return state.dao.proposalList } -export function selectLatestProposalState(state) { - return state.dao.hasLiveProposal -} - export function selectProposalThreshold(state) { return state.dao.proposalThreshold } diff --git a/packages/boba/gateway/src/selectors/earnSelector.js b/packages/boba/gateway/src/selectors/earnSelector.js index 8f35d8f37a..fefb02b322 100644 --- a/packages/boba/gateway/src/selectors/earnSelector.js +++ b/packages/boba/gateway/src/selectors/earnSelector.js @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -export function selectPoolInfo () { - return function (state) { - return state.earn.poolInfo - } - } +export function selectPoolInfo() { + return function (state) { + return state.earn.poolInfo + } +} - export function selectUserInfo () { - return function (state) { - return state.earn.userInfo - } - } +export function selectUserInfo() { + return function (state) { + return state.earn.userInfo + } +} diff --git a/packages/boba/gateway/src/selectors/index.ts b/packages/boba/gateway/src/selectors/index.ts index 2ac86f5d04..a19ee105d4 100644 --- a/packages/boba/gateway/src/selectors/index.ts +++ b/packages/boba/gateway/src/selectors/index.ts @@ -12,7 +12,6 @@ export * from 'selectors/signatureSelector' export * from 'selectors/tokenSelector' export * from 'selectors/transactionSelector' export * from 'selectors/uiSelector' -export * from 'selectors/veBobaSelector' export * from 'selectors/verifierSelector' export * from 'selectors/fixedSelector' diff --git a/packages/boba/gateway/src/selectors/veBobaSelector.js b/packages/boba/gateway/src/selectors/veBobaSelector.js deleted file mode 100644 index b1844793c5..0000000000 --- a/packages/boba/gateway/src/selectors/veBobaSelector.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2022-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -export function selectLockRecords(state) { - return state.veboba.records -} - -export function selectPools(state) { - return state.veboba.pools -} diff --git a/packages/boba/gateway/src/services/graphql.service.js b/packages/boba/gateway/src/services/graphql.service.js index a6c3a007c9..6c7bcca42d 100644 --- a/packages/boba/gateway/src/services/graphql.service.js +++ b/packages/boba/gateway/src/services/graphql.service.js @@ -1,8 +1,7 @@ import {ApolloClient, gql, HttpLink, InMemoryCache} from '@apollo/client'; import fetch from 'cross-fetch'; -import {CHAIN_ID_LIST, NETWORK, NETWORK_TYPE} from 'util/network/network.util'; +import { NETWORK_TYPE } from 'util/network/network.util'; import networkService from './networkService'; -import {Layer, LAYER} from "../util/constant"; class GraphQLService { diff --git a/packages/boba/gateway/src/services/networkService.js b/packages/boba/gateway/src/services/networkService.js index bc6a225abe..d63e957670 100644 --- a/packages/boba/gateway/src/services/networkService.js +++ b/packages/boba/gateway/src/services/networkService.js @@ -20,7 +20,7 @@ import {CrossChainMessenger,} from '@eth-optimism/sdk' import {BigNumber, ethers, utils} from 'ethers' import store from 'store' -import {groupBy, orderBy} from 'util/lodash'; +import { orderBy } from 'util/lodash'; import BN from 'bn.js' import {logAmount} from 'util/amountConvert' @@ -65,12 +65,7 @@ import AuthenticatedFaucetJson from "../deployment/contracts/AuthenticatedFaucet import WAGMIv0Json from "../deployment/contracts/WAGMIv0.json" import WAGMIv1Json from "../deployment/contracts/WAGMIv1.json" -//veBoba ABIs -import veJson from "../deployment/contracts/ve.json" -import voterJson from "../deployment/contracts/BaseV1Voter.json" - // multi chain alt l1s ABI's -// import AltL1BridgeJson from "../deployment/contracts/crosschain/AltL1Bridge.json" import ETHL1BridgeJson from "../deployment/contracts/crosschain/EthBridge.json" import L2StandardERC20Json from "../deployment/contracts/crosschain/L2StandardERC20.json" import LZEndpointMockJson from "../deployment/contracts/crosschain/LZEndpointMock.json" @@ -84,8 +79,7 @@ import { graphQLService } from "./graphql.service" import tokenInfo from "@boba/register/addresses/tokenInfo" -import {isDevBuild, Layer, MIN_NATIVE_L1_BALANCE} from 'util/constant' -import {getPoolDetail} from 'util/poolDetails' +import { isDevBuild, Layer, MIN_NATIVE_L1_BALANCE } from 'util/constant' import {CHAIN_ID_LIST, getNetworkDetail, getRpcUrl, NETWORK, NETWORK_TYPE, pingRpcUrl} from 'util/network/network.util' import appService from './app.service' import walletService from './wallet.service' @@ -3406,152 +3400,6 @@ class NetworkService { } //Fetch DAO Proposals - /** - * Supporting the old (boba, xboba) and new proposals (govBoba / veNft) based. - * group created proposals by `to` and make use of respective contract to prepare the proposal data list. - * - */ - // Use this proposal fetch for veDao. - async fetchProposalsVeDao() { - - if (!this.delegateContract || this.networkGateway === 'goerli') return - - const delegateCheckV1 = await this.delegateContract.attach(this.addresses.GovernorBravoDelegator) - const delegateCheckV2 = await this.delegateContract.attach(this.addresses.GovernorBravoDelegatorV2) - - try { - - let proposalList = [] - /// @notice An event emitted when a new proposal is create - // event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startTimestamp, uint endTimestamp, string description); - - const descriptionList = await graphQLService.queryBridgeProposalCreated() - const proposalGroup = groupBy(descriptionList.data.governorProposalCreateds, 'to'); - const delegatorList = [this.addresses.GovernorBravoDelegator, this.addresses.GovernorBravoDelegatorV2]; - - for (let delegator of delegatorList) { - let delegateCheck; - if (delegator === this.addresses.GovernorBravoDelegator) { - delegateCheck = delegateCheckV1; - } else if (delegator === this.addresses.GovernorBravoDelegatorV2) { - delegateCheck = delegateCheckV2; - } - const proposals = proposalGroup[delegator.toLowerCase()] - const proposalCounts = await delegateCheck.proposalCount() - const totalProposals = await proposalCounts.toNumber() - - for (let i = 0; i < totalProposals; i++) { - const proposalRaw = proposals[i] - - if (typeof (proposalRaw) === 'undefined') continue - - let proposalID = proposalRaw.proposalId - - let proposalData = await delegateCheck.proposals(proposalID) - - const proposalStates = [ - 'Pending', - 'Active', - 'Canceled', - 'Defeated', - 'Succeeded', - 'Queued', - 'Expired', - 'Executed', - ] - - let state = await delegateCheck.state(proposalID) - - let againstVotes = parseInt(formatEther(proposalData.againstVotes)) - let forVotes = parseInt(formatEther(proposalData.forVotes)) - let abstainVotes = parseInt(formatEther(proposalData.abstainVotes)) - - let proposal = await delegateCheck.getActions(i + 2) - - let description = proposalRaw.description.toString() - - proposalList.push({ - id: proposalID.toString(), - proposal, - description, - totalVotes: forVotes + againstVotes, - forVotes, - againstVotes, - abstainVotes, - state: proposalStates[state], - startTimestamp: proposalRaw.startTimestamp, - endTimestamp: proposalRaw.endTimestamp, - }) - } - } - - // hasLive proposal only checking for GovernorBravoDelegatorV2 contracts - let hasLiveProposal = false - - if (this.account) { - const latestProposalIdRaw = await delegateCheckV2.latestProposalIds(this.account); - const latestProposalId = await latestProposalIdRaw.toNumber(); - if (latestProposalId) { /// only if proposalId greater than 0 - const latestProposalState = await delegateCheckV2.state(latestProposalId); - hasLiveProposal = [0, 1].includes(latestProposalState) /// pending & active proposal check. - } - } - - return { - proposalList, - hasLiveProposal - } - } catch (error) { - console.log("NS: fetchProposalsVeDao error:", error) - return error - } - } - - // to check wether the token has been already used for voting on proposal. - async checkProposalVote(proposalId, tokenId) { - if (!this.delegateContract) return - - try { - const delegateCheck = await this.delegateContract.attach(this.addresses.GovernorBravoDelegatorV2) - - if (this.account) { - const receipt = await delegateCheck.getReceipt(Number(proposalId), tokenId); - return receipt; - } - - } catch (error) { - console.log('NS: checkProposalVote() error', error) - return error; - } - } - - - //Cast vote for proposal - // FIXME: keeping this to refer in next release will cleanup. - async castProposalVoteVeDao({id, userVote, tokenIds}) { - - if (!this.delegateContract) return - - if (!this.account) { - console.log('NS: castProposalVote() error - called but account === null') - return - } - - try { - const delegateCheck = await this.delegateContract - .connect(this.provider.getSigner()) - .attach(this.addresses.GovernorBravoDelegatorV2) - - const res = await delegateCheck.castVote(id, userVote, tokenIds) - - return res; - - } catch (error) { - console.log("NS: castProposalVote error:", error) - return error - } - } - async queueProposal(proposalID) { if (!this.delegateContract) return @@ -3971,241 +3819,6 @@ class NetworkService { return ethers.utils.formatEther(await L2BillingContract.exitFee()) } - /***********************************************/ - /***** VeBoba *****/ - - /***********************************************/ - - - /** - * CreateLock - * - to create veboba lock - */ - async createLock({ - value_Wei_String, - lock_duration - }) { - if (!this.account) { - console.log('NS: createLock() error - called but account === null'); - return - } - - try { - const ve = new ethers.Contract( - this.addresses.Ve_BOBA, - veJson.abi, - this.provider.getSigner() - ) - - let allowance_BN = await this.BobaContract - .connect(this.provider.getSigner()) - .allowance( - this.account, - this.addresses.Ve_BOBA - ) - - let depositAmount_BN = BigNumber.from(value_Wei_String) - - let approveAmount_BN = depositAmount_BN.add(BigNumber.from('1000000000000')) - - try { - if (approveAmount_BN.gt(allowance_BN)) { - const approveStatus = await this.BobaContract - .connect(this.provider.getSigner()) - .approve( - this.addresses.Ve_BOBA, - approveAmount_BN - ) - const TX = await approveStatus.wait() - console.log("approveStatus:", TX) - } else { - console.log("Allowance is sufficient:", allowance_BN.toString(), depositAmount_BN.toString()) - } - } catch (error) { - console.log("NS: ve:lock approve error:", error) - return error - } - - const TX = await ve.create_lock(value_Wei_String, lock_duration) - await TX.wait() - return TX - - } catch (error) { - console.log("NS: Ve: createLock error:", error) - return error; - } - } - - /** - * withdrawLock - * - To withdraw existing expired lock - */ - async withdrawLock({tokenId}) { - if (!this.account) { - console.log('NS: withdrawLock() error - called but account === null') - return - } - - try { - const ve = new ethers.Contract( - this.addresses.Ve_BOBA, //check ve address is present - veJson.abi, - this.provider.getSigner() - ) - - const TX = await ve.withdraw(tokenId) - await TX.wait() - return TX - } catch (error) { - console.log("NS: Ve: withdrawLock error:", error) - return error; - } - } - - /** - * increaseLockAmount - * - To increse amount of existing lock - */ - async increaseLockAmount({ - tokenId, value_Wei_String - }) { - if (this.account === null) { - console.log('NS: increaseLockAmount() error - called but account === null') - return - } - try { - const ve = new ethers.Contract( - this.addresses.Ve_BOBA, //check ve address is present - veJson.abi, - this.provider.getSigner() - ) - - let allowance_BN = await this.BobaContract - .connect(this.provider.getSigner()) - .allowance( - this.account, - this.addresses.Ve_BOBA - ) - - let depositAmount_BN = BigNumber.from(value_Wei_String) - - let approveAmount_BN = depositAmount_BN.add(BigNumber.from('1000000000000')) - - try { - if (approveAmount_BN.gt(allowance_BN)) { - const approveStatus = await this.BobaContract - .connect(this.provider.getSigner()) - .approve( - this.addresses.Ve_BOBA, - approveAmount_BN - ) - await approveStatus.wait() - } else { - console.log("Allowance is sufficient:", allowance_BN.toString(), depositAmount_BN.toString()) - } - } catch (error) { - console.log("NS: ve:increaseLockAmount approve error:", error) - return error - } - - const TX = await ve.increase_amount(tokenId, value_Wei_String) - await TX.wait() - return TX - } catch (error) { - console.log("NS: Ve: increaseLockAmount error:", error) - return error; - } - } - - /** - * extendLockTime - * - To extend lock time of existing lock - */ - async extendLockTime({ - tokenId, lock_duration - }) { - - if (this.account === null) { - console.log('NS: increaseUnlockTime() error - called but account === null') - return - } - - try { - const ve = new ethers.Contract( - this.addresses.Ve_BOBA, //check ve address is present - veJson.abi, - this.provider.getSigner() - ) - - const TX = await ve.increase_unlock_time(tokenId, lock_duration) - await TX.wait() - return TX - - } catch (error) { - console.log("NS: Ve: extendLockTime error:", error) - return error; - } - } - - /** - * fetchLockRecords - * - To to fetch list of existing lock records. - */ - async fetchLockRecords() { - if (this.account === null) { - console.log('NS: fetchLockRecords() error - called but account === null') - return - } - - try { - - const ve = new ethers.Contract( - this.addresses.Ve_BOBA, //check ve address is present - veJson.abi, - this.provider - ) - - const baseVoter = new ethers.Contract( - this.addresses.BASE_V1_VOTER, - voterJson.abi, - this.provider - ) - - let tokenIdList = []; - let balanceInfo = []; - let nftCount = await ve.balanceOf(this.account) - - for (let index = 0; index < Number(nftCount); index++) { - const tokenId = await ve.tokenOfOwnerByIndex(this.account, index) - tokenIdList.push(Number(tokenId)) - } - - for (let tokenId of tokenIdList) { - const balance = await ve.balanceOfNFT(tokenId); - const locked = await ve.locked(tokenId); - const usedWeights = await baseVoter.usedWeights(tokenId); - - - balanceInfo.push({ - tokenId, - balance: Number(utils.formatUnits(balance, 18)), - lockedAmount: Number(utils.formatUnits(locked.amount, 18)), - expiry: new Date(locked.end.toString() * 1000), - expirySeconds: locked.end.toString() * 1000, - usedWeights: Number(utils.formatUnits(usedWeights, 18)) - }) - } - - return { - records: balanceInfo, - } - } catch (error) { - console.log("NS: Ve: fetchLockRecords error:", error) - return error; - } - } - - /************************************************* **************** Alt L1 Functions *************** *************************************************/ @@ -4379,141 +3992,9 @@ class NetworkService { } } - /************************************/ - /********* Vote & Dao Pools *********/ - - /************************************/ - - async savePoolVote({ - tokenId, - pools, - weights - }) { - if (this.account === null) { - console.log('NS: savePoolVote() error - called but account === null') - return - } - - try { - const baseVoter = new ethers.Contract( - this.addresses.BASE_V1_VOTER, - voterJson.abi, - this.provider - ) - - await baseVoter - .connect(this.provider.getSigner()) - .vote( - tokenId, - pools, - weights - ) - return true; - - } catch (error) { - console.log('NS: savePoolVote() error', error) - return error; - } - } - - async distributePool({gaugeAddress}) { - if (this.account === null) { - console.log('NS: distributePool() error - called but account === null') - return - } - - try { - const baseVoter = new ethers.Contract( - this.addresses.BASE_V1_VOTER, - voterJson.abi, - this.provider.getSigner() - ) - console.log('gaugeAddress', gaugeAddress) - await baseVoter['distribute(address)'](gaugeAddress); - - return true; - } catch (error) { - console.log('NS: distributePool() error', error) - return error; - } - } - - async fetchPools() { - if (this.account === null) { - console.log('NS: fetchPools() error - called but account === null') - return - } - - try { - - const pools = [] - const baseVoter = new ethers.Contract( - this.addresses.BASE_V1_VOTER, - voterJson.abi, - this.provider - ) - // load and iterate over nft to find vote on pools. - let {records} = await this.fetchLockRecords(); - // filter the ve nft records which has used. - records = records.filter((token) => token.usedWeights > 0) - - const poolLen = await baseVoter.length(); - - for (let i = 0; i < Number(poolLen); i++) { - const poolId = await baseVoter.pools(i); - // pool votes - const rawVotes = await baseVoter.weights(poolId); - const votes = Number(utils.formatUnits(rawVotes, 18)); - // total pools weights - const rawTotalWeights = await baseVoter.totalWeight(); - const totalWeigths = Number(utils.formatUnits(rawTotalWeights, 18)); - - // vote percentage - const votePercentage = (votes / totalWeigths) * 100; - // guage address needed to distribute w.r.to pool. - const gaugeAddress = await baseVoter.gauges(poolId); - - let usedTokens = []; - for (let j = 0; j < records.length; j++) { - const nft = records[j]; - const rawTokenVote = await baseVoter.votes(nft.tokenId, poolId); - const tokenVote = Number(utils.formatUnits(rawTokenVote, 18)); - - if (tokenVote) { - usedTokens.push({ - tokenId: nft.tokenId, - vote: tokenVote - }) - } - } - - pools.push({ - ...getPoolDetail(poolId), - poolId, - totalVotes: votes.toFixed(2), - votePercentage, - gaugeAddress, - usedTokens - }) - } - - return { - pools - } - - } catch (error) { - console.log("NS: Ve: fetchPools error:", error) - return error; - } - } - /**************************************** - ************* STARTS HERE ************** - ***********OLD DAO REMOVE ME *********** + ************* DAO *********** *****************************************/ - - // FIXME: remove me once deprecated old dao. - async fetchProposals() { if (!this.delegateContract) return diff --git a/packages/boba/gateway/src/util/constant.ts b/packages/boba/gateway/src/util/constant.ts index afa2890807..714bf79ef6 100644 --- a/packages/boba/gateway/src/util/constant.ts +++ b/packages/boba/gateway/src/util/constant.ts @@ -23,8 +23,6 @@ export const MAX_HEALTH_BLOCK_LAG: EnvType = export const WALLET_VERSION: EnvType = process.env.REACT_APP_WALLET_VERSION export const SPEED_CHECK: EnvType = process.env.REACT_APP_SPEED_CHECK export const TARGET_CHAIN_URL: EnvType = process.env.REACT_APP_TARGET_CHAIN_URL -// VE DAO FLAG -export const DISABLE_VE_DAO: EnvType = process.env.REACT_APP_DISABLE_VE_DAO // WalletConnect FLAG export const DISABLE_WALLETCONNECT: EnvType = process.env.REACT_APP_DISABLE_WALLETCONNECT diff --git a/packages/boba/gateway/src/util/lodash.js b/packages/boba/gateway/src/util/lodash.js index e572e3cb1c..c539d65aa7 100644 --- a/packages/boba/gateway/src/util/lodash.js +++ b/packages/boba/gateway/src/util/lodash.js @@ -1,9 +1,8 @@ -import isEqual from 'lodash/isEqual' -import intersection from 'lodash/intersection' -import orderBy from 'lodash/orderBy' -import groupBy from 'lodash/groupBy' -import keyBy from 'lodash/keyBy' -import flatten from 'lodash/flatten' - - -export { isEqual, intersection, orderBy, groupBy, keyBy, flatten}; +import isEqual from 'lodash.isequal' +import intersection from 'lodash.intersection' +import orderBy from 'lodash.orderby' +import keyBy from 'lodash.keyby' +import flatten from 'lodash.flatten' + + +export { isEqual, intersection, orderBy, keyBy, flatten }; diff --git a/packages/boba/gateway/src/util/poolDetails.js b/packages/boba/gateway/src/util/poolDetails.js deleted file mode 100644 index 6a66878f7e..0000000000 --- a/packages/boba/gateway/src/util/poolDetails.js +++ /dev/null @@ -1,23 +0,0 @@ -const POOL_DETAIL_MAPPING = { - "0xcd14af5d13c91316127a0234c4fE7d72dA9D76e8": { - name: 'BOBA-ETH', - description: 'olongswap LP', - }, - "0xE20EFfA9eDC92ef5a5Cf715b2f11f7Eaa0Ea40FB": { - name: 'BOBA-ETH', - description: 'olongswap LP', - }, - "0x2d537a22a44999Bf150b71dC6CBb7aBE94797636": { - name: 'BOBA-ETH', - description: 'olongswap LP', - }, - "0xbD20F6F5F1616947a39E11926E78ec94817B3931": { - name: 'BOBA-ETH', - description: 'olongswap LP', - }, -} - - -export const getPoolDetail = (poolId) => { - return POOL_DETAIL_MAPPING[ poolId ] -} diff --git a/yarn.lock b/yarn.lock index 26b4aed67f..9ce3d72033 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3438,7 +3438,7 @@ rxjs "^7.2.0" semver "^7.3.5" -"@discoveryjs/json-ext@^0.5.0", "@discoveryjs/json-ext@^0.5.3": +"@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.0", "@discoveryjs/json-ext@^0.5.3": version "0.5.7" resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== @@ -3493,7 +3493,7 @@ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.1.tgz#c1ddb040429c6d21d38cc945fe75c818cfb68e17" integrity sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA== -"@emotion/react@^11.10.6", "@emotion/react@^11.8.1": +"@emotion/react@^11.8.1": version "11.11.0" resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.11.0.tgz#408196b7ef8729d8ad08fc061b03b046d1460e02" integrity sha512-ZSK3ZJsNkwfjT3JpDAWJZlrGD81Z3ytNDsxw1LKq1o+xkmO5pnWfr6gmCC8gHEFf3nSSX/09YrG67jybNPxSUw== @@ -3523,7 +3523,7 @@ resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.2.tgz#d58e788ee27267a14342303e1abb3d508b6d0fec" integrity sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA== -"@emotion/styled@^11.6.0": +"@emotion/styled@^11.11.0": version "11.11.0" resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.11.0.tgz#26b75e1b5a1b7a629d7c0a8b708fbf5a9cdce346" integrity sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng== @@ -5740,7 +5740,7 @@ jss-plugin-vendor-prefixer "^10.9.2" prop-types "^15.8.1" -"@mui/system@^5.12.1", "@mui/system@^5.13.2": +"@mui/system@^5.13.2": version "5.14.5" resolved "https://registry.yarnpkg.com/@mui/system/-/system-5.14.5.tgz#614394c4183d90df82c540e0e736ba72c1f95f8e" integrity sha512-mextXZHDeGcR7E1kx43TRARrVXy+gI4wzpUgNv7MqZs1dvTVXQGVeAT6ydj9d6FUqHBPMNLGV/21vJOrpqsL+w== @@ -6371,6 +6371,11 @@ schema-utils "^3.0.0" source-map "^0.7.3" +"@polka/url@^1.0.0-next.20": + version "1.0.0-next.23" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.23.tgz#498e41218ab3b6a1419c735e5c6ae2c5ed609b6c" + integrity sha512-C16M+IYz0rgRhWZdCmK+h58JMv8vijAA61gmz2rspCSwKwzBebpdcsiUmwrtJRdphuY30i6BSLEOP8ppbNLyLg== + "@popperjs/core@^2.11.3", "@popperjs/core@^2.11.8": version "2.11.8" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" @@ -9384,6 +9389,46 @@ "@types/level-errors" "*" "@types/node" "*" +"@types/lodash.flatten@^4.4.7": + version "4.4.7" + resolved "https://registry.yarnpkg.com/@types/lodash.flatten/-/lodash.flatten-4.4.7.tgz#0072c8fc0b7e2d0741c118c9bbcb1c1f3602504e" + integrity sha512-6yyP/mHEKL2sa86V61F7TnEcUKlLML9+aWI7TCKvnS4SFt7RD4zTVwkdDgluOJqxVkwZ/2z7HvtRs/7j/Uru7g== + dependencies: + "@types/lodash" "*" + +"@types/lodash.intersection@^4.4.7": + version "4.4.7" + resolved "https://registry.yarnpkg.com/@types/lodash.intersection/-/lodash.intersection-4.4.7.tgz#fb7850d59e3259238dfe0ecb20952c589dd31dc5" + integrity sha512-7ukD2s54bmRNNpiH9ApEErO4H6mB8+WmXFr/6RpP3e/n7h3UFhEJC7QwLcoWAqOrYCIRFMAAwDf3ambSsW8c5Q== + dependencies: + "@types/lodash" "*" + +"@types/lodash.isequal@^4.5.6": + version "4.5.6" + resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.6.tgz#ff42a1b8e20caa59a97e446a77dc57db923bc02b" + integrity sha512-Ww4UGSe3DmtvLLJm2F16hDwEQSv7U0Rr8SujLUA2wHI2D2dm8kPu6Et+/y303LfjTIwSBKXB/YTUcAKpem/XEg== + dependencies: + "@types/lodash" "*" + +"@types/lodash.keyby@^4.6.7": + version "4.6.7" + resolved "https://registry.yarnpkg.com/@types/lodash.keyby/-/lodash.keyby-4.6.7.tgz#e5ae589c73886fa23f08a40debf07098cacc9f30" + integrity sha512-3qSHbbxLfXlARIKsaijZPb/5ZHDajv1vRg7OlAOuBNwN29PESS3sEOPfG1s2kzSuZnKtxtXZd1lvGj5JasN91w== + dependencies: + "@types/lodash" "*" + +"@types/lodash.orderby@^4.6.7": + version "4.6.7" + resolved "https://registry.yarnpkg.com/@types/lodash.orderby/-/lodash.orderby-4.6.7.tgz#3484098c0633f45aa0d3a57c5a8fc8a031cebb43" + integrity sha512-GaaUBTS4RTjL8gz1ZXkwAB/defpGMOWwCG9C4HL9g81i4wghIoVVESQCUa1xRsyUBqAb5JwLbSwvL0q36rK0sA== + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.14.198" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.198.tgz#4d27465257011aedc741a809f1269941fa2c5d4c" + integrity sha512-trNJ/vtMZYMLhfN45uLq4ShQSw0/S7xCTLLVM+WM1rmFpba/VS42jVUgaO3w/NOLiWR/09lnYk0yMaA/atdIsg== + "@types/lodash@^4.14.167": version "4.14.195" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" @@ -10903,7 +10948,7 @@ acorn-walk@^7.1.1, acorn-walk@^7.2.0: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.1.1: +acorn-walk@^8.0.0, acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -10918,6 +10963,11 @@ acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: resolved "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +acorn@^8.0.4: + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + acorn@^8.2.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.2: version "8.8.2" resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" @@ -22470,9 +22520,14 @@ lodash.debounce@^4.0.8: resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== +lodash.escape@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" + integrity sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw== + lodash.flatten@^4.4.0: version "4.4.0" - resolved "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" integrity sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g== lodash.flattendeep@^4.4.0: @@ -22485,6 +22540,16 @@ lodash.get@^4.4.2: resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz" integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== +lodash.intersection@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.intersection/-/lodash.intersection-4.4.0.tgz#0a11ba631d0e95c23c7f2f4cbb9a692ed178e705" + integrity sha512-N+L0cCfnqMv6mxXtSPeKt+IavbOBBSiAEkKyLasZ8BVcP9YXQgxLO12oPR8OyURwKV8l5vJKiE1M8aS70heuMg== + +lodash.invokemap@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.invokemap/-/lodash.invokemap-4.6.0.tgz#1748cda5d8b0ef8369c4eb3ec54c21feba1f2d62" + integrity sha512-CfkycNtMqgUlfjfdh2BhKO/ZXrP8ePOX5lEU/g0R3ItJcnuxWDwokMGKx1hWcfOikmyOVx6X9IwWnDGlgKl61w== + lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz" @@ -22505,6 +22570,11 @@ lodash.isplainobject@^4.0.6: resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz" integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA== +lodash.keyby@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.keyby/-/lodash.keyby-4.6.0.tgz#7f6a1abda93fd24e22728a4d361ed8bcba5a4354" + integrity sha512-PRe4Cn20oJM2Sn6ljcZMeKgyhTHpzvzFmdsp9rK+6K0eJs6Tws0MqgGFpfX/o2HjcoQcBny1Eik9W7BnVTzjIQ== + lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" @@ -22515,6 +22585,16 @@ lodash.merge@^4.6.2: resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.orderby@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.orderby/-/lodash.orderby-4.6.0.tgz#e697f04ce5d78522f54d9338b32b81a3393e4eb3" + integrity sha512-T0rZxKmghOOf5YPnn8EY5iLYeWCpZq8G41FfqoVHH5QDTAFaghJRmAdLiadEDq+ztgM2q5PjA+Z1fOwGrLgmtg== + +lodash.pullall@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.pullall/-/lodash.pullall-4.2.0.tgz#9d98b8518b7c965b0fae4099bd9fb7df8bbf38ba" + integrity sha512-VhqxBKH0ZxPpLhiu68YD1KnHmbhQJQctcipvmFnqIBDYzcIHzf3Zpu0tpeOKtR4x76p9yohc506eGdOjTmyIBg== + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz" @@ -22550,6 +22630,11 @@ lodash.uniq@^4.5.0: resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== +lodash.uniqby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" + integrity sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww== + lodash@4.17.20: version "4.17.20" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz" @@ -23868,6 +23953,11 @@ mri@^1.2.0: resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== +mrmime@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" + integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw== + ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" @@ -24831,6 +24921,11 @@ open@^8.0.4, open@^8.0.9, open@^8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" +opener@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + optimism@^0.16.2: version "0.16.2" resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.2.tgz#519b0c78b3b30954baed0defe5143de7776bf081" @@ -28879,6 +28974,15 @@ sinon@^15.2.0: nise "^5.1.4" supports-color "^7.2.0" +sirv@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-2.0.3.tgz#ca5868b87205a74bef62a469ed0296abceccd446" + integrity sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA== + dependencies: + "@polka/url" "^1.0.0-next.20" + mrmime "^1.0.0" + totalist "^3.0.0" + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" @@ -30550,6 +30654,11 @@ toidentifier@1.0.1: resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== + tough-cookie@^2.3.3, tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz" @@ -32650,6 +32759,29 @@ webidl-conversions@^6.1.0: resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== +webpack-bundle-analyzer@^4.9.1: + version "4.9.1" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.9.1.tgz#d00bbf3f17500c10985084f22f1a2bf45cb2f09d" + integrity sha512-jnd6EoYrf9yMxCyYDPj8eutJvtjQNp8PHmni/e/ulydHBWhT5J3menXt3HEkScsu9YqMAcG4CfFjs3rj5pVU1w== + dependencies: + "@discoveryjs/json-ext" "0.5.7" + acorn "^8.0.4" + acorn-walk "^8.0.0" + commander "^7.2.0" + escape-string-regexp "^4.0.0" + gzip-size "^6.0.0" + is-plain-object "^5.0.0" + lodash.debounce "^4.0.8" + lodash.escape "^4.0.1" + lodash.flatten "^4.4.0" + lodash.invokemap "^4.6.0" + lodash.pullall "^4.2.0" + lodash.uniqby "^4.7.0" + opener "^1.5.2" + picocolors "^1.0.0" + sirv "^2.0.3" + ws "^7.3.1" + webpack-cli@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.1.tgz" @@ -33369,7 +33501,7 @@ ws@^6.1.0: dependencies: async-limiter "~1.0.0" -ws@^7.4.6: +ws@^7.3.1, ws@^7.4.6: version "7.5.9" resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== From 09dcfd73f0a4641900fc7cbf8b05cd7b74bba9d6 Mon Sep 17 00:00:00 2001 From: Sahil K <86316370+sk-enya@users.noreply.github.com> Date: Fri, 15 Sep 2023 19:21:40 +0530 Subject: [PATCH 04/20] Fix/loading indicator dao proposals (#1218) * added spinner with loading as fallback component to route * fix: fetching proposal on dao page (cherry picked from commit e9953b70a5d6301d87729daa15497e8201dc1c6c) --- packages/boba/gateway/src/assets/spinner.svg | 4 ++ .../gateway/src/layout/FallbackLoader.tsx | 52 +++++++++++++++++++ packages/boba/gateway/src/layout/index.js | 3 +- .../gateway/src/services/graphql.service.js | 6 ++- .../gateway/src/services/networkService.js | 6 ++- 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 packages/boba/gateway/src/assets/spinner.svg create mode 100644 packages/boba/gateway/src/layout/FallbackLoader.tsx diff --git a/packages/boba/gateway/src/assets/spinner.svg b/packages/boba/gateway/src/assets/spinner.svg new file mode 100644 index 0000000000..9621ca520e --- /dev/null +++ b/packages/boba/gateway/src/assets/spinner.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/boba/gateway/src/layout/FallbackLoader.tsx b/packages/boba/gateway/src/layout/FallbackLoader.tsx new file mode 100644 index 0000000000..1be0c8e21d --- /dev/null +++ b/packages/boba/gateway/src/layout/FallbackLoader.tsx @@ -0,0 +1,52 @@ +import { Typography } from 'components/global' +import React, { FC } from 'react' +import { ReactSVG } from 'react-svg' +import styled, { keyframes } from 'styled-components' +import spinnerSvg from 'assets/spinner.svg' + +export const LoaderContainer = styled.div` + display: flex; + flex-direction: column; + aling-items: center; + justify-content: center; + text-align: center; + gap: 8px; + margin: auto; +` +export const LoaderText = styled(Typography).attrs({ + variant: 'h1', +})` + color: ${({ theme: { name, colors } }) => + name === 'light' ? colors.gray[800] : colors.gray[100]}; +` + +const spin = keyframes` + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +` + +//@ts-ignore +const RotatingStyledSVG = styled(ReactSVG)` + fill: var(--teal-800, #0e7d84); + animation-name: ${spin}; + animation-duration: 1s; + animation-iteration-count: infinite; + animation-timing-function: linear; + + div { + display: flex; + justify-content: center; + align-items: center; + } +` + +const FallbackLoader: FC = () => { + return ( + + + Loading... + + ) +} + +export default FallbackLoader diff --git a/packages/boba/gateway/src/layout/index.js b/packages/boba/gateway/src/layout/index.js index 3e6ecb0d74..1fbc829e0f 100644 --- a/packages/boba/gateway/src/layout/index.js +++ b/packages/boba/gateway/src/layout/index.js @@ -31,6 +31,7 @@ import { selectTheme } from 'selectors' import Router from './routes' import CustomThemeProvider from 'themes' import { Background } from 'components/global/background' +import FallbackLoader from './FallbackLoader' function App() { const dispatch = useDispatch() @@ -420,7 +421,7 @@ function App() { backgroundColor: `linear-gradient(180deg, #061122 0%, #08162C 100%)`, }} > - Loading...}> + }> diff --git a/packages/boba/gateway/src/services/graphql.service.js b/packages/boba/gateway/src/services/graphql.service.js index 6c7bcca42d..2f6122c642 100644 --- a/packages/boba/gateway/src/services/graphql.service.js +++ b/packages/boba/gateway/src/services/graphql.service.js @@ -60,7 +60,9 @@ class GraphQLService { }) } - async queryBridgeProposalCreated() { + async queryBridgeProposalCreated({ + sourceChainId + }) { const query = gql(`query { governorProposalCreateds { proposalId values description proposer } }`) @@ -84,7 +86,7 @@ class GraphQLService { } } - return await this.conductQuery(query) + return await this.conductQuery(query, null, sourceChainId) } } diff --git a/packages/boba/gateway/src/services/networkService.js b/packages/boba/gateway/src/services/networkService.js index d63e957670..a4e7507af4 100644 --- a/packages/boba/gateway/src/services/networkService.js +++ b/packages/boba/gateway/src/services/networkService.js @@ -4009,8 +4009,10 @@ class NetworkService { /// @notice An event emitted when a new proposal is created // event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startTimestamp, uint endTimestamp, string description); - - let descriptionList = await graphQLService.queryBridgeProposalCreated() + const L2ChainId = this.networkConfig.L2.chainId; + let descriptionList = await graphQLService.queryBridgeProposalCreated({ + sourceChainId: L2ChainId + }) for (let i = 0; i < totalProposals; i++) { const proposalRaw = descriptionList.data.governorProposalCreateds[i] From a64bce6ab40148709e6b560179d4f5cb80edd3f8 Mon Sep 17 00:00:00 2001 From: alvaro-ricotta <81116391+alvaro-ricotta@users.noreply.github.com> Date: Mon, 18 Sep 2023 23:17:21 -0300 Subject: [PATCH 05/20] Feat/unsupported network modal (#1188) * Show modal on unsuported networks changes * update label * usenetwork update (cherry picked from commit 9b53adc8431345886905d929068a89d60901e245) --- .../boba/gateway/src/containers/earn/Earn.js | 5 ++- .../modals/UnsupportedNetworkModal/index.tsx | 44 +++++++++++++++++++ .../modals/UnsupportedNetworkModal/styles.ts | 5 +++ .../gateway/src/containers/modals/index.tsx | 14 +++++- .../boba/gateway/src/reducers/uiReducer.js | 2 + .../gateway/src/services/wallet.service.js | 28 +++++++----- 6 files changed, 85 insertions(+), 13 deletions(-) create mode 100644 packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/index.tsx create mode 100644 packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/styles.ts diff --git a/packages/boba/gateway/src/containers/earn/Earn.js b/packages/boba/gateway/src/containers/earn/Earn.js index 3faf8c51f5..1ab4d442cd 100644 --- a/packages/boba/gateway/src/containers/earn/Earn.js +++ b/packages/boba/gateway/src/containers/earn/Earn.js @@ -29,7 +29,8 @@ import { selectBaseEnabled, selectAccountEnabled, selectLayer, - selectActiveNetworkName + selectActiveNetworkName, + selectChainIdChanged } from 'selectors' import { getEarnInfo } from 'actions/earnAction' @@ -85,6 +86,7 @@ const Earn = () => { ) useEffect(()=> { + setLpChoice(networkService.L1orL2 === 'L1' ? 'L1LP' : 'L2LP') setPoolTab(activeNetworkName[layer?.toLowerCase()]) }, [layer, networkService]) @@ -95,6 +97,7 @@ const Earn = () => { } if (accountEnabled) { + dispatch(fetchBalances()) } }, [dispatch, baseEnabled, accountEnabled]) diff --git a/packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/index.tsx b/packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/index.tsx new file mode 100644 index 0000000000..0274d40b3e --- /dev/null +++ b/packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/index.tsx @@ -0,0 +1,44 @@ +import { UnsupportedNetworkModalContainer } from './styles' +import { closeModal } from 'actions/uiAction' +import Modal from 'components/modal/Modal' +import React, { FC } from 'react' +import { useDispatch } from 'react-redux' +import { ListLabel } from '../tokenPicker/styles' +import { NetworkList } from 'components/bridge/NetworkPickerList' +import { Typography } from 'components/global/typography' + +interface UnsupportedNetworkModalProps { + open: boolean +} + +const UnsupportedNetworkModal: FC = ({ + open, +}) => { + const dispatch = useDispatch() + + const handleClose = () => { + dispatch(closeModal('UnsupportedNetwork')) + } + + return ( + + + You are on an unsupported network. Switch networks to begin using this + application. + + Network Names + + + + + + ) +} + +export default UnsupportedNetworkModal diff --git a/packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/styles.ts b/packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/styles.ts new file mode 100644 index 0000000000..a539f3c892 --- /dev/null +++ b/packages/boba/gateway/src/containers/modals/UnsupportedNetworkModal/styles.ts @@ -0,0 +1,5 @@ +import styled from 'styled-components' + +export const UnsupportedNetworkModalContainer = styled.div` + width: 100%; +` diff --git a/packages/boba/gateway/src/containers/modals/index.tsx b/packages/boba/gateway/src/containers/modals/index.tsx index 2c6a27a6af..2543e7d41c 100644 --- a/packages/boba/gateway/src/containers/modals/index.tsx +++ b/packages/boba/gateway/src/containers/modals/index.tsx @@ -22,13 +22,21 @@ import NetworkPickerModal from './networkPicker' import BridgeConfirmModal from './BridgeConfirmModal' import BridgeInProgressModal from './BridgeInProgressModal' import TransactionSuccessModal from './TransactionSuccessModal' - +import UnsupportedNetworkModal from './UnsupportedNetworkModal' /** * * NOTE:TODO: https://github.com/bobanetwork/boba/pull/982#discussion_r1253868688 */ const ModalContainer = () => { + const UnsupportedNetworkModalState = useSelector( + selectModalState('UnsupportedNetwork') + ) + + const depositBatchModalState = useSelector( + selectModalState('depositBatchModal') + ) + const transferModalState = useSelector(selectModalState('transferModal')) const tokenPickerModalState = useSelector(selectModalState('tokenPicker')) const transferPendingModalState = useSelector( @@ -95,6 +103,10 @@ const ModalContainer = () => { return ( <> + {!!UnsupportedNetworkModalState && ( + + )} + {!!transferModalState && ( )} diff --git a/packages/boba/gateway/src/reducers/uiReducer.js b/packages/boba/gateway/src/reducers/uiReducer.js index b6045c57de..c28c8864eb 100644 --- a/packages/boba/gateway/src/reducers/uiReducer.js +++ b/packages/boba/gateway/src/reducers/uiReducer.js @@ -34,6 +34,8 @@ const initialState = { walletSelectorModal: false, CDMCompletionModal: false, switchNetworkModal: false, + UnsupportedNetwork: false, + ledger: false, alert: null, error: null, diff --git a/packages/boba/gateway/src/services/wallet.service.js b/packages/boba/gateway/src/services/wallet.service.js index 5de24f7d5f..2108bde78c 100644 --- a/packages/boba/gateway/src/services/wallet.service.js +++ b/packages/boba/gateway/src/services/wallet.service.js @@ -19,6 +19,8 @@ limitations under the License. */ import { rpcUrls } from 'util/network/network.util' import store from 'store' import { CHAIN_ID_LIST, NetworkList } from 'util/network/network.util' + import { openModal } from 'actions/uiAction'; + import { setActiveNetwork, setNetwork } from 'actions/networkAction' class WalletService { @@ -55,19 +57,20 @@ import { setActiveNetwork, setNetwork } from 'actions/networkAction' } } - async listenMetaMask() { - window.ethereum.on('accountsChanged', () => { - window.location.reload() - }) + async listenMetaMask() { + window.ethereum.on('accountsChanged', () => { + window.location.reload() + }) - window.ethereum.on('chainChanged', (chainId) => { + window.ethereum.on('chainChanged', (chainId) => { + if (CHAIN_ID_LIST[Number(chainId)]) { const { networkType, chain } = CHAIN_ID_LIST[Number(chainId)] const { chain: network, icon: networkIcon, name - } = NetworkList[ networkType ].find(network => network.chain === chain); - store.dispatch({ type: 'SETUP/CHAINIDCHANGED/SET', payload: Number(chainId) }) + } = NetworkList[networkType].find(network => network.chain === chain); + store.dispatch({ type: 'SETUP/CHAINIDCHANGED/SET', payload: Number(chainId) }); store.dispatch( setNetwork({ networkType, @@ -75,10 +78,13 @@ import { setActiveNetwork, setNetwork } from 'actions/networkAction' networkIcon, name }) - ) - store.dispatch(setActiveNetwork()) - }) - } + ); + store.dispatch(setActiveNetwork()); + } else { + store.dispatch(openModal('UnsupportedNetwork')) + } + }) + } async connectWalletConnect() { try { From c48ebfc0392a23c90e9f375fb629c2ba107a8930 Mon Sep 17 00:00:00 2001 From: alvaro-ricotta <81116391+alvaro-ricotta@users.noreply.github.com> Date: Mon, 18 Sep 2023 23:51:58 -0300 Subject: [PATCH 06/20] remplace seconds by days on earn calculation (#1221) (cherry picked from commit 462866c766ba3e5eabda5bda9512d7f4f67b5095) --- .../gateway/src/components/stake/transactionList/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/boba/gateway/src/components/stake/transactionList/index.tsx b/packages/boba/gateway/src/components/stake/transactionList/index.tsx index 87dfc3a917..2632f2dfbd 100644 --- a/packages/boba/gateway/src/components/stake/transactionList/index.tsx +++ b/packages/boba/gateway/src/components/stake/transactionList/index.tsx @@ -34,12 +34,15 @@ const TransactionList = ({ stakeInfo }: TransactionListInterface) => { const unlocktimeNextBegin = formatDate(timeZero_S + twoWeeks) const unlocktimeNextEnd = formatDate(timeZero_S + twoWeeks + twoDays) + const secondsInADay = 24 * 60 * 60 + const duration_D = duration_S / secondsInADay + let locked = true if (residual_S > twoWeeks) { locked = false } - const earned = stakeInfo.depositAmount * (0.05 / 365.0) * duration_S + const earned = stakeInfo.depositAmount * (0.05 / 365.0) * duration_D const handleUnstake = async () => { const withdrawTX = await dispatch(withdrawFS_Savings(stakeInfo.stakeId)) From dc15f37e03a8e50fb230895e4a9c92cb771ebf27 Mon Sep 17 00:00:00 2001 From: alvaro-ricotta <81116391+alvaro-ricotta@users.noreply.github.com> Date: Wed, 20 Sep 2023 08:50:05 -0300 Subject: [PATCH 07/20] Feat/reinitialized network switcher (#1206) * fixing bridge status * fixing conflict * reset connection after SwitchChain network * wip updating fsbalances * update network services * removing debugging * fixing issue on network switcher * remove console logs * remove console logs (cherry picked from commit ee692cb69cf59042a2f510c5ba0c8b46b6c1c04c) --- .../boba/gateway/src/containers/earn/Earn.js | 6 +- .../boba/gateway/src/containers/home/Home.js | 11 +- .../modals/dao/old/NewProposalModalOldDao.js | 230 +++++++----------- .../switchNetwork/SwitchNetworkModal.js | 1 - .../boba/gateway/src/hooks/useBridgeSetup.ts | 1 - packages/boba/gateway/src/hooks/useOnboard.ts | 1 - .../gateway/src/hooks/useWalletConnect.ts | 2 - .../boba/gateway/src/hooks/useWalletSwitch.ts | 15 +- .../gateway/src/services/networkService.js | 33 ++- .../gateway/src/services/wallet.service.js | 18 +- 10 files changed, 138 insertions(+), 180 deletions(-) diff --git a/packages/boba/gateway/src/containers/earn/Earn.js b/packages/boba/gateway/src/containers/earn/Earn.js index 1ab4d442cd..e7221a06bb 100644 --- a/packages/boba/gateway/src/containers/earn/Earn.js +++ b/packages/boba/gateway/src/containers/earn/Earn.js @@ -70,6 +70,7 @@ const Earn = () => { const baseEnabled = useSelector(selectBaseEnabled()) const accountEnabled = useSelector(selectAccountEnabled()) + const chainIdChanged = useSelector(selectChainIdChanged()) const networkName = useSelector(selectActiveNetworkName()) const [showMDO, setShowMDO] = useState(false) @@ -88,7 +89,7 @@ const Earn = () => { useEffect(()=> { setLpChoice(networkService.L1orL2 === 'L1' ? 'L1LP' : 'L2LP') setPoolTab(activeNetworkName[layer?.toLowerCase()]) - }, [layer, networkService]) + }, [layer, networkService, activeNetworkName]) useEffect(() => { @@ -100,7 +101,7 @@ const Earn = () => { dispatch(fetchBalances()) } - }, [dispatch, baseEnabled, accountEnabled]) + }, [dispatch, baseEnabled, accountEnabled, activeNetworkName]) const getBalance = (address, chain) => { @@ -116,6 +117,7 @@ const Earn = () => { const selectedPoolInfo = lpChoice === 'L1LP' ? poolInfo.L1LP : poolInfo.L2LP; + const selectedNetworkConfig = lpChoice === 'L1LP' ? networkService?.networkConfig?.L1?.chainIdHex diff --git a/packages/boba/gateway/src/containers/home/Home.js b/packages/boba/gateway/src/containers/home/Home.js index b350a5612a..436c1c4e9f 100644 --- a/packages/boba/gateway/src/containers/home/Home.js +++ b/packages/boba/gateway/src/containers/home/Home.js @@ -20,7 +20,8 @@ import { getFS_Saves, getFS_Info } from 'actions/fixedAction' import { fetchBalances } from 'actions/networkAction' -import { selectAccountEnabled, selectActiveNetwork } from 'selectors' +import { selectAccountEnabled, selectActiveNetwork, selectBaseEnabled,selectChainIdChanged +} from 'selectors' /******** COMPONENTS ********/ import { PageTitle } from 'components/layout/PageTitle' @@ -45,9 +46,13 @@ const Home = () => { const dispatch = useDispatch() const activeNetwork = useSelector(selectActiveNetwork()) const accountEnabled = useSelector(selectAccountEnabled()) + const baseEnabled = useSelector(selectBaseEnabled()) + useInterval(() => { if (accountEnabled /*== MetaMask is connected*/) { - dispatch(fetchBalances()) // account specific + if(baseEnabled) { + dispatch(fetchBalances()) // account specific + } if (activeNetwork === NETWORK.ETHEREUM) { dispatch(getFS_Info()) // account specific dispatch(getFS_Saves()) // account specific @@ -55,6 +60,8 @@ const Home = () => { } }, POLL_INTERVAL) + + useGoogleAnalytics(); // Invoking GA analysis page view hooks useOnboard() useNetwork() diff --git a/packages/boba/gateway/src/containers/modals/dao/old/NewProposalModalOldDao.js b/packages/boba/gateway/src/containers/modals/dao/old/NewProposalModalOldDao.js index b7a600b0b9..c11323a8e3 100644 --- a/packages/boba/gateway/src/containers/modals/dao/old/NewProposalModalOldDao.js +++ b/packages/boba/gateway/src/containers/modals/dao/old/NewProposalModalOldDao.js @@ -10,154 +10,86 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import React, { useState } from 'react' -import { Box } from '@mui/material' - -import { useDispatch, useSelector } from 'react-redux' -import { closeModal, openAlert } from 'actions/uiAction' -import Modal from 'components/modal/Modal' -import Input from 'components/input/Input' - -import { createDaoProposal } from 'actions/daoAction' -import { selectProposalThreshold } from 'selectors' -import { Button } from 'components/global/button' -import { ModalTypography } from 'components/global/modalTypography' -import { Dropdown } from 'components/global/dropdown' +import React, { useState } from 'react'; +import { Box, Button, Dropdown, Input, Modal, ModalTypography } from 'components/global'; +import { useDispatch, useSelector } from 'react-redux'; +import { closeModal, openAlert } from 'actions/uiAction'; +import { createDaoProposal } from 'actions/daoAction'; +import { selectProposalThreshold } from 'selectors'; const NewProposalModal = ({ open }) => { - - const dispatch = useDispatch() - - const [action, setAction] = useState('') - const [votingThreshold, setVotingThreshold] = useState('') - - const [LPfeeMin, setLPfeeMin] = useState('') - const [LPfeeMax, setLPfeeMax] = useState('') - const [LPfeeOwn, setLPfeeOwn] = useState('') - - const [proposeText, setProposeText] = useState('') - const [proposalUri, setProposalUri] = useState('') - - const loading = false //ToDo useSelector(selectLoading([ 'PROPOSAL_DAO/CREATE' ])) - - - const proposalThreshold = useSelector(selectProposalThreshold) + const dispatch = useDispatch(); + + const initialFormState = { + action: '', + votingThreshold: '', + LPfeeMin: '', + LPfeeMax: '', + LPfeeOwn: '', + proposeText: '', + proposalUri: '' + }; + + const [formState, setFormState] = useState(initialFormState); + + const { + action, + votingThreshold, + LPfeeMin, + LPfeeMax, + LPfeeOwn, + proposeText, + proposalUri, + } = formState + + const resetState = () => setFormState(initialFormState); const onActionChange = (option) => { - setVotingThreshold('') - setLPfeeMin('') - setLPfeeMax('') - setLPfeeOwn('') - setProposeText('') - setProposalUri('') - setAction(option.value) - } + resetState(); + setFormState(prevState => ({ ...prevState, action: option.value })); + }; const handleClose = () => { - setVotingThreshold('') - setLPfeeMin('') - setLPfeeMax('') - setLPfeeOwn('') - setAction('') - setProposeText('') - setProposalUri('') - dispatch(closeModal('newProposalModal')) - } - - const options = [ - { - value: 'change-threshold', - label: 'Change Voting Threshold', - title: 'Change Voting Threshold', - }, - { - value: 'text-proposal', - label: 'Freeform Text Proposal', - title: 'Freeform Text Proposal', - }, - { - value: 'change-lp1-fee', - label: 'Change L1 LP fees', - title: 'Change L1 LP fees', - }, - { - value: 'change-lp2-fee', - label: 'Change L2 LP fees', - title: 'Change L2 LP fees', - }, - ] - - const customStyles = { - option: (provided, state) => ({ - ...provided, - color: state.isSelected ? '#282828' : '#909090', - }), - } - - const submit = async () => { - - let res = null - - if (action === 'change-threshold') { - res = await dispatch( - createDaoProposal({ - action, - value: [votingThreshold], - text: '', //extra text if any - })) - } else if (action === 'text-proposal') { - res = await dispatch(createDaoProposal({ - action, - text: `${proposeText}@@${proposalUri}` - })) - } else if (action === 'change-lp1-fee' || action === 'change-lp2-fee') { - res = await dispatch(createDaoProposal({ - action, - value: [ Math.round(Number(LPfeeMin) * 10), Math.round(Number(LPfeeMax) * 10), Math.round(Number(LPfeeOwn) * 10) ], - text: '' //extra text if any - })) - } - - if (res) { - dispatch(openAlert(`Proposal has been submitted. It will be listed soon`)) + resetState(); + dispatch(closeModal('newProposalModal')); + }; + + const handleCreateDaoProposal = async (action, value = [], text = '') => { + const result = await dispatch(createDaoProposal({ action, value, text })); + if (result) { + dispatch(openAlert('Proposal has been submitted. It will be listed soon')); + handleClose(); } - handleClose() - } + }; - const disabled = () => { - if (action === 'change-threshold') { - return !votingThreshold - } else if (action === 'text-proposal') { - return !proposeText - } else if (action === 'change-lp1-fee' || action === 'change-lp2-fee') { - if (Number(LPfeeMin) < 0.0 || Number(LPfeeMin) > 5.0) { - return true //aka disabled - } - if (Number(LPfeeMax) < 0.0 || Number(LPfeeMax) > 5.0) { - return true //aka disabled - } - if (Number(LPfeeMax) <= Number(LPfeeMin)) { - return true //aka disabled - } - if (Number(LPfeeOwn) < 0.0 || Number(LPfeeOwn) > 5.0) { - return true - } - if (LPfeeMin === '') { - return true - } - if (LPfeeMax === '') { - return true - } - if (LPfeeOwn === '') { - return true - } - return false + const submit = async () => { + switch (action) { + case 'change-threshold': + handleCreateDaoProposal(action, [votingThreshold]); + break; + case 'text-proposal': + handleCreateDaoProposal(action, [], `${proposeText}@@${proposalUri}`); + break; + case 'change-lp1-fee': + case 'change-lp2-fee': + handleCreateDaoProposal(action, [ + Math.round(Number(LPfeeMin) * 10), + Math.round(Number(LPfeeMax) * 10), + Math.round(Number(LPfeeOwn) * 10) + ]); + break; + default: + break; } - } - + }; return ( - + @@ -169,8 +101,8 @@ const NewProposalModal = ({ open }) => { style={{ zIndex: 2 }} onItemSelected={(option)=> onActionChange(option)} defaultItem={{ - value: null, - label: 'Choose type of proposal', + value: null, + label: 'Choose type of proposal', }} items={options} /> @@ -181,14 +113,14 @@ const NewProposalModal = ({ open }) => { setVotingThreshold(i.target.value)} - fullWidth - sx={{ marginBottom: '20px' }} - /> + label="DAO voting threshold" + placeholder='New voting threshold (e.g. 65000)' + value={votingThreshold} + type="number" + onChange={(i) => setVotingThreshold(i.target.value)} + fullWidth + sx={{ marginBottom: '20px' }} + /> } {(action === 'change-lp1-fee' || action === 'change-lp2-fee') && @@ -250,7 +182,9 @@ const NewProposalModal = ({ open }) => { -
- )} - {getLink({ description: proposal.description }) && ( - - More details - - )} - - - - - - ) -} - - -export default React.memo(ListProposal) diff --git a/packages/boba/gateway/src/components/listProposal/listProposal.styles.js b/packages/boba/gateway/src/components/listProposal/listProposal.styles.js deleted file mode 100644 index a32d5d4fcf..0000000000 --- a/packages/boba/gateway/src/components/listProposal/listProposal.styles.js +++ /dev/null @@ -1,66 +0,0 @@ -import styled, {css} from 'styled-components' -import { mobile } from 'themes/screens' - -export const Wrapper = styled.div` - border: 1px solid ${(props)=> props.theme.colors.box.border}; - border-radius: 12px; - background: ${(props)=> props.theme.colors.box.background}; - - padding: 20px 10px; - -` - -export const GridContainer = styled.div` - ${mobile(css` - justify-content: flex-start; - `)} -` - -export const GridItemTag = styled.div` - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; -` - -export const GridItemTagR = styled.div` - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: flex-start; - width: 100%; - margin: 8px; - padding-right: 8px; -` - -export const DropdownWrapper = styled.div` - display: flex; - align-items: center; - justify-content: center; - gap: 5px; - width: 100%; - padding: 6px; - margin-top: 10px; - background-color: ${props => props.theme.palette.background.secondary}; - border-radius: 4px; - text-align: center; -`; - -export const DropdownContent = styled.div` - width: 100%; - display: flex; - justify-content: space-between; - ${mobile(css` - padding:15px; - `)} - -` - -export const ItemHeaderContainer = styled.div` - display: flex; - align-items: center; - width: 100%; - cursor: pointer; - text-align: left; - padding-left: 8px; -` diff --git a/packages/boba/gateway/src/components/modal/Modal.tsx b/packages/boba/gateway/src/components/modal/Modal.tsx deleted file mode 100644 index edf660f2de..0000000000 --- a/packages/boba/gateway/src/components/modal/Modal.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React from 'react' - -import { Fade, Container, Box } from '@mui/material' - -import { Heading } from 'components/global' -import * as S from './styles' -import CloseIcon from 'assets/images/close.svg' -import { Svg } from 'components/global/svg' -import { ModalInterface } from './types' - -const _Modal = ({ - children, - open, - onClose, - title, - transparent, - maxWidth, - minHeight, - isMobile = false, - newStyle = false, -}: ModalInterface) => { - return ( - - - - - - - - {title} - - - - - - {children} - - - - - - ) -} - -export default _Modal diff --git a/packages/boba/gateway/src/components/modal/styles.ts b/packages/boba/gateway/src/components/modal/styles.ts deleted file mode 100644 index c391ea254e..0000000000 --- a/packages/boba/gateway/src/components/modal/styles.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { Box } from '@mui/material' -import styled, { css } from 'styled-components' -import ModalUnstyled from '@mui/base/ModalUnstyled' - -export const StyledModal = styled(ModalUnstyled)` - position: fixed; - z-index: 1300; - right: 0; - bottom: 0; - top: 0; - left: 0; - z-index: 1300; - display: flex; - align-items: center; - justify-content: center; - backdrop-filter: blur(10px); - - ${(props) => - props.theme.name === 'light' && - css` - background: rgba(0, 0, 0, 0.6); - `} - ${(props) => - props.theme.name === 'dark' && - css` - background: rgba(0, 0, 0, 0.4); - `} -` - -export const Backdrop = styled.div` - z-index: -1; - position: fixed; - right: 0; - bottom: 0; - top: 0; - left: 0; - - -webkit-tap-highlight-color: transparent; -` -interface StyleProps { - transparent?: boolean - shouldForwardProp?: (props: StyleProps) => boolean -} - -export const Style = styled.div` - display: flex; - flex-direction: column; - justify-content: space-between; - border: 1px solid ${(props) => props.theme.colors.gray[300]}; - background: ${(props) => props.theme.colors.popup}; - width: 100%; - - ${(props) => - props.transparent && - css` - background: ${props.theme.name === 'light' ? '#fff' : 'transparent'}; - `} - - backdrop-filter: ${(props) => (props.transparent ? 'none' : 'blur(15px)')}; - padding: 24px; - outline: 0; - box-sizing: border-box; - border-radius: 12px; - - ${(props) => - props.shouldForwardProp && - ` - ${props.shouldForwardProp(props)} - `} -` - -export const WrapperActionsModal = styled(Box)` - display: flex; - flex-direction: column; - align-items: center; - gap: 10px; - justify-content: flex-end; - margin-top: 15px; -` - -export const ModalHead = styled(Box)` - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: center; - gap: 5px; -` -export const IconButtonTag = styled.div` - margin-left: auto; - cursor: pointer; - > div > div { - display: flex; - } - :hover { - > div > div { - border-radius: 50%; - background: rgb(185 185 185 / 40%); - display: flex; - svg: { - fill: white; - } - } - } -` - -export const Content = styled(Box)` - display: flex; - flex-direction: column; - gap: 10px; - padding-top: 10px; -` - -export const TitleContainer = styled.div` - display: flex; - align-items: center; - width: 100%; - justify-content: center; - gap: 10px; -` - -export const BoxCenter = styled(Box)` - display: flex; - justify-content: space-around; - align-items: center; - cursor: pointer; -` diff --git a/packages/boba/gateway/src/components/modal/types.ts b/packages/boba/gateway/src/components/modal/types.ts deleted file mode 100644 index a6d7848e19..0000000000 --- a/packages/boba/gateway/src/components/modal/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface ModalInterface { - children: any - isMobile?: boolean - open: any - onClose: any - light?: any - title?: any - transparent?: any - maxWidth?: any - minHeight?: any - newStyle?: boolean | undefined -} diff --git a/packages/boba/gateway/src/components/notificationBanner/bannerConfig.ts b/packages/boba/gateway/src/components/notificationBanner/bannerConfig.ts deleted file mode 100644 index 65052bd1fd..0000000000 --- a/packages/boba/gateway/src/components/notificationBanner/bannerConfig.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { NETWORK } from 'util/network/network.util' - -interface BannerContent { - message?: string - content?: string -} - -/** - * To show alert specific to network update the config. - * - * eg. - * - BannerConfig = { - [NETWORK.ETHEREUM]: { - message: `Alert text for etheruem network`, - content: `Descriptive alert text for etheruem network`, - } - } - * - * - */ - -export const BannerConfig: Record = { - [NETWORK.AVAX]: { - message: `BobaAvax (Fuji) is being wound down & will no longer be available, starting October 31st`, - content: `BobaAvax (Fuji) is being wound down & will no longer be available starting October 31st. For users of BobaAvax or BobaAvax applications you will need to transfer all your funds to Avalanche mainnet before October 31st or risk permanently losing access to any assets on BobaAvax.`, - }, -} diff --git a/packages/boba/gateway/src/components/notificationBanner/index.tsx b/packages/boba/gateway/src/components/notificationBanner/index.tsx deleted file mode 100644 index 95d47f6c7d..0000000000 --- a/packages/boba/gateway/src/components/notificationBanner/index.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import React, { ReactNode, useState } from 'react' -import styled from 'styled-components' -import { BannerConfig } from './bannerConfig' -import { selectActiveNetwork } from 'selectors' -import { useSelector } from 'react-redux' -import { Typography } from 'components/global' - -// @style -const NotificationBannerContainer = styled('div')` - max-height: 0; - position: relative; - transition: max-height 0.4s; - padding: 0 40px; - overflow: hidden; - background: ${(props) => props.theme.primarybg}; - color: ${(props) => props.theme.primaryfg}; - - &.open { - max-height: 60px; - } - - @media ${(props) => props.theme.screen.tablet} { - padding: 0 10px; - &.open.expand { - max-height: 120px; - } - } -` - -const NotificationBannerMessage = styled(Typography).attrs({ - variant: 'body2', -})` - text-align: center; - max-width: 1440px; - margin: 0 auto; - padding: 10px 75px; - - @media ${(props) => props.theme.screen.mobile} { - padding: 5px 10px; - } - - a { - color: inherit; - text-decoration: underline; - cursor: pointer; - opacity: 0.65; - } -` - -const ReadMoreLess = styled.span` - cursor: pointer; - opacity: 0.65; - text-decoration: underline; - color: inherit; - margin-left: 8px; -` - -// @inteface -interface NotificationBannerProps { - children?: ReactNode -} - -/** - * Notification banner is sticky banner at the top of the gateway. - */ - -// @component -const NotificationBanner: React.FC = ({ - children, -}: NotificationBannerProps) => { - const [readMore, setReadMore] = useState(false) - - const activeNetwork = useSelector(selectActiveNetwork()) - - const bannerContent = BannerConfig[activeNetwork] - - if (!bannerContent) { - return <> - } - - return ( - - - {bannerContent - ? readMore - ? bannerContent.content - : bannerContent.message - : children} - {bannerContent.content && ( - setReadMore(!readMore)}> - {`Read ${!readMore ? 'more' : 'less'}`} - - )} - - - ) -} - -export default NotificationBanner diff --git a/packages/boba/gateway/src/components/notificationBanner/tests/__snapshots__/index.test.tsx.snap b/packages/boba/gateway/src/components/notificationBanner/tests/__snapshots__/index.test.tsx.snap deleted file mode 100644 index b353398395..0000000000 --- a/packages/boba/gateway/src/components/notificationBanner/tests/__snapshots__/index.test.tsx.snap +++ /dev/null @@ -1,43 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NotificationBanner should match snapshot and check show banner when open set to true 1`] = ` - -
-

- BobaAvax (Fuji) is being wound down & will no longer be available, starting October 31st - - Read more - -

-
-
-`; - -exports[`NotificationBanner should match snapshot without message 1`] = ` - -
-

- BobaAvax (Fuji) is being wound down & will no longer be available, starting October 31st - - Read more - -

-
-
-`; diff --git a/packages/boba/gateway/src/components/notificationBanner/tests/index.test.tsx b/packages/boba/gateway/src/components/notificationBanner/tests/index.test.tsx deleted file mode 100644 index e8538907a9..0000000000 --- a/packages/boba/gateway/src/components/notificationBanner/tests/index.test.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react' -import NotificationBanner from 'components/notificationBanner' -import { render, screen, fireEvent } from '@testing-library/react' -import CustomThemeProvider from 'themes' -import { Provider } from 'react-redux' -import configureStore from 'redux-mock-store' -import { NETWORK, NETWORK_TYPE } from 'util/network/network.util' -import { BannerConfig } from '../bannerConfig' - -jest.mock('../bannerConfig', () => ({ - BannerConfig: { - AVAX: { - message: `BobaAvax (Fuji) is being wound down & will no longer be available, starting October 31st`, - content: `BobaAvax (Fuji) is being wound down & will no longer be available starting October 31st. For users of BobaAvax or BobaAvax applications you will need to transfer all your funds to Avalanche mainnet before October 31st or risk permanently losing access to any assets on BobaAvax.`, - }, - }, -})) - -const data = BannerConfig[NETWORK.AVAX] - -const mockStore = configureStore() - -const renderBanner = (props: any) => { - return render( - - - - - - ) -} - -describe('NotificationBanner ', () => { - test('should match snapshot without message', () => { - const { asFragment } = renderBanner({}) - expect(asFragment()).toMatchSnapshot() - }) - - test('should match snapshot and check show banner when open set to true', () => { - const { asFragment, container } = renderBanner({ - message: data.message, - open: true, - }) - expect(asFragment()).toMatchSnapshot() - expect(container.firstChild).toHaveStyle(`max-height: 60px`) - }) - - test('should show read more btn when the content present update view on click', () => { - renderBanner({ - message: data.message, - content: data.content, - open: true, - }) - const moreBtn = screen.getByRole('readMore') - - expect(moreBtn).toBeInTheDocument() - //expect(screen.getByText(data.message)).toBeInTheDocument() - expect(moreBtn).toHaveTextContent(/read more/i) - expect(moreBtn).not.toHaveTextContent(/read less/i) - - fireEvent.click(moreBtn) - expect(moreBtn).not.toHaveTextContent(/read more/i) - //expect(screen.getByText(data.content)).toBeInTheDocument() - expect(moreBtn).toHaveTextContent(/read less/i) - }) -}) diff --git a/packages/boba/gateway/src/components/pager/Pager.tsx b/packages/boba/gateway/src/components/pager/Pager.tsx deleted file mode 100644 index 4bc0eb7bbd..0000000000 --- a/packages/boba/gateway/src/components/pager/Pager.tsx +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React from 'react' -import { NavigateNext, NavigateBefore } from '@mui/icons-material' - -import { useTheme } from '@mui/material' -import { - PagerContainer, - PagerContent, - PagerLabel, - PagerNavigation, -} from './styles' - -interface PagerProps { - currentPage: number - totalPages: number - isLastPage: boolean - onClickNext: () => void - onClickBack: () => void - label: string -} - -const Pager = ({ - currentPage, - totalPages, - isLastPage, - onClickNext, - onClickBack, - label, -}: PagerProps): JSX.Element | null => { - const theme = useTheme() as any - const variant = theme.palette.mode === 'light' ? 'contained' : 'outlined' - if (totalPages <= 1) { - return null - } - - return ( - -
{label}
- - {`Page ${currentPage} of ${totalPages}`} - - - - - - - - - -
- ) -} - -export default Pager diff --git a/packages/boba/gateway/src/components/pager/styles.ts b/packages/boba/gateway/src/components/pager/styles.ts deleted file mode 100644 index 22b18f14bd..0000000000 --- a/packages/boba/gateway/src/components/pager/styles.ts +++ /dev/null @@ -1,40 +0,0 @@ -import styled from 'styled-components' -import { Button } from '@mui/material' - -export const PagerContainer = styled.div` - display: flex; - flex-direction: row; - min-height: 25px; - justify-content: space-between; - align-items: center; -` - -export const PagerContent = styled.div` - display: flex; - flex-direction: row; - align-items: center; - margin-right: 10px; - padding: 10px 5px; - margin-bottom: 10px; -` -export const PagerLabel = styled.div` - display: flex; - flex-direction: row; - margin-right: 10px; -` - -export const PagerNavigation = styled(Button)` - height: 30px; - width: 30px; - border-radius: 8px; - margin: 0px 5px; - padding: 0px 5px; - color: #fff; - min-width: 0; - &:hover { - background: #5663ce; - > span { - font-weight: 700; - } - } -` diff --git a/packages/boba/gateway/src/components/select/Custom.select.js b/packages/boba/gateway/src/components/select/Custom.select.js deleted file mode 100644 index b0f8d8e8ed..0000000000 --- a/packages/boba/gateway/src/components/select/Custom.select.js +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react' - -import { components } from 'react-select'; -import { IconContainer, ValueContainer } from './styles'; -import { Typography } from 'components/global'; - -export const Option = (props) => { - - const { - icon, - title, - label, - subTitle - } = props.data; - - return <> - - - {icon && - {title} - } - {label && {label}} - {title && {title}} - {subTitle && {subTitle}} - - - -} - - -export const MultiValue = (props) => { - - return <> - - {props.data.label} - - -} -export const SingleValue = (props) => { - const { icon, title, label, subTitle } = props.data; - return <> - - - {icon && - {title} - } - {label && {label}} - {title && {title}} - - - -} diff --git a/packages/boba/gateway/src/components/select/Select.js b/packages/boba/gateway/src/components/select/Select.js deleted file mode 100644 index 50bc63455c..0000000000 --- a/packages/boba/gateway/src/components/select/Select.js +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React from 'react'; -import ReactSelect from 'react-select'; -import { useTheme as useThemeStyle } from 'styled-components'; -import { Select as MuiSelect, MenuItem, useTheme, Typography, Box } from '@mui/material'; -import styles from './Select.module.scss'; -import * as S from './Select.style'; -import { ArrowDropDownOutlined } from '@mui/icons-material'; -import { - Option, - MultiValue, - SingleValue -} from './Custom.select'; - -function Select({ - label, - value, - options, - onSelect, - loading, - error = '', - className, - newSelect = false, - isMulti, - isLoading = false, -}) { - const theme = useTheme(); - const styledTheme = useThemeStyle() - const selected = options.find(i => i.value === value); - - function renderOption(i) { - let title = ''; - if (i.title && i.subTitle) { - title = `${i.title} - ${i.subTitle}`; - } - if (i.title && !i.subTitle) { - title = i.title; - } - if (i.subTitle && !i.title) { - title = i.subTitle; - } - - return ( - <> - {i.image ? i.image : null} - - {title} - - - ) - } - - const renderLoading = ( - - Loading... - - ); - - const renderSelect = ( - <> - } - className={styles.select} - value={value} - onChange={onSelect} - autoWidth - MenuProps={{ - sx: { - '&& .Mui-selected': { - backgroundColor: 'transparent !important', - color: styledTheme.name === 'light' ? styledTheme.colors.gray[ 600 ] : styledTheme.colors.gray[ 100 ] - }, - } - }} - > - {options.map((i, index) => ( - - {i.description ? -
- - {i.title} - - - {i.description} - -
- : renderOption(i)} -
- ))} -
- -
-
{selected ? selected.title : error}
-
{selected ? selected.subTitle : ''}
-
- - - -
- - ); - - // TODO: Make use of react-select across all. - if (newSelect) { - return - {label && {label}} - ({ - ...base, - padding: '10px 5px', - background: styledTheme.name === 'light' ? styledTheme.colors.gray[ 50 ] : styledTheme.colors.gray[ 400 ], - borderRadius: '8px', - zIndex: 100, - }), - option: (base, { isSelected }) => ({ - ...base, - background: styledTheme.name === 'light' ? styledTheme.colors.gray[ 50 ] : styledTheme.colors.gray[ 400 ], - cursor: 'pointer', - color: styledTheme.name === 'light' ? styledTheme.colors.gray[ 800 ] : styledTheme.colors.gray[ 50 ], - }), - control: (base) => ({ - ...base, - background: styledTheme.name === 'light' ? styledTheme.colors.gray[ 50 ] : styledTheme.colors.gray[ 400 ], - borderRadius: '33px', - padding: '0 10px', - width: '100%', - border: '0px' - }), - indicatorSeparator: (base) => ({ - ...base, - display: 'none', - }), - indicatorsContainer: (base) => ({ - ...base, - svg: { - fill: styledTheme.name === 'light' ? styledTheme.colors.gray[ 600 ] : styledTheme.colors.gray[ 100 ], - } - }), - singleValue: (base) => ({ - ...base, - color: theme.color, - }), - multiValue: (base) => ({ - ...base, - color: theme.color, - marginRight: '5px', - paddingRight: '5px', - }), - valueContainer: (base) => ({ - ...base, - background: 'none', - }) - }} - theme={theme} - components={{ - Option, - MultiValue, - SingleValue, - }} - /> - - } - - return ( -
- {label &&
{label}
} - - {loading ? renderLoading : renderSelect} - -
- ); -} - -export default React.memo(Select); diff --git a/packages/boba/gateway/src/components/select/Select.module.scss b/packages/boba/gateway/src/components/select/Select.module.scss deleted file mode 100644 index 11856f6793..0000000000 --- a/packages/boba/gateway/src/components/select/Select.module.scss +++ /dev/null @@ -1,56 +0,0 @@ -.Select { - display: flex; - flex-direction: column; - min-width: 100px; - - .label { - margin-bottom: 10px; - } - - .field { - position: relative; - border: 2px solid rgba(255, 255, 255, 0.15); - transition: all 200ms ease-in-out; - display: flex; - flex-direction: row; - align-items: center; - border-radius: 12px; - } - - .select { - border: none; - outline: none; - border-radius: 0; - padding-right: 10px; - -webkit-appearance: none; - -webkit-border-radius: 0; - color: #565656; - position: absolute; - left: 0; - top: 0; - bottom: 0; - opacity: 0; - width: 100%; - } - - .selected { - flex: 1; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - height: 40px; - padding-inline: 10px; - border-radius: 10px; - - .details { - text-align: left; - margin-right: 10px; - font-size: 0.9em; - .subTitle { - font-size: 0.7em; - white-space: nowrap; - } - } - } -} diff --git a/packages/boba/gateway/src/components/select/Select.style.js b/packages/boba/gateway/src/components/select/Select.style.js deleted file mode 100644 index 3421cfb003..0000000000 --- a/packages/boba/gateway/src/components/select/Select.style.js +++ /dev/null @@ -1,32 +0,0 @@ -import { styled } from '@mui/material/styles'; -import {Box} from '@mui/material'; - - -export const Field = styled(Box)(({ theme }) => ({ - position: 'relative', - border: `1px solid ${theme.palette.background.secondaryLight}`, - transition: 'all 200ms ease -in -out', - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - borderRadius: '12px', -})) - - -export const SelectOptionContainer = styled(Box)(({ theme }) => ({ - background: theme.palette.background.secondary, - border: '1px solid rgba(255, 255, 255, 0.15)', - display: 'flex', - alignItems: 'center' -})); -export const SelectedContainer = styled(Box)(({ theme }) => ({ - flex: 1, - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-around', - height: '40px', - borderRadius: '10px', - background: theme.palette.background.secondary, -})); - diff --git a/packages/boba/gateway/src/components/select/styles.ts b/packages/boba/gateway/src/components/select/styles.ts deleted file mode 100644 index c5db58179e..0000000000 --- a/packages/boba/gateway/src/components/select/styles.ts +++ /dev/null @@ -1,31 +0,0 @@ -import styled, { css } from 'styled-components' - -export const IconContainer = styled.div` - display: 'flex'; - justifycontent: 'center'; - alignitems: 'center'; - height: 20px; - width: 20px; -` - -export const ValueContainer = styled.div<{ active?: boolean }>` - display: flex; - padding: 10px; - border-radius: 8px; - align-items: center; - gap: 10px; - ${({ active }) => - active && - css` - background: ${({ theme }) => theme.bg.secondary}; - `} - &:hover { - background: ${({ theme }) => theme.bg.secondary}; - } -` -export const OptionContainer = styled.div`` - -export const StyledMenu = styled.div` - padding: 10px 5px; - postion: absolute; -` diff --git a/packages/boba/gateway/src/components/seven/FastExit.js b/packages/boba/gateway/src/components/seven/FastExit.js deleted file mode 100644 index 459f6d3740..0000000000 --- a/packages/boba/gateway/src/components/seven/FastExit.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React from 'react' - -import { Typography } from 'components/global' - -import { ExitWrapper, Hash, HashContainer } from './styles' - -import networkService from 'services/networkService' - -function FastExit({ - blockNumber, - oriHash, - unixTime -}) { - - - const chainLink = ({ hash }) => { - if (networkService.networkConfig[ 'L2' ]) { - return `${networkService.networkConfig[ 'L2' ].transaction}${hash}` - } - return '' - } - - const secondsAgo = Math.round(Date.now() / 1000) - unixTime - let timeLabel = `Fast Exit was started ${secondsAgo} seconds ago` - - return ( - - {blockNumber} - - Hash:  - - {oriHash} - - - - {timeLabel} - - - ) - -} - -export default FastExit diff --git a/packages/boba/gateway/src/components/seven/Seven.js b/packages/boba/gateway/src/components/seven/Seven.js deleted file mode 100644 index 807876a46f..0000000000 --- a/packages/boba/gateway/src/components/seven/Seven.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React from 'react' - -import { Typography } from 'components/global' -import { Hash, ExitWrapper, HashContainer } from './styles' - -import networkService from 'services/networkService' -function Seven({ - blockNumber, - oriHash, - unixTime -}) { - - - const chainLink = ({ hash }) => { - if (networkService.networkConfig[ 'L2' ]) { - return `${networkService.networkConfig[ 'L2' ].transaction}${hash}` - } - return '' - } - - const secondsAgo = Math.round(Date.now() / 1000) - unixTime - const daysAgo = Math.floor(secondsAgo / (3600 * 24)) - const hoursAgo = Math.round((secondsAgo % (3600 * 24)) / 3600) - let timeLabel = `Exit was started ${daysAgo} days and ${hoursAgo} hours ago` - - const overdue = secondsAgo - (7 * 24 * 60 * 60) - - if (overdue > 0) { - if (hoursAgo <= 1) - timeLabel = `Funds will exit soon. The 7 day window just passed` - else if (hoursAgo <= 2) - timeLabel = `Funds will exit soon. The 7 day window recently passed` - else if (hoursAgo > 2) - timeLabel = `Funds will exit soon. The 7 day window passed ${hoursAgo} hours ago` - } - - return ( - - {blockNumber} - - - Hash:  - - {oriHash} - - - - {timeLabel} - - - ) - -} - -export default Seven diff --git a/packages/boba/gateway/src/components/seven/styles.ts b/packages/boba/gateway/src/components/seven/styles.ts deleted file mode 100644 index 032e4baae6..0000000000 --- a/packages/boba/gateway/src/components/seven/styles.ts +++ /dev/null @@ -1,57 +0,0 @@ -import styled, { css } from 'styled-components' -import { Typography } from 'components/global' - -export const ExitWrapper = styled.div` - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: flex-start; - gap: 5px; - background: ${(props) => props.theme.colors.popup}; - padding: 10px; - border-radius: 12px; - ${(props) => - props.theme.name === 'light' && - css` - border: solid 1px ${props.theme.colors.gray[400]}; - &:hover { - background: ${props.theme.colors.gray[300]}; - border: solid 1px ${props.theme.colors.gray[500]}; - } - `} - ${(props) => - props.theme.name === 'dark' && - css` - border: solid 1px ${props.theme.colors.gray[300]}; - &:hover { - background: ${props.theme.colors.gray[300]}; - } - `} -` - -export const HashContainer = styled(Typography)` - width: 20%; - ${(props) => - props.theme.name === 'light' && - css` - color: ${props.theme.colors.gray[700]}; - `} - ${(props) => - props.theme.name === 'dark' && - css` - color: ${props.theme.colors.gray[50]}; - `} -` - -export const Hash = styled.a` - ${(props) => - props.theme.name === 'light' && - css` - color: ${props.theme.colors.gray[700]}; - `} - ${(props) => - props.theme.name === 'dark' && - css` - color: ${props.theme.colors.gray[50]}; - `} -` diff --git a/packages/boba/gateway/src/components/stake/transactionList/index.tsx b/packages/boba/gateway/src/components/stake/transactionList/index.tsx deleted file mode 100644 index 2632f2dfbd..0000000000 --- a/packages/boba/gateway/src/components/stake/transactionList/index.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import React from 'react' -import dayjs from 'dayjs' -import duration from 'dayjs/plugin/duration' -import { formatDate } from 'util/dates' - -dayjs.extend(duration) - -import { useDispatch } from 'react-redux' -import { openAlert, openError } from 'actions/uiAction' -import { withdrawFS_Savings } from 'actions/fixedAction' - -import { Button } from 'components/global/button' -import { Typography } from 'components/global/typography' -import { ModalTypography } from 'components/global/modalTypography' - -import { TransactionListInterface } from './types' -import { StakeItemDetails, Token, Flex } from './styles' -import { getCoinImage } from 'util/coinImage' - -const TransactionList = ({ stakeInfo }: TransactionListInterface) => { - const dispatch = useDispatch() - - const timeDeposit_S = stakeInfo.depositTimestamp - const timeDeposit = formatDate(timeDeposit_S) - const timeNow_S = Math.round(Date.now() / 1000) - - const duration_S = timeNow_S - timeDeposit_S - - const twoWeeks = 14 * 24 * 60 * 60 - const twoDays = 2 * 24 * 60 * 60 - - const residual_S = duration_S % (twoWeeks + twoDays) - const timeZero_S = timeNow_S - residual_S - const unlocktimeNextBegin = formatDate(timeZero_S + twoWeeks) - const unlocktimeNextEnd = formatDate(timeZero_S + twoWeeks + twoDays) - - const secondsInADay = 24 * 60 * 60 - const duration_D = duration_S / secondsInADay - - let locked = true - if (residual_S > twoWeeks) { - locked = false - } - - const earned = stakeInfo.depositAmount * (0.05 / 365.0) * duration_D - - const handleUnstake = async () => { - const withdrawTX = await dispatch(withdrawFS_Savings(stakeInfo.stakeId)) - - if (withdrawTX !== null && withdrawTX !== undefined) { - openAlert('Your BOBA were unstaked') - } else { - openError('Failed to unstake BOBA') - } - } - - return ( - -
- - - {dayjs(timeDeposit).format('DD MMM YYYY hh:mm A')} - -
- -
- Amount Staked - - {stakeInfo.depositAmount - ? `${stakeInfo.depositAmount.toLocaleString(undefined, { - maximumFractionDigits: 2, - })}` - : `0`} - -
-
- Earned - {earned.toFixed(3)} -
-
- - Next unstake window:{' '} - - - {` ${dayjs(unlocktimeNextBegin).format('DD')}-${dayjs( - unlocktimeNextEnd - ).format('DD MMM YYYY hh:mm A')}`} - -
-
-
-
-
- ) -} - -export default TransactionList diff --git a/packages/boba/gateway/src/components/stake/transactionList/styles.ts b/packages/boba/gateway/src/components/stake/transactionList/styles.ts deleted file mode 100644 index 0575888b4c..0000000000 --- a/packages/boba/gateway/src/components/stake/transactionList/styles.ts +++ /dev/null @@ -1,69 +0,0 @@ -import styled, { css } from 'styled-components' -import { sdesktop, tablet, mobile } from 'themes/screens' -export const Wrapper = styled.div` - border-radius: 0; - background: ${(props) => props.theme.background.secondary}; -` - -export const Entry = styled.div` - padding: 20px; - display: flex; - justify-content: center; - align-items: center; - background: ${(props) => props.theme.background.secondary}; -` - -export const GridCoontainer = styled.div`` -export const GridItemTag = styled.div` - text-align: left; - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; -` - -export const StakeItemDetails = styled.div` - display: flex; - width: 100%; - justify-content: space-between; - align-items: center; - background: ${(props) => props.theme.colors.box.background}; - border: 1px solid ${(props) => props.theme.colors.box.border}; - box-sizing: border-box; - padding: 20px 35px; - border-radius: 8px; - - > div { - display: flex; - margin: 0px auto; - white-space: break-spaces; - align-items: center; - &:first-of-type { - margin-left: 0px; - width: 200px; - margin-right: 10px; - } - &:last-of-type { - margin-right: 0px; - margin-left: 15px; - } - } -` - -export const Flex = styled.div` - display: flex; - justify-content: space-between; - gap: 0px 10px; - - > div { - display: flex; - gap: 0px 5px; - white-space: initial; - } -` -export const Token = styled.img` - max-width: 32px; - width: 100%; - height: auto; - margin-right: 10px; -` diff --git a/packages/boba/gateway/src/components/stake/transactionList/types.ts b/packages/boba/gateway/src/components/stake/transactionList/types.ts deleted file mode 100644 index 1e297d6e4b..0000000000 --- a/packages/boba/gateway/src/components/stake/transactionList/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -type TransactionType = { - stakeId: number - depositTimestamp: number - depositAmount: number - isActive: boolean -} - -export interface TransactionListInterface { - stakeInfo: TransactionType -} diff --git a/packages/boba/gateway/src/components/tooltip/Tooltip.js b/packages/boba/gateway/src/components/tooltip/Tooltip.js deleted file mode 100644 index 63c97ac413..0000000000 --- a/packages/boba/gateway/src/components/tooltip/Tooltip.js +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react' -import { Tooltip as MuiTooltip } from '@mui/material' -import * as S from './Tooltip.styles'; - - - -function Tooltip({ title, arrow = true, children }) { - if (title) { - return ( - {title}} - arrow={arrow} - > - {children} - - ) - } else { - return children - } -} - -export default React.memo(Tooltip) diff --git a/packages/boba/gateway/src/components/tooltip/Tooltip.styles.js b/packages/boba/gateway/src/components/tooltip/Tooltip.styles.js deleted file mode 100644 index 973b6101c7..0000000000 --- a/packages/boba/gateway/src/components/tooltip/Tooltip.styles.js +++ /dev/null @@ -1,7 +0,0 @@ -import styled from 'styled-components'; - -export const Title = styled('div')` - padding: '16px'; - fontSize: '14px'; - borderRadius: '12px'; -` diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeAlert/index.styles.ts b/packages/boba/gateway/src/containers/Bridging/BridgeAlert/index.styles.ts deleted file mode 100644 index dded4467ca..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeAlert/index.styles.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Typography } from 'components/global' -import styled, { css } from 'styled-components' - -import ErrorOutline from '@mui/icons-material/ErrorOutline' -import InfoOutlined from '@mui/icons-material/InfoOutlined' -import ReportProblemOutlined from '@mui/icons-material/ReportProblemOutlined' - -type AlertType = 'warning' | 'error' | 'info' - -export const AlertContainer = styled.div<{ type?: AlertType }>` - width: 100%; - display: flex; - padding: 12px 16px; - justify-content: flex-start; - align-items: center; - gap: 16px; - border-radius: 8px; - ${({ type, theme: { name, colors } }) => - type === 'warning' - ? css` - border: 1px solid - ${name === 'light' ? colors.yellow[100] : colors.yellow[200]}; - background: ${name === 'light' - ? colors.yellow[50] - : colors.yellow[500]}; - color: ${name === 'light' ? colors.yellow[500] : colors.yellow[200]}; - ` - : ''} - - ${({ type, theme: { name, colors } }) => - type === 'error' - ? css` - border: 1px solid - ${name === 'light' ? colors.red[100] : colors.red[300]}; - background: ${name === 'light' ? colors.red[50] : colors.red[500]}; - color: ${name === 'light' ? colors.red[500] : colors.gray[100]}; - ` - : ''} - ${({ type, theme: { name, colors } }) => - type === 'info' - ? css` - border: 1px solid - ${name === 'light' ? colors.blue[200] : colors.blue[100]}; - background: ${name === 'light' ? colors.blue[50] : colors.blue[500]}; - color: ${name === 'light' ? colors.blue[500] : colors.blue[100]}; - ` - : ''} -` - -export const ErrorIcon = styled(ErrorOutline)` - color: ${({ theme: { colors } }) => colors.red[300]}; -` -export const InfoIcon = styled(InfoOutlined)` - color: ${({ theme: { colors } }) => colors.blue[100]}; -` -export const WarningIcon = styled(ReportProblemOutlined)` - color: ${({ theme: { colors } }) => colors.yellow[200]}; -` - -export const AlertText = styled(Typography).attrs({ - variant: 'body3', -})`` diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeAlert/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeAlert/index.tsx deleted file mode 100644 index 8746549153..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeAlert/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React, { FC } from 'react' - -import { useSelector } from 'react-redux' -import { selectBridgeAlerts } from 'selectors' -import { - AlertContainer, - ErrorIcon, - AlertText, - WarningIcon, - InfoIcon, -} from './index.styles' - -const BridgeAlert: FC = () => { - const alerts = useSelector(selectBridgeAlerts()) - - if (!alerts.length) { - return null - } - - return ( - <> - {alerts && - alerts.map((alert: any) => { - return ( - - {alert.type === 'error' && } - {alert.type === 'warning' && } - {alert.type === 'info' && } - {alert.text} - - ) - })} - - ) -} - -export default BridgeAlert diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeHeader/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeHeader/index.tsx deleted file mode 100644 index bc9d8a4cef..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeHeader/index.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import HelpOutlineOutlined from '@mui/icons-material/HelpOutlineOutlined' -import { openModal } from 'actions/uiAction' -import { Heading, Typography } from 'components/global' -import Tooltip from 'components/tooltip/Tooltip' -import React from 'react' -import { useDispatch } from 'react-redux' -import styled, { useTheme } from 'styled-components' -import { BridgeHeaderWrapper, GearIcon, IconWrapper } from './styles' - -type Props = {} - -export const LabelStyle = styled.span` - color: var(--Gray-50, #eee); - font-family: Roboto; - font-size: 12px; - font-style: normal; - font-weight: 500; - line-height: 138.3%; -` - -export const ValueStyle = styled.span` - color: var(--Gray-50, #eee); - font-family: Roboto; - font-size: 12px; - font-style: normal; - font-weight: 400; - line-height: 138.3%; -` - -const BridgeHeader = (props: Props) => { - const dispatch = useDispatch() - const theme: any = useTheme() - - const iconColor = - theme.name === 'light' ? theme.colors.gray[600] : theme.colors.gray[100] - - const openSettingModal = () => { - dispatch(openModal('settingsModal')) - } - - return ( - - - Bridge - - Classic Bridge
- - Although this option is always available, it takes 7 days to - receive your funds when withdrawing from L2 to L1. - -
-
- Fast Bridge -
- - A swap-based bridge to Boba L2. This option is only available if - the pool balance is sufficient. - - - } - > - - - -
-
- - - -
- ) -} - -export default BridgeHeader diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeHeader/styles.ts b/packages/boba/gateway/src/containers/Bridging/BridgeHeader/styles.ts deleted file mode 100644 index 43f230717d..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeHeader/styles.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { SettingsOutlined } from '@mui/icons-material' -import styled from 'styled-components' - -export const BridgeHeaderWrapper = styled.div` - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; -` -export const IconWrapper = styled.div<{ inline?: boolean }>` - padding: 8px; - height: 32px; - width: 32px; - border-radius: 50%; - cursor: pointer; - display: ${({ inline }) => (inline ? 'inline-flex' : 'flex')}; - justify-content: center; - align-items: center; - &:hover { - background: ${({ theme: { name, colors } }) => - name === 'light' ? colors.gray[400] : colors.gray[300]}; - } -` - -export const GearIcon = styled(SettingsOutlined)` - cursor: pointer; -` diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/BridgeToAddress/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeInput/BridgeToAddress/index.tsx deleted file mode 100644 index cd6a782317..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/BridgeToAddress/index.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React, { FC, memo, useEffect, useState } from 'react' -import { useSelector } from 'react-redux' -import { - selectBridgeToAddressState, - selectBridgeType, - selectLayer, -} from 'selectors' -import { ReceiveContainer } from '../styles' -import { Label } from '../../styles' -import InputWithButton from 'components/global/inputWithButton' -import { BRIDGE_TYPE } from 'containers/Bridging/BridgeTypeSelector' -import { LAYER } from 'util/constant' - -type Props = {} - -const BridgeToAddress: FC = ({}) => { - const bridgeToAddressEnable = useSelector(selectBridgeToAddressState()) - const layer = useSelector(selectLayer()) - const bridgeType = useSelector(selectBridgeType()) - - const [toAddress, setToAddress] = useState('') - const [isAvailable, setIsAvailable] = useState(true) - - const onAddressChange = (e: any) => { - const text = e.target.value - setToAddress(text) - } - - const onPaste = async () => { - try { - const text = await navigator.clipboard.readText() - if (text) { - setToAddress(text) - } - } catch (err) { - // navigator clipboard api not supported in client browser - } - } - - useEffect(() => { - if (layer !== LAYER.L1 || bridgeType !== BRIDGE_TYPE.CLASSIC) { - setIsAvailable(false) - } else { - setIsAvailable(true) - } - }, [layer, bridgeType]) - - if (!bridgeToAddressEnable || !isAvailable) { - return null - } - - return ( - - - - - ) -} - -export default memo(BridgeToAddress) diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/EmergencySwap/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeInput/EmergencySwap/index.tsx deleted file mode 100644 index b21206258a..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/EmergencySwap/index.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import React, { FC, useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { - selectAccountEnabled, - selectActiveNetwork, - selectLayer, - selectlayer2Balance, -} from 'selectors' -import networkService from 'services/networkService' - -import { getETHMetaTransaction } from 'actions/setupAction' -import { openAlert } from 'actions/uiAction' -import BN from 'bignumber.js' -import { isEqual } from 'util/lodash' -import { logAmount } from 'util/amountConvert' -import { LAYER } from 'util/constant' -import { NETWORK } from 'util/network/network.util' -import { SwapAction, SwapAlert, SwapContainer } from './styles' - -interface Props {} - -const EmergencySwap: FC = (props) => { - const network = useSelector(selectActiveNetwork()) - const accountEnabled = useSelector(selectAccountEnabled()) - const l2Balances = useSelector(selectlayer2Balance, isEqual) - const layer = useSelector(selectLayer()) - const [tooSmallSec, setTooSmallSec] = useState(false) - const dispatch = useDispatch() - - useEffect(() => { - if (accountEnabled && l2Balances.length > 0) { - const l2BalanceSec = l2Balances.find( - (i: any) => i.symbol === networkService.L1NativeTokenSymbol - ) - - if (l2BalanceSec && l2BalanceSec.balance) { - // FOR ETH MIN BALANCE 0.003ETH for other secondary tokens 1 - const minBalance = network === NETWORK.ETHEREUM ? 0.003 : 1 - setTooSmallSec( - new BN(logAmount(l2BalanceSec.balance, 18)).lt(new BN(minBalance)) - ) - } else { - // in case of zero ETH balance we are setting tooSmallSec - setTooSmallSec(true) - } - } - }, [l2Balances, accountEnabled, network]) - - const emergencySwap = async () => { - const res = await dispatch(getETHMetaTransaction()) - if (res) { - dispatch(openAlert('Emergency Swap submitted')) - } - } - - const alertContent = () => { - if (NETWORK.ETHEREUM === network) { - return `Using BOBA requires a minimum ETH balance (of 0.002 ETH) regardless of your fee setting, - otherwise MetaMask may incorrectly reject transactions. If you ran out of ETH, use EMERGENCY SWAP to swap BOBA - for 0.005 ETH at market rates.` - } else { - return `Using ${networkService.L1NativeTokenSymbol} requires a minimum BOBA - balance (of 1 BOBA) regardless of your fee setting, otherwise - MetaMask may incorrectly reject transactions. If you ran out of - BOBA, use EMERGENCY SWAP to swap ${networkService.L1NativeTokenSymbol} for 1 BOBA at market rates.` - } - } - - if (layer === LAYER.L2 && tooSmallSec) { - return ( - - {alertContent()} - { - emergencySwap() - }} - label="Emergency Swap" - /> - - ) - } else { - return null - } -} - -export default EmergencySwap diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/EmergencySwap/styles.ts b/packages/boba/gateway/src/containers/Bridging/BridgeInput/EmergencySwap/styles.ts deleted file mode 100644 index c09d41d002..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/EmergencySwap/styles.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Button, Typography } from 'components/global' -import styled from 'styled-components' - -export const SwapContainer = styled.div` - display: flex; - flex-direction: column; - justify-content: space-between; - padding: 10px; - gap: 8px; - border-radius: 8px; - border: 1px solid - ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[600] : colors.green[300]}; - background: ${({ theme: { name } }) => - name === 'light' ? 'transparant' : 'rgba(238, 238, 238, 0.05)'}; -` -export const SwapAlert = styled(Typography).attrs({ - variant: 'body3', -})` - font-weight: 400; - line-height: normal; - color: ${({ theme, color }) => - color - ? color - : theme.name === 'light' - ? theme.colors.gray[700] - : theme.colors.gray[100]}; -` -export const SwapAction = styled(Button)` - padding: 10px; - display: flex; - flex-direction: column; - align-item: center; - justify-content: center; -` diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/Fee/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeInput/Fee/index.tsx deleted file mode 100644 index f939dab2cf..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/Fee/index.tsx +++ /dev/null @@ -1,145 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { BridgeInfoContainer, InfoRow } from '../styles' -import { Label } from '../../styles' -import { - selectBobaFeeChoice, - selectBobaPriceRatio, - selectBridgeType, - selectClassicExitCost, - selectExitFee, - selectFastDepositCost, - selectFastExitCost, - selectL1FeeRateN, - selectL2FeeRateN, - selectLayer, -} from 'selectors' -import { useSelector } from 'react-redux' -import { LAYER } from 'util/constant' -import { BRIDGE_TYPE } from 'containers/Bridging/BridgeTypeSelector' -import useAmountToReceive from 'hooks/useAmountToReceive' -import networkService from 'services/networkService' -import { useTheme } from 'styled-components' - -interface Props {} - -const Fee = (props: Props) => { - const bridgeType = useSelector(selectBridgeType()) - const layer = useSelector(selectLayer()) - const l2FeeRateN = useSelector(selectL2FeeRateN) - const theme: any = useTheme() - const depositFee = useSelector(selectFastDepositCost) - - // required on L2 layer - const l1FeeRateN = useSelector(selectL1FeeRateN) - const classicExitCost = useSelector(selectClassicExitCost) - const fastExitCost = useSelector(selectFastExitCost) - const feeUseBoba = useSelector(selectBobaFeeChoice()) - const feePriceRatio = useSelector(selectBobaPriceRatio()) - const exitFee = useSelector(selectExitFee) - - const { amount: amountToReceive } = useAmountToReceive() - - const [gasFee, setGasFee] = useState('') - - const estimateTime = () => { - if (bridgeType === BRIDGE_TYPE.CLASSIC) { - if (layer === LAYER.L1) { - return '13 ~ 14mins.' - } else { - return '7 days' - } - } else if (bridgeType === BRIDGE_TYPE.FAST) { - if (layer === LAYER.L1) { - return '1 ~ 5min.' - } else { - return '15min ~ 3hrs.' - } - } else { - // Teleportation, instant - return '~1min.' - } - } - - useEffect(() => { - if (layer === LAYER.L1) { - if (bridgeType === BRIDGE_TYPE.FAST) { - setGasFee(`${Number(depositFee)?.toFixed(4)}ETH`) - } else { - setGasFee(`0 ETH`) - } - } else { - //TODO: add check for safecost to avoid issues. debug why gas estimation wrong - let cost = classicExitCost || 0 - if (bridgeType === BRIDGE_TYPE.FAST) { - cost = fastExitCost || 0 - } - - const safeCost = Number(cost) * 1.04 // 1.04 == safety margin on cost - if (feeUseBoba) { - setGasFee(`${Number(safeCost * feePriceRatio).toFixed(4)} BOBA`) - } else { - setGasFee( - `${Number(safeCost).toFixed(4)} ${networkService.L1NativeTokenSymbol}` - ) - } - } - }, [ - layer, - bridgeType, - depositFee, - classicExitCost, - fastExitCost, - feeUseBoba, - feePriceRatio, - ]) - - return ( - - - - - - - - - - {layer === LAYER.L2 && bridgeType !== BRIDGE_TYPE.TELEPORTATION ? ( - - - - - ) : null} - - - - - - - - - - ) -} - -export default Fee diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/TokenInput/index.styles.ts b/packages/boba/gateway/src/containers/Bridging/BridgeInput/TokenInput/index.styles.ts deleted file mode 100644 index caadef9873..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/TokenInput/index.styles.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Typography } from 'components/global' -import styled, { css } from 'styled-components' -import { mobile } from 'themes/screens' - -export const InputContainer = styled.div` - display: flex; - flex-direction: column; - gap: 8px; - align-items: flex-end; - width: calc(75% - 24px); - max-width: calc(75% - 24px); - ${mobile(css` - width: calc(60% - 24px); - max-width: calc(60% - 24px); - `)} -` -export const InputContainerLabel = styled(Typography).attrs({ - variant: 'body3', -})` - color: ${({ theme, error }) => - error ? theme.colors.red[300] : theme.colors.color}; - align-self: flex-end; - font-weight: 400; -` diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/TokenInput/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeInput/TokenInput/index.tsx deleted file mode 100644 index 0747fac312..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/TokenInput/index.tsx +++ /dev/null @@ -1,124 +0,0 @@ -import InputWithButton from 'components/global/inputWithButton' -import React, { useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { - selectBobaFeeChoice, - selectBobaPriceRatio, - selectBridgeType, - selectClassicExitCost, - selectExitFee, - selectFastExitCost, - selectLayer, - selectTokenToBridge, -} from 'selectors' -import { logAmount } from 'util/amountConvert' -import { LAYER } from 'util/constant' -import { InputContainer, InputContainerLabel } from './index.styles' - -import { purgeBridgeAlert, setAmountToBridge } from 'actions/bridgeAction' -import { BRIDGE_TYPE } from 'containers/Bridging/BridgeTypeSelector' -import networkService from 'services/networkService' - -interface Props {} - -const TokenInput = (props: Props) => { - const dispatch = useDispatch() - const layer = useSelector(selectLayer()) - const token = useSelector(selectTokenToBridge()) - const bridgeType = useSelector(selectBridgeType()) - const classicExitCost = useSelector(selectClassicExitCost) - const fastExitCost = useSelector(selectFastExitCost) - const feeUseBoba = useSelector(selectBobaFeeChoice()) - const feePriceRatio = useSelector(selectBobaPriceRatio()) - const exitFee = useSelector(selectExitFee) - - const [tokenAmount, setTokenAmount] = useState('') - const [maxBalance, setMaxBalance] = useState() - const [zeroBalanceError, setZeroBalanceError] = useState(false) - - useEffect(() => { - // on changing token reset token amount. - setTokenAmount('') - dispatch(setAmountToBridge('')) - - if (!token) { - return - } - - const balance = Number(logAmount(token.balance, token.decimals)) - - if (balance === 0) { - setZeroBalanceError(true) - dispatch(purgeBridgeAlert()) - } else { - setZeroBalanceError(false) - } - - if (layer === LAYER.L2 && bridgeType !== BRIDGE_TYPE.TELEPORTATION) { - let cost = classicExitCost || 0 - if (bridgeType === BRIDGE_TYPE.FAST) { - cost = fastExitCost || 0 - } - - const safeCost = Number(cost) * 1.04 // 1.04 == safety margin on cost - if (token.symbol === networkService.L1NativeTokenSymbol) { - if (balance - safeCost > 0.0) { - setMaxBalance(balance - safeCost) - } else { - setMaxBalance(0.0) - } - } else if (token.symbol === 'BOBA') { - if (feeUseBoba) { - if (balance - safeCost * feePriceRatio - exitFee > 0.0) { - setMaxBalance(balance - safeCost * feePriceRatio - exitFee) - } else { - setMaxBalance(0.0) - } - } else { - if (balance - exitFee > 0.0) { - setMaxBalance(balance - exitFee) - } else { - setMaxBalance(0.0) - } - } - } else { - setMaxBalance(balance) - } - } else { - setMaxBalance(balance) - } - }, [token, layer, classicExitCost, feeUseBoba, feePriceRatio, exitFee]) - - const onSetMaxAmount = (maxValue: any) => { - setTokenAmount(maxValue) - dispatch(setAmountToBridge(maxValue)) - } - - const onAmountChange = (value: string) => { - setTokenAmount(value) - dispatch(setAmountToBridge(value)) - } - - return ( - - - Balance: {maxBalance} {token ? token.symbol : ''} - - onSetMaxAmount(maxBalance)} - onChange={(e: React.ChangeEvent) => { - onAmountChange(e.target.value) - }} - /> - - ) -} - -export default TokenInput diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeInput/index.tsx deleted file mode 100644 index 5b3fffda1c..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/index.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import React, { FC, useEffect } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { openModal } from 'actions/uiAction' -import { selectAccountEnabled, selectTokenToBridge } from 'selectors' - -import useBridgeSetup from 'hooks/useBridgeSetup' -import { getCoinImage } from 'util/coinImage' - -import useAmountToReceive from 'hooks/useAmountToReceive' -import BridgeToAddress from './BridgeToAddress' -import Fee from './Fee' -import TokenInput from './TokenInput' -import { - BridgeInputContainer, - BridgeInputWrapper, - DownArrow, - ReceiveAmount, - ReceiveContainer, - TokenLabel, - TokenPickerIcon, - TokenSelector, - TokenSelectorInput, - TokenSymbol, -} from './styles' -import { SectionLabel } from '../chain/styles' -import bobaLogo from 'assets/images/Boba_Logo_White_Circle.png' -import EmergencySwap from './EmergencySwap' - -type Props = {} - -const BridgeInput: FC = (props) => { - const dispatch = useDispatch() - const isAccountEnabled = useSelector(selectAccountEnabled()) - const token = useSelector(selectTokenToBridge()) - const { amount: receivableAmount } = useAmountToReceive() - useBridgeSetup() - - const openTokenPicker = () => { - dispatch(openModal('tokenPicker')) - } - - if (!isAccountEnabled) { - return null - } - - return ( - - - - Token - openTokenPicker()}> - {token && ( - - {`ETH - - )} - {token ? token?.symbol : 'Select'} - - - - - - - - {token && ( - - Receive - {receivableAmount} - - )} - - {token && } - - - ) -} - -export default BridgeInput diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeInput/styles.ts b/packages/boba/gateway/src/containers/Bridging/BridgeInput/styles.ts deleted file mode 100644 index 084b22473f..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeInput/styles.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { Svg, Typography } from 'components/global' -import styled, { css } from 'styled-components' -import ArrowDown from 'assets/images/icons/arrowdown.svg' -import { mobile } from 'themes/screens' - -export const BridgeInputContainer = styled.div` - display: flex; - flex-direction: column; - gap: 20px; - width: 100%; -` -export const BridgeInputWrapper = styled.div` - display: flex; - justify-content: space-between; - gap: 20px; - width: 100%; -` -export const TokenSelector = styled.div` - display: flex; - flex-direction: column; - gap: 8px; - align-items: flex-start; - min-width: 25%; - ${mobile(css` - min-width: 40%; - `)} -` - -export const TokenSelectorInput = styled.div` - cursor: pointer; - display: flex; - flex: 1; - width: 100%; - min-height: 56px; - padding: 8px 16px; - align-items: center; - gap: 8px; - border-radius: 12px; - border: 1px solid ${({ theme: { colors } }) => colors.box.border}; - background: ${({ theme: { colors } }) => colors.box.background}; - - ${mobile(css` - padding: 8px; - `)} -` - -export const ReceiveContainer = styled.div` - display: flex; - flex-direction: column; - gap: 8px; -` -export const DestinationAddressContainer = styled.div`` - -export const BridgeInfoContainer = styled.div` - width: 100%; - display: flex; - flex-direction: column; - padding: 16px; - justify-content: center; - align-items: center; - gap: 8px; - border-radius: 8px; - border: 1px solid - ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[600] : colors.green[300]}; - background: ${({ theme: { name } }) => - name === 'light' ? 'transparant' : 'rgba(238, 238, 238, 0.05)'}; - - /* Green Hilight */ - box-shadow: ${({ theme }) => - theme.name === 'light' - ? 'none' - : '0px 4px 10px 0px rgba(186, 226, 26, 0.1);'}; -` - -export const InfoRow = styled.div` - display: flex; - justify-content: space-between; - width: 100%; -` - -export const TokenSymbol = styled.div` - display: flex; -` -export const TokenLabel = styled(Typography).attrs({ - variant: 'body1', -})` - flex: 1; - color: ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[600] : colors.color}; -` - -export const TokenPickerIcon = styled.div` - justify-self: flex-end; -` -export const DownArrow = styled(Svg).attrs(({ theme }) => ({ - src: ArrowDown, - fill: `${ - theme.name === 'light' ? theme.colors.gray[600] : theme.colors.gray[100] - }`, -}))` - div { - display: flex; - } -` - -export const ReceiveAmount = styled(Typography).attrs({ - variant: 'title', -})` - padding: 16px; - border-radius: 12px; - border: 1px solid - ${({ theme }) => - theme.name === 'light' ? theme.colors.gray[500] : theme.colors.gray[300]}; - color: ${({ theme }) => - theme.name === 'light' ? theme.colors.gray[800] : theme.colors.gray[50]}; -` diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeTypeSelector/index.tsx b/packages/boba/gateway/src/containers/Bridging/BridgeTypeSelector/index.tsx deleted file mode 100644 index af05e43267..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeTypeSelector/index.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React from 'react' -import { BridgeTabs, BridgeTabItem } from './style' -import { useDispatch, useSelector } from 'react-redux' -import { - selectActiveNetworkType, - selectBridgeType, - selectNetworkType, -} from 'selectors' -import { setBridgeType } from 'actions/bridgeAction' -import { NETWORK_TYPE } from '../../../util/network/network.util' - -export enum BRIDGE_TYPE { - CLASSIC = 'CLASSIC', - FAST = 'FAST', - TELEPORTATION = 'TELEPORTATION', -} -const BridgeTypeSelector = () => { - const dispatch = useDispatch() - const bridgeType = useSelector(selectBridgeType()) - - // Only show teleportation on testnet for now - const isTestnet = - useSelector(selectActiveNetworkType()) === NETWORK_TYPE.TESTNET - - const onTabClick = (payload: any) => { - dispatch(setBridgeType(payload)) - } - - return ( - - onTabClick(BRIDGE_TYPE.CLASSIC)} - > - Classic - - onTabClick(BRIDGE_TYPE.FAST)} - > - Fast - - - {isTestnet ? ( - onTabClick(BRIDGE_TYPE.TELEPORTATION)} - > - Now - - ) : null} - - ) -} - -export default BridgeTypeSelector diff --git a/packages/boba/gateway/src/containers/Bridging/BridgeTypeSelector/style.ts b/packages/boba/gateway/src/containers/Bridging/BridgeTypeSelector/style.ts deleted file mode 100644 index b5db22b084..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/BridgeTypeSelector/style.ts +++ /dev/null @@ -1,46 +0,0 @@ -import styled, { css } from 'styled-components' - -export const BridgeTabs = styled.div` - display: flex; - justify-content: space-between; - border: 1px solid - ${({ theme: { name, colors } }) => - name === 'light' ? colors.gray[400] : 'transparent'}; - background: ${({ theme: { name, colors } }) => - name === 'light' ? colors.gray[100] : colors.gray[500]}; - border-radius: 8px; - padding: 5px; - width: 100%; -` -export const BridgeTabItem = styled.div<{ - active?: boolean -}>` - width: 100%; - padding: 8px 50px; - text-align: center; - font-family: Montserrat; - font-style: normal; - font-weight: 700; - line-height: normal; - font-size: ${(props) => props.theme.text.body1}; - cursor: pointer; - background: transparent; - color: ${(props) => - props.theme.name === 'light' ? props.theme.colors.gray[600] : 'inherit'}; - box-shadow: 'none'; - ${(props) => - props.active && - css` - color: ${props.theme.name === 'light' - ? props.theme.colors.gray[800] - : props.theme.colors.gray[600]}; - background: ${props.theme.colors.green[300]}; - `}; - - &:nth-child(1) { - border-radius: 8px 0 0 8px; - } - &:nth-child(3) { - border-radius: 0 8px 8px 0; - } -` diff --git a/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/data.ts b/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/data.ts deleted file mode 100644 index 43f32caf60..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/data.ts +++ /dev/null @@ -1,63 +0,0 @@ -import AnyswapLogo from 'assets/images/bridges/logo/anyswap-logo-250.png' -import BoringdaoLogo from 'assets/images/bridges/logo/Boringdao-logo-250.png' -import CelerLogo from 'assets/images/bridges/logo/celer-logo-250.png' -import PolybridgeLogo from 'assets/images/bridges/logo/polybridge-logo-250.png' -import SymbiosisLogo from 'assets/images/bridges/logo/symbiosis-logo-250.png' -import SynapseLogo from 'assets/images/bridges/logo/synapse-logo-250.png' - -export interface IBridges { - name: string - icon: any - type: string - link: string - tokens: string[] -} - -export const bobaBridges: IBridges[] = [ - { - name: 'Synapse', - icon: SynapseLogo, - type: 'SYNAPSE', - link: 'https://synapseprotocol.com/', - tokens: ['ETH', 'nETH', 'gOHM', 'DAI', 'USDC', 'USDT', 'SYN', 'nUSD'], - }, - { - name: 'Anyswap', - icon: AnyswapLogo, - type: 'ANYSWAP', - link: 'https://anyswap.exchange/#/router', - tokens: ['MIM', 'AVAX', 'FRAX', 'FTM', 'FXS', 'MATIC'], - }, - { - name: 'Celer', - icon: CelerLogo, - type: 'CELER', - link: 'https://cbridge.celer.network/#/transfer', - tokens: ['ETH', 'BOBA', 'FRAX', 'OLO'], - }, - { - name: 'BoringDAO', - icon: BoringdaoLogo, - type: 'BORINGDAO', - link: 'https://oportal.boringdao.com/twoway', - tokens: ['USDT'], - }, - { - name: 'PolyBridge', - icon: PolybridgeLogo, - type: 'POLYBRIDGE', - link: 'https://bridge.poly.network/', - tokens: ['BOBA'], - }, - { - name: 'Symbiosis', - icon: SymbiosisLogo, - type: 'SYMBIOSIS', - link: 'https://app.symbiosis.finance/swap', - tokens: ['USDC'], - }, -] - -export const bridgeByToken = (symbol: string) => { - return bobaBridges.filter((bridge) => bridge.tokens.includes(symbol)) -} diff --git a/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/index.tsx b/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/index.tsx deleted file mode 100644 index 173db1cc6d..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/index.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { Heading } from 'components/global' -import React, { FC, useEffect, useState } from 'react' -import { BridgeItem, BridgeIcon, BridgeLabel, BridgeWrapper } from '../styles' -import { useSelector } from 'react-redux' -import Banxa from 'assets/images/bridges/banxa.svg' -import { - selectActiveNetwork, - selectActiveNetworkType, - selectTokenToBridge, - selectWalletAddress, -} from 'selectors' -import { NETWORK_TYPE, NETWORK } from 'util/network/network.util' -import { prepareBanxaUrl } from 'util/banxa' -import { IBridges, bridgeByToken } from './data' - -const ThirdPartyBridges: FC = () => { - const token = useSelector(selectTokenToBridge()) - const networkType = useSelector(selectActiveNetworkType()) - const network = useSelector(selectActiveNetwork()) - const [bridges, setbridges] = useState>([]) - const userWallet = useSelector(selectWalletAddress()) - const [banxaUrl, setBanxaUrl] = useState('') - const [isBanxaEnable, setIsBanxaEnable] = useState(false) - - useEffect(() => { - if (token) { - const _bridges = bridgeByToken(token?.symbol) - setbridges(_bridges) - - if (token?.symbol === 'ETH' || token?.symbol === 'BOBA') { - const _banxaUrl = prepareBanxaUrl({ - symbol: token.symbol, - address: userWallet, - }) - setBanxaUrl(_banxaUrl) - setIsBanxaEnable(true) - } - } - }, [token, userWallet]) - - if ( - !token || - networkType === NETWORK_TYPE.TESTNET || - network !== NETWORK.ETHEREUM || - (!isBanxaEnable && !bridges.length) - ) { - return <> - } - - return ( - - Third party bridges - {network === NETWORK.ETHEREUM && isBanxaEnable && ( - - - {`ETH - - Banxa - - )} - {bridges.map((bridge: IBridges) => ( - - - {`${bridge.name} - - {bridge.name} - - ))} - - ) -} - -export default ThirdPartyBridges diff --git a/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/types.ts b/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/types.ts deleted file mode 100644 index d3d79658d5..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/ThirdPartyBridges/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface AvailableBridgesProps { - token?: any | null // FIXME: fix the type of token - walletAddress: string -} diff --git a/packages/boba/gateway/src/containers/Bridging/chain/constant.ts b/packages/boba/gateway/src/containers/Bridging/chain/constant.ts deleted file mode 100644 index 6c36c2df49..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/chain/constant.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ElementType } from 'react' - -import AvalancheIcon from 'components/icons/chain/L1/AvalancheIcon' -import BNBIcon from 'components/icons/chain/L1/BNBIcon' -import EthereumIcon from 'components/icons/chain/L1/EthereumIcon' - -import BobaAvaxIcon from 'components/icons/chain/L2/BobaAvaxIcon' -import BobaBNBIcon from 'components/icons/chain/L2/BobaBNBIcon' -import BobaIcon from 'components/icons/chain/L2/BobaIcon' - -type IconType = { - L1: ElementType - L2: ElementType -} - -type NetworkIconsType = Record - -export const NETWORK_ICONS: NetworkIconsType = { - ethereum: { - L1: EthereumIcon, - L2: BobaIcon, - }, - bnb: { - L1: BNBIcon, - L2: BobaBNBIcon, - }, - avax: { - L1: AvalancheIcon, - L2: BobaAvaxIcon, - }, -} diff --git a/packages/boba/gateway/src/containers/Bridging/chain/index.styles.ts b/packages/boba/gateway/src/containers/Bridging/chain/index.styles.ts deleted file mode 100644 index 9489b02b10..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/chain/index.styles.ts +++ /dev/null @@ -1,3 +0,0 @@ -import styled from 'styled-components' - -export const ChainContainer = styled.div`` diff --git a/packages/boba/gateway/src/containers/Bridging/chain/index.tsx b/packages/boba/gateway/src/containers/Bridging/chain/index.tsx deleted file mode 100644 index 5c66a3a502..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/chain/index.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { - selectActiveNetworkIcon, - selectActiveNetworkName, - selectLayer, -} from 'selectors' -import { openModal } from 'actions/uiAction' -import useSwitchChain from 'hooks/useSwitchChain' -import { DEFAULT_NETWORK, LAYER } from 'util/constant' -import { NETWORK_ICONS } from './constant' -import { - ChainContainer, - ChainIcon, - ChainPicker, - ChainPickerContainer, - ChainPickerIcon, - ChainPickerPlaceHolder, - DownArrow, - SectionLabel, - SwitchChainIcon, - SwitchIcon, -} from './styles' - -type Props = {} - -const Chains = (props: Props) => { - const dispatch = useDispatch() - - const { switchChain } = useSwitchChain() - - const networkNames = useSelector(selectActiveNetworkName()) - const activeNetworkIcon = useSelector(selectActiveNetworkIcon()) - const layer = useSelector(selectLayer()) - const icons = NETWORK_ICONS[activeNetworkIcon] - const L1Icon = icons['L1'] - const L2Icon = icons['L2'] - - const openNetworkPicker = ( - inputLayer: string, - destNetworkSelection: boolean - ) => { - let sLayer = inputLayer - if (layer && layer === LAYER.L2) { - sLayer = inputLayer === 'l1' ? 'l2' : 'l1' - } - dispatch( - openModal( - 'networkPicker', - null, - null, - null, - null, - null, - sLayer, - destNetworkSelection - ) - ) - } - - const L1ChainInfo = () => { - return ( - <> - - - - - {networkNames['l1'] || DEFAULT_NETWORK.NAME.L1} - - - ) - } - - const L2ChainInfo = () => { - return ( - <> - - - - - {networkNames['l2'] || DEFAULT_NETWORK.NAME.L2} - - - ) - } - - return ( - - - From - openNetworkPicker('l1', false)}> - {!layer || layer === LAYER.L1 ? : } - - - - - - switchChain()}> - - - - To - openNetworkPicker('l2', true)}> - {!layer || layer === LAYER.L1 ? : } - - - - - - - ) -} - -export default Chains diff --git a/packages/boba/gateway/src/containers/Bridging/chain/styles.ts b/packages/boba/gateway/src/containers/Bridging/chain/styles.ts deleted file mode 100644 index 7ee9c09275..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/chain/styles.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { Svg, Typography } from 'components/global' -import styled from 'styled-components' - -import ArrowDown from 'assets/images/icons/arrowdown.svg' -import Switch from 'assets/images/icons/switchIcon.svg' - -export const ChainContainer = styled.div` - display: flex; - flex-direction: column; - gap: 60px; - width: 100%; - position: relative; - - div: nth-of-type(3) { - margin-top: -25px; - } -` - -export const ChainPickerContainer = styled.div` - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 14px; - width: 100%; -` - -export const ChainPickerLabel = styled(Typography).attrs({ - variant: 'body2', -})` - color: ${(props) => props.theme.colors.gray[100]}; - flex: 1; -` - -export const ChainPicker = styled.div` - cursor: pointer; - display: flex; - padding: 12px 16px; - justify-content: flex-start; - align-items: center; - gap: 16px; - border-radius: 14px; - width: 100%; - border: 1px solid - ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[400] : colors.gray[300]}; - background: ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[100] : colors.gray[500]}; -` - -export const ChainIcon = styled.div` - display: flex; - width: 30px; - height: 30px; -` -export const ChainPickerPlaceHolder = styled(Typography).attrs({ - variant: 'body1', -})` - flex: 1; -` - -export const ChainPickerIcon = styled.div` - justify-self: flex-end; -` -export const DownArrow = styled(Svg).attrs({ - src: ArrowDown, - fill: 'current', -})` - fill: ${({ theme }: { theme: any }) => - theme.name === 'light' ? theme.colors.gray[600] : '#fff'}; -` - -export const SwitchChainIcon = styled.div` - cursor: pointer; - margin: -12px auto; - width: 40px; - height: 40px; - padding: 8px; - display: flex; - align-items: center; - justify-content: center; - border-radius: 20px; - border: 1px solid ${(props) => props.theme.colors.box.border}; - background: ${({ theme: { colors } }) => colors.box.background}; - position: absolute; - top: 110px; - left: calc(50% - 20px); - - &:hover { - border-color: ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[600] : colors.green[300]}; - } - - > div { - align-self: stretch; - } - transition: transform 0.3s ease-in-out; - &:hover { - transform: rotate(180deg); - } -` -export const SwitchIcon = styled(Svg).attrs({ - src: Switch, - fill: '#AEDB01', -})` - display: flex; -` - -export const SectionLabel = styled(Typography).attrs({ - variant: 'body2', -})` - color: ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[700] : colors.gray[100]}; -` diff --git a/packages/boba/gateway/src/containers/Bridging/index.tsx b/packages/boba/gateway/src/containers/Bridging/index.tsx deleted file mode 100644 index 5c5a747a81..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/index.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { setConnect } from 'actions/setupAction' -import { openModal } from 'actions/uiAction' -import { Heading } from 'components/global' -import useBridgeCleanup from 'hooks/useBridgeCleanup' -import React from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { - selectAccountEnabled, - selectAmountToBridge, - selectBridgeAlerts, - selectTokenToBridge, -} from 'selectors' -import BridgeAlert from './BridgeAlert' -import BridgeHeader from './BridgeHeader' -import BridgeInput from './BridgeInput' -import BridgeTypeSelector from './BridgeTypeSelector' -import ThirdPartyBridges from './ThirdPartyBridges' -import Chains from './chain' -import { - BridgeAction, - BridgeActionButton, - BridgeContent, - BridgeWrapper, - BridginContainer, -} from './styles' -import useBridgeAlerts from 'hooks/useBridgeAlerts' - -const Bridging = () => { - useBridgeCleanup() - useBridgeAlerts() - - const dispatch = useDispatch() - const accountEnabled = useSelector(selectAccountEnabled()) - const token = useSelector(selectTokenToBridge()) - const amountToBridge = useSelector(selectAmountToBridge()) - const bridgeAlerts = useSelector(selectBridgeAlerts()) - - const isBridgeActionDisabled = () => { - const hasError = bridgeAlerts.find((alert: any) => alert.type === 'error') - return !token || !amountToBridge || hasError - } - - const onConnect = () => { - dispatch(setConnect(true)) - } - - const onBridge = () => { - if (isBridgeActionDisabled()) { - return - } - dispatch(openModal('bridgeConfirmModal')) - } - - return ( - - - - - - - - - - - {!accountEnabled ? ( - Connect Wallet} - /> - ) : ( - Bridge} - /> - )} - - - - - ) -} - -export default Bridging diff --git a/packages/boba/gateway/src/containers/Bridging/styles.ts b/packages/boba/gateway/src/containers/Bridging/styles.ts deleted file mode 100644 index 533a0ae190..0000000000 --- a/packages/boba/gateway/src/containers/Bridging/styles.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { Button, Typography } from 'components/global' -import styled, { css } from 'styled-components' -import { mobile } from 'themes/screens' - -export const BridginContainer = styled.div` - display: flex; - flex-direction: column; - gap: 32px; - max-width: 500px; - margin: 32px auto; - - ${mobile(css` - max-width: 360px; - margin: 24px auto; - `)} -` - -export const BridgeWrapper = styled.div` - padding: 24px; - display: flex; - flex-direction: column; - gap: 8px; - width: 100%; - border-radius: 12px; - border: 1px solid - ${({ theme: { colors, name } }) => - name === 'light' ? colors.gray[400] : colors.gray[300]}; - background: ${({ theme }) => theme.colors.box.background}; - /* Gradient Glass BG Blur */ - backdrop-filter: blur(7.5px); - - ${mobile(css` - padding: 24px 16px; - `)} -` - -export const BridgeContent = styled.div` - width: 100%; - display: flex; - flex-direction: column; - gap: 20px; - justify-content: space-around; - align-items: flex-start; -` - -export const BridgeReceiveWrapper = styled.div`` -export const BridgeInfo = styled.div`` -export const BridgeAction = styled.div` - width: 100%; - display: flex; - justify-content: around; - align-items: center; - margin-top: 24px; -` - -export const BridgeActionButton = styled(Button).attrs({ - style: { - width: '100%', - }, -})`` - -export const Label = styled(Typography).attrs({ - variant: 'body3', -})` - font-weight: 400; - line-height: normal; - color: ${({ theme, color }) => - color - ? color - : theme.name === 'light' - ? theme.colors.gray[700] - : theme.colors.gray[100]}; -` - -export const BridgeItem = styled.a` - padding: 16px; - display: flex; - align-items: center; - justify-content: flex-start; - gap: 8px; - border-radius: 12px; - border: 1px solid ${({ theme }) => theme.colors.gray[300]}; - color: ${(props) => props.theme.color}; - text-decoration: none; - &:hover { - background: ${(props) => props.theme.colors.gray[400]}; - } -` -export const BridgeIcon = styled.div` - height: 32px; - width: 32px; - border-radius: 200px; - background: #fff; -` -export const BridgeLabel = styled(Typography).attrs({ - variant: 'title', -})` - flex: 1; - line-height: normal; - text-transform: capitalize; -` diff --git a/packages/boba/gateway/src/containers/bobaScope/BobaScope.js b/packages/boba/gateway/src/containers/bobaScope/BobaScope.js deleted file mode 100644 index b0ecc4634c..0000000000 --- a/packages/boba/gateway/src/containers/bobaScope/BobaScope.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useEffect, useState } from 'react' -import { useDispatch } from 'react-redux' -import { isEqual, orderBy } from 'util/lodash'; -import { useSelector } from 'react-redux' - -import { fetchSevens, fetchFastExits } from 'actions/networkAction' - -import { selectBaseEnabled, selectSevens, selectFastExits } from 'selectors' - -import Sevens from './Sevens' -import FastExits from './FastExits' - -import useInterval from 'hooks/useInterval' - -import { POLL_INTERVAL } from 'util/constant' -import {Header, BobaScopeContainer, ContentContainer} from './styles' -import { TabComponent } from 'components/global/tabs'; -import { SearchInput } from 'components/global/searchInput'; - -function BobaScope() { - - const dispatch = useDispatch() - - const [ searchData, setSearchData ] = useState('') - - const baseEnabled = useSelector(selectBaseEnabled()) - - const unorderedSevens = useSelector(selectSevens, isEqual) - const orderedSevens = orderBy(unorderedSevens, i => i.timeStamp, 'desc') - const sevens = orderedSevens - - const unorderedFastExits = useSelector(selectFastExits, isEqual) - const orderedFastExits = orderBy(unorderedFastExits, i => i.timeStamp, 'desc') - const fastExits = orderedFastExits - - useEffect(() => { - if (baseEnabled) { - dispatch(fetchSevens()) - dispatch(fetchFastExits()) - } - }, [ dispatch, baseEnabled ]) - - useInterval(() => { - if (baseEnabled) { - dispatch(fetchSevens()) - dispatch(fetchFastExits()) - } - }, POLL_INTERVAL) - - return ( - -
- { setSearchData(i.target.value) }}/> -
- - ) - }, - {label:"Fast Exits", - content:( ) - } - ]} - /> - -
- ); -} - -export default React.memo(BobaScope) diff --git a/packages/boba/gateway/src/containers/bobaScope/FastExits.js b/packages/boba/gateway/src/containers/bobaScope/FastExits.js deleted file mode 100644 index 99987ac957..0000000000 --- a/packages/boba/gateway/src/containers/bobaScope/FastExits.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState, useEffect } from 'react' -import { Grid, Box } from '@mui/material' -import { useSelector } from 'react-redux' -import { formatDate } from 'util/dates' - -import { selectLoading } from 'selectors' -import { Pager } from 'components' -import FastExit from 'components/seven/FastExit' - -import { Svg } from 'components/global/svg' -import noHistoryIcon from 'assets/images/noHistory.svg' -import { HistoryContainer, Content, Disclaimer } from './styles' -import { Typography } from 'components/global' - -const PER_PAGE = 6 - -function FastExits({ searchData, data }) { - - const [ page, setPage ] = useState(1) - - const loading = useSelector(selectLoading([ 'FASTEXITS/GETALL' ])) - - useEffect(() => { setPage(1) }, [ searchData ]) - - const _data = data.filter(i => { - return i.hash.includes(searchData) && i.to !== null - }) - - const startingIndex = page === 1 ? 0 : ((page - 1) * PER_PAGE) - const endingIndex = page * PER_PAGE - const paginatedData = _data.slice(startingIndex, endingIndex) - - let totalNumberOfPages = Math.ceil(_data.length / PER_PAGE) - - //if totalNumberOfPages === 0, set to one so we don't get the strange "page 1 of 0" display - if (totalNumberOfPages === 0) totalNumberOfPages = 1 - - return ( - - setPage(page + 1)} - onClickBack={() => setPage(page - 1)} - /> - - - - - {!paginatedData.length && !loading && ( - - - No Pending fast exits. - - )} - {!paginatedData.length && loading && ( - - - Loading pending fast exits... - - )} - {paginatedData.map((i, index) => { - return ( - - ) - })} - - - - - ); -} - -export default React.memo(FastExits) diff --git a/packages/boba/gateway/src/containers/bobaScope/Sevens.js b/packages/boba/gateway/src/containers/bobaScope/Sevens.js deleted file mode 100644 index b60b50d675..0000000000 --- a/packages/boba/gateway/src/containers/bobaScope/Sevens.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState, useEffect } from 'react' -import { Grid, Box } from '@mui/material' -import { useSelector } from 'react-redux' -import {formatDate} from 'util/dates' - -import { selectLoading } from 'selectors' -import { Pager } from 'components' -import Seven from 'components/seven/Seven' -import { Svg } from 'components/global/svg' -import noHistoryIcon from 'assets/images/noHistory.svg' -import { HistoryContainer, Content, Disclaimer } from './styles' -import { Typography } from 'components/global' - -const PER_PAGE = 6 - -function Sevens({ searchData, sevens }) { - - const [page, setPage] = useState(1) - - const loading = useSelector(selectLoading(['SEVENS/GETALL'])) - - useEffect(() => {setPage(1)}, [searchData]) - - const _sevens = sevens.filter(i => { - return i.hash.includes(searchData) && i.to !== null - }) - - const startingIndex = page === 1 ? 0 : ((page - 1) * PER_PAGE) - const endingIndex = page * PER_PAGE - const paginatedSevens = _sevens.slice(startingIndex, endingIndex) - - let totalNumberOfPages = Math.ceil(_sevens.length / PER_PAGE); - - //if totalNumberOfPages === 0, set to one so we don't get the strange "page 1 of 0" display - if (totalNumberOfPages === 0) totalNumberOfPages = 1 - - return ( - - setPage(page + 1)} - onClickBack={()=>setPage(page - 1)} - /> - - - - - {!paginatedSevens.length && !loading && ( - - - No Pending 7 day exits. - - )} - {!paginatedSevens.length && loading && ( - - - Loading pending 7 day exits... - - )} - {paginatedSevens.map((i, index) => { - return ( - - ) - })} - - - - - ); -} - -export default React.memo(Sevens) diff --git a/packages/boba/gateway/src/containers/bobaScope/styles.ts b/packages/boba/gateway/src/containers/bobaScope/styles.ts deleted file mode 100644 index af01160bac..0000000000 --- a/packages/boba/gateway/src/containers/bobaScope/styles.ts +++ /dev/null @@ -1,74 +0,0 @@ -import styled, { css } from 'styled-components' - -export const HistoryContainer = styled.div` - border-radius: 8px; - margin-bottom: 20px; -` - -export const Header = styled.div` - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - margin-bottom: 20px; -` - -export const BobaScopeContainer = styled.div` - margin: 0px auto; - display: flex; - flex-direction: column; - justify-content: space-around; - padding: 10px; - width: 70%; -` - -export const ContentContainer = styled.div` - display: flex; - flex-direction: column; - width: 100%; -` - -export const Content = styled.div` - display: flex; - flex-direction: column; - gap: 10px; - margin-bottom: 10px; - border-radius: 6px; -` - -export const Disclaimer = styled.div` - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - margin-left: auto; - margin-right: auto; - padding: 20px; - padding-top: 10%; - font-size: 16px; - gap: 10px; - - ${(props) => - props.theme.name === 'light' && - css` - color: ${props.theme.colors.gray[700]}; - `} - ${(props) => - props.theme.name === 'dark' && - css` - color: ${props.theme.colors.gray[100]}; - `} - - svg { - ${(props) => - props.theme.name === 'light' && - css` - fill: ${props.theme.colors.gray[700]}; - `} - ${(props) => - props.theme.name === 'dark' && - css` - fill: ${props.theme.colors.gray[100]}; - `} - } -` diff --git a/packages/boba/gateway/src/containers/connect/index.tsx b/packages/boba/gateway/src/containers/connect/index.tsx deleted file mode 100644 index 04a3da07a1..0000000000 --- a/packages/boba/gateway/src/containers/connect/index.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import React from 'react' -import { useDispatch } from 'react-redux' -import AlertIcon from 'components/icons/AlertIcon' -import { Button } from 'components/global/button' - -import { setConnectBOBA, setConnect } from 'actions/setupAction' - -import styled, { css } from 'styled-components' -import { Typography } from 'components/global' -import { mobile } from 'themes/screens' - -export const AlertContainer = styled.div` - display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; - padding: 8px 16px; - border-radius: 12px; - background: ${({ theme }) => theme.bg.glassy}; - border: 1px solid ${({ theme }) => theme.bg.glassy}; - margin-bottom: 12px; - - ${mobile(css` - flex-direction: column; - justify-content: flex-start; - `)} -` -export const AlertBody = styled.div` - display: flex; - justify-content: flex-start; - align-items: center; - gap: 8px; -` -export const AlertDescription = styled(Typography).attrs({ - variant: 'body2', -})`` -export const AlertAction = styled.div`` - -const Connect = ({ - userPrompt, - accountEnabled, - connectToBoba = false, - layer = '', -}) => { - const dispatch = useDispatch() - - const onConnect = () => { - if (!accountEnabled && !connectToBoba) { - dispatch(setConnect(true)) - } else if (layer !== 'L2' && connectToBoba) { - dispatch(setConnectBOBA(true)) - } - } - - if ( - (!accountEnabled && !connectToBoba) || - (layer !== 'L2' && connectToBoba) - ) { - return ( - - - - {userPrompt} - - - - - {contractMethos.length > 0 && ( - - Methods - {contractMethos.map((method, methodIndex) => { - const functionName = method.key - const stateMutability = method.value.stateMutability - const inputs = method.value.inputs - const inputStyle = {borderWidth: 0, borderRadius: 0, padding: '5px 0px', backgroundColor: 'transparent'} - const TxResult = TxBuilderResult[methodIndex] || {} - return ( - - - {`${functionName} ${stateMutability}`} - {inputs.length > 0 && inputs.map((input, inputIndex) => { - return ( - updateContractInput(methodIndex, inputIndex, i.target.value)} - fullWidth - sx={{fontSize: '50px'}} - newStyle - key={inputIndex} - style={inputStyle} - /> - ) - })} - {stateMutability === 'payable' && ( - updateContractInput(methodIndex, inputs.length, i.target.value)} - fullWidth - sx={{fontSize: '50px'}} - newStyle - style={inputStyle} - /> - )} - {(typeof TxResult.err !== 'undefined' || typeof TxResult.result !== 'undefined' || typeof TxResult.result !== 'undefined') && ( - - {TxResult.err && {TxResult.err}} - {TxResult.result && {TxResult.result}} - {TxResult.transactionHash && - - Succeeded! - - - } - - )} - - - - - - ) - })} - - )} - - - ) -} - -export default TxBuilder; diff --git a/packages/boba/gateway/src/containers/devtools/TxBuilder.styles.js b/packages/boba/gateway/src/containers/devtools/TxBuilder.styles.js deleted file mode 100644 index 090e003bdd..0000000000 --- a/packages/boba/gateway/src/containers/devtools/TxBuilder.styles.js +++ /dev/null @@ -1,52 +0,0 @@ -import { Box } from '@mui/material'; -import { styled } from '@mui/material/styles'; - -export const TxBuilderWrapper = styled(Box)(({ theme }) => ({ - background: theme.palette.background.secondary, - backdropFilter: 'blur(100px)', - borderRadius: theme.palette.primary.borderRadius, - border: theme.palette.primary.border, - flex: 1, - minHeight: 'fit-content', - padding: '20px', - width: '100%', -})) - -export const Wrapper = styled(Box)(({ theme }) => ({ - display: 'flex', - flexDirection: 'column', - marginTop: 20, - marginBottom: 20, - width: '100%', -})) - -export const ButtonWrapper = styled(Box)(({ theme }) => ({ - display: 'flex', - justifyContent: 'flex-end', -})) - -export const MethodsWrapper = styled(Box)(({ theme }) => ({ - display: 'flex', - flexDirection: 'column', - marginBottom: 20, - width: '100%', -})) - -export const InputWrapper = styled(Box)(({ theme }) => ({ - marginTop: 20, - marginBottom: 20, - padding: 20, - borderRadius: theme.palette.primary.borderRadius, - border: theme.palette.primary.border, - backgroundColor: theme.palette.background.input, -})) - -export const TxResultWrapper = styled(Box)(({ theme }) => ({ - marginTop: 20, - marginBottom: 10, -})) - -export const TxSuccessWrapper = styled(Box)(({ theme }) => ({ - display: 'flex', - alignItems: 'center', -})) diff --git a/packages/boba/gateway/src/containers/earn/Earn.js b/packages/boba/gateway/src/containers/earn/Earn.js deleted file mode 100644 index e7221a06bb..0000000000 --- a/packages/boba/gateway/src/containers/earn/Earn.js +++ /dev/null @@ -1,231 +0,0 @@ -/* - Utility Functions for OMG Plasma - Copyright (C) 2021 Enya Inc. Palo Alto, CA - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -import React, { useState, useEffect } from 'react' -import { useDispatch, useSelector } from 'react-redux'; - -import { HelpOutline } from '@mui/icons-material' - -import { - selectUserInfo, - selectPoolInfo, - selectlayer1Balance, - selectlayer2Balance, - selectBaseEnabled, - selectAccountEnabled, - selectLayer, - selectActiveNetworkName, - selectChainIdChanged -} from 'selectors' - -import { getEarnInfo } from 'actions/earnAction' - -import Connect from 'containers/connect' - -import ListEarn from 'components/listEarn/ListEarn' -import AlertIcon from 'components/icons/AlertIcon' -import Tooltip from 'components/tooltip/Tooltip'; -import Button from 'components/button/Button' - -import networkService from 'services/networkService' - -import * as S from './styles' -import { fetchBalances } from 'actions/networkAction'; - -import { TableHeader } from 'components/global/table' -import { CheckboxWithLabel } from 'components/global/checkbox' -import { tableHeaderOptions } from './consts' -import { Typography } from 'components/global/typography' -import { toLayer } from './types' - -import { BridgeTooltip } from './tooltips' -import { setConnectBOBA, setConnectETH } from 'actions/setupAction'; - -const Earn = () => { - const dispatch = useDispatch(); - - const activeNetworkName = useSelector(selectActiveNetworkName()) - const layer = useSelector(selectLayer()) - - const userInfo = useSelector(selectUserInfo()) - const poolInfo = useSelector(selectPoolInfo()) - - const layer1Balance = useSelector(selectlayer1Balance) - const layer2Balance = useSelector(selectlayer2Balance) - - const baseEnabled = useSelector(selectBaseEnabled()) - const accountEnabled = useSelector(selectAccountEnabled()) - const chainIdChanged = useSelector(selectChainIdChanged()) - const networkName = useSelector(selectActiveNetworkName()) - - const [showMDO, setShowMDO] = useState(false) - const [showMSO, setShowMSO] = useState(false) - const [lpChoice, setLpChoice] = useState( - networkService.L1orL2 === 'L1' ? 'L1LP' : 'L2LP' - ) - - const isLp1 = lpChoice === 'L1LP'; - const isLp2 = lpChoice === 'L2LP'; - - const [poolTab, setPoolTab] = useState( - activeNetworkName[layer?.toLowerCase()] - ) - - useEffect(()=> { - setLpChoice(networkService.L1orL2 === 'L1' ? 'L1LP' : 'L2LP') - setPoolTab(activeNetworkName[layer?.toLowerCase()]) - }, [layer, networkService, activeNetworkName]) - - - useEffect(() => { - if (baseEnabled) { - dispatch(getEarnInfo()) - } - - if (accountEnabled) { - - dispatch(fetchBalances()) - } - }, [dispatch, baseEnabled, accountEnabled, activeNetworkName]) - - - const getBalance = (address, chain) => { - const tokens = - chain === 'L1' - ? Object.values(layer1Balance) - : chain === 'L2' - ? Object.values(layer2Balance) - : [] - const token = tokens.find(t => t.address.toLowerCase() === address.toLowerCase()) - return token ? [token.balance, token.decimals] : [0, 0] - } - - - const selectedPoolInfo = lpChoice === 'L1LP' ? poolInfo.L1LP : poolInfo.L2LP; - - const selectedNetworkConfig = - lpChoice === 'L1LP' - ? networkService?.networkConfig?.L1?.chainIdHex - : networkService?.networkConfig?.L2?.chainIdHex - - useEffect(()=>{ - setLpChoice(networkService.L1orL2 === 'L1' ? 'L1LP' : 'L2LP') - },[networkService.L1orL2]) - - return ( - - - - - - Bridging fees are proportionally distributed to stakers. The bridges - are not farms. Your earnings only increase when someone uses the - bridge you have staked into. - - - }> - - - - {((layer === 'L2' && isLp1) || (layer === 'L1' && isLp2)) && ( - - - - - You are on {layer}. To transact on {toLayer[layer]}, SWITCH LAYER to {toLayer[layer]} - - - - - )} - -
- - - { - setLpChoice('L1LP') - setPoolTab(activeNetworkName['l1']) - }}> - {activeNetworkName['l1']} Pools - - { - setLpChoice('L2LP') - setPoolTab(activeNetworkName['l2']) - }}> - {activeNetworkName['l2']} Pools - - - - - setShowMSO(status)} - /> - - - - - - - {Object.keys(selectedPoolInfo).map((v, i) => { - const ret = getBalance(v, lpChoice === 'L1LP' ? 'L1' : 'L2'); - if (showMDO && Number(ret[0]) === 0) { - return null - } - return ( - - ); - })} - -
-
- ) -} - -export default React.memo(Earn); diff --git a/packages/boba/gateway/src/containers/earn/EarnWrapper.js b/packages/boba/gateway/src/containers/earn/EarnWrapper.js deleted file mode 100644 index 55ad52b047..0000000000 --- a/packages/boba/gateway/src/containers/earn/EarnWrapper.js +++ /dev/null @@ -1,10 +0,0 @@ -import { useMediaQuery, useTheme } from '@mui/material'; -import React from 'react'; -import Earn from './Earn'; - -const EarnWrapper = ({ ...rest }) => { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down('md')); - return ; -} -export default EarnWrapper; \ No newline at end of file diff --git a/packages/boba/gateway/src/containers/earn/consts.ts b/packages/boba/gateway/src/containers/earn/consts.ts deleted file mode 100644 index 8e6bfb24e7..0000000000 --- a/packages/boba/gateway/src/containers/earn/consts.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { tabSwitcherTypes } from './types' - -export const TabSwitcherEnum: tabSwitcherTypes = { - L1LP: { - name: 'L1LP', - tab: 'Ethereum Pool', - }, - L2LP: { - name: 'L2LP', - tab: 'Boba L2 Pool', - }, -} - -export const tableHeaderOptions = [ - { name: 'Token', width: 225 }, - { - name: 'Available Balance', - tooltip: - 'Available Balance refers to the amount of funds currently in each pool.', - width: 145, - }, - { - name: 'Total Staked', - tooltip: 'Total staked denotes the funds staked by liquidity providers.', - width: 115, - }, - { - name: 'APR', - tooltip: - 'The APR is the historical APR, which reflects the fees people paid to bridge and the previous usage patterns for each pool.', - width: 85, - }, - { name: 'Your Stake', width: 90 }, - { name: 'Earned', width: 110 }, - { name: 'Actions', width: 75 }, -] diff --git a/packages/boba/gateway/src/containers/earn/styles.ts b/packages/boba/gateway/src/containers/earn/styles.ts deleted file mode 100644 index 6378c5c6c5..0000000000 --- a/packages/boba/gateway/src/containers/earn/styles.ts +++ /dev/null @@ -1,153 +0,0 @@ -import styled, { css } from 'styled-components' -import { Typography } from 'components/global/typography' - -export const EarnPageContainer = styled.div` - margin: 0px auto; - display: flex; - flex-direction: column; - justify-content: space-around; - padding: 10px; - padding-top: 0px; - width: 1025px; -` - -export const TableHeading = styled.div` - padding: 20px, - border-radius: 6px 6px 0 0; - display: flex; - align-items: center; - background: ${(props) => props.theme.colors.box.background}; -` - -export const LayerAlert = styled.div` - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - gap: 30px; - border-radius: 8px; - margin: 8px 0px; - padding: 10px; - background: ${(props) => props.theme.colors.box.background}; -` - -export const Help = styled.div` - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - gap: 30px; - margin: 10px 0px; - padding: 10px; - border-radius: 8px; - background: ${(props) => props.theme.colors.box.background}; - ${({ theme: { name, colors } }) => css` - border: 1px solid ${name === 'light' ? colors.blue[200] : colors.blue[100]}; - background: ${name === 'light' ? colors.blue[50] : colors.blue[500]}; - color: ${name === 'light' ? colors.blue[500] : colors.blue[100]}; - `} -` - -export const AlertText = styled(Typography)` - margin-left: 10px; - flex: 4; -` - -export const AlertInfo = styled.div` - display: flex; - justify-content: space-around; - align-items: center; - flex: 1; -` - -export const Wrapper = styled.div` - border-radius: 8px; -` - -export const GridItemTagContainer = styled.div` - spacing: 2, - flex-direction: row; - justify-content: left; - align-items: center; -` - -export const GridItemTag = styled.div` - display: flex; - flex-direction: row; - align-items: center; - gap: 5px; -` - -export const EarnAction = styled.div` - display: flex; - justify-content: space-around; - align-items: center; -` - -export const EarnActionContainer = styled.div` - display: flex; - justify-content: space-between; - align-items: center; - margin: 10px 0px; -` - -export const EarnListContainer = styled.div` - display: flex; - flex-direction: column; - gap: 10px 0px; - padding: 10px 0px; -` - -export const BpIcon = styled.span` - border-radius: 3; - width: 16; - height: 16; -` - -export const PageSwitcher = styled.div` - width: fit-content; - padding: 3px; - cursor: pointer; - display: flex; - border-radius: 12px; - height: 48px; - span { - padding: 2px 15px; - font-weight: bold; - border-radius: 12px; - display: flex; - justify-content: center; - align-items: center; - &.active { - color: #031313; - background: #bae21a; - } - } -` - -export const TabSwitcherContainer = styled.div` - display: flex; - padding: 4px; - gap: 0px 15px; - border-radius: 8px; - ${({ theme: { colors, name } }) => - name === 'light' - ? css` - background: ${colors.gray[50]}; - ` - : css` - background: ${colors.gray[500]}; - `} -` - -export const Tab = styled.div<{ active: boolean }>` - padding: 8px 24px; - border-radius: 8px; - cursor: pointer; - ${(props) => - props.active && - ` - color:${props.theme.colors.gray[800]}; - background:${props.theme.colors.green[300]} - `} -` diff --git a/packages/boba/gateway/src/containers/earn/tooltips.tsx b/packages/boba/gateway/src/containers/earn/tooltips.tsx deleted file mode 100644 index 72ab532b85..0000000000 --- a/packages/boba/gateway/src/containers/earn/tooltips.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import { Typography } from 'components/global/typography' - -export const BridgeTooltip = () => ( - - Staking example. When you stake - 10 BOBA into the L2 pool, then the pool's liquidity and balance both - increase by 10 BOBA. -
-
- Fast Bridge example. When a user - bridges 10 BOBA from L1 to L2 using the fast bridge, they send 10 BOBA to - the L1 pool, increasing its balance by 10 BOBA. Next, 9.99 BOBA flow out - from the L2 pool to the user's L2 wallet, completing the bridge. Note that - bridge operations do not change the pool's liquidity, but only its balance. - The difference between what was deposited into the L1 pool (10 BOBA) and - what was sent to the user on the L2 (9.99 BOBA), equal to 0.01 BOBA, is sent - to the reward pool, for harvesting by stakers. -
-
- Pool rebalancing. In some - circumstances, excess balances can accumulate on one chain. For example, if - many people bridge from L1 to L2, then L1 pool balances will increase, while - L2 balances will decrease. When needed, the pool operator can rebalance the - pools, using 'classic' deposit and exit operations to move funds from one - pool to another. Rebalancing takes 7 days, due to the 7 day fraud proof - window, which also applies to the operator. -
-
- Dynamic fees. The pools use an - automatic supply-and-demand approach to setting the fees. When a pool's - liquidity is low, the fees are increased to attract more liquidity into that - pool and vice-versa. -
-) diff --git a/packages/boba/gateway/src/containers/earn/types.ts b/packages/boba/gateway/src/containers/earn/types.ts deleted file mode 100644 index 363d49a570..0000000000 --- a/packages/boba/gateway/src/containers/earn/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -type poolDetail = { - name: string - tab: string -} - -export type tabSwitcherTypes = { - L1LP: poolDetail - L2LP: poolDetail -} - -export enum toLayer { - L1 = 'L2', - L2 = 'L1', -} diff --git a/packages/boba/gateway/src/containers/history/DatePicker.tsx b/packages/boba/gateway/src/containers/history/DatePicker.tsx deleted file mode 100644 index 98c53df48d..0000000000 --- a/packages/boba/gateway/src/containers/history/DatePicker.tsx +++ /dev/null @@ -1,132 +0,0 @@ -import React, { useRef, useState, useEffect, useCallback } from 'react' -import { subMonths } from 'date-fns' -import { - DatePickerDropdown, - DatePickerHeader, - DatePickerContainer, -} from './styles' -import { formatDate } from 'util/dates' -import { DayPicker, DateRange } from 'react-day-picker' -import 'react-day-picker/dist/style.css' - -export interface IDatePickerProps { - selected: Date - timeFormat?: string - onChange: Function - minDate?: Date - maxDate?: Date - range?: boolean - onChangeFrom?: Function - onChangeTo?: Function -} - -const DatePicker = (props: IDatePickerProps) => { - const dropdownRef = useRef(null) - useEffect(() => { - const handleClickOutside = (e: Event) => { - if ( - dropdownRef.current && - !dropdownRef.current.contains(e.target as Node) - ) { - setIsOpen(false) - } - } - // Bind the event listener - document.addEventListener('mousedown', handleClickOutside) - return () => { - // Unbind the event listener on clean up - document.removeEventListener('mousedown', handleClickOutside) - } - }, [dropdownRef]) - - const [selectedDate, setSelectedDate] = useState(props.selected) - const today = new Date() - const pastDate = new Date(2015, 7, 30) - - const disabledPeriod = { - before: props.minDate ? props.minDate : pastDate, - after: props.maxDate ? props.maxDate : today, - } - const disabledDays = [disabledPeriod] - - const [isOpen, setIsOpen] = useState(false) - - const defaultSelectedRange: DateRange = { - from: subMonths(today, 6), - to: today, - } - const [selectedRange, setSelectedRange] = useState( - defaultSelectedRange - ) - - const handleClick = useCallback(() => { - setIsOpen(!isOpen) - }, [isOpen]) - - const handleDateChange = (date: Date | undefined) => { - if (date && selectedDate !== date) { - setSelectedDate(date) - props.onChange(date) - } - } - const handleRangeChange = (range: DateRange | undefined) => { - if (range && range !== selectedRange) { - setSelectedRange(range) - props.onChangeFrom && props.onChangeFrom(range.from) - props.onChangeTo && props.onChangeTo(range.to) - } - } - - if (props.range) { - const dateRangeString = `${ - selectedRange?.from - ? formatDate(selectedRange?.from?.getTime() / 1000, props.timeFormat) - : 'From' - } - ${ - selectedRange?.to - ? formatDate(selectedRange?.to?.getTime() / 1000, props.timeFormat) - : 'To' - }` - - return ( - - - {dateRangeString} - - {isOpen && ( - - handleRangeChange(range)} - disabled={disabledDays} - /> - - )} - - ) - } - - return ( - - - {formatDate(selectedDate.getTime() / 1000, props.timeFormat)} - - {isOpen && ( - - handleDateChange(date)} - disabled={disabledDays} - /> - - )} - - ) -} - -export default DatePicker diff --git a/packages/boba/gateway/src/containers/history/History.tsx b/packages/boba/gateway/src/containers/history/History.tsx deleted file mode 100644 index fb50ea2f9d..0000000000 --- a/packages/boba/gateway/src/containers/history/History.tsx +++ /dev/null @@ -1,272 +0,0 @@ -/* -Copyright 2021-present Boba Network. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { isEqual } from 'util/lodash' -import { ValidValuesFromArray } from 'util/objectManipulation' - -import { useTheme } from 'styled-components' - -import { Button } from 'components/global' - -import transactionService from 'services/transaction.service' -import { NETWORK_TYPE } from 'util/network/network.util' -import { - ALL_NETWORKS, - FILTER_OPTIONS, - NETWORK_L1_OPTIONS, - NETWORK_L2_OPTIONS, - TableOptions, -} from './constants' - -import { - selectAccountEnabled, - selectLayer, - selectTransactions, -} from 'selectors' - -import { fetchTransactions } from 'actions/networkAction' - -import { - Table, - NoHistory, - HistoryPageContainer, - TableHeader, - TableFilters, - NetworkDropdowns, - DateDescriptions, - SwitchChainIcon, - SwitchIcon, - TableTransactionsContainer, - DatePickerWrapper, - DropdownNetwork, - MobileDateDescriptions, - MobileDatePickerWrapper, -} from './styles' - -import { setConnect } from 'actions/setupAction' -import useInterval from 'hooks/useInterval' - -import { POLL_INTERVAL } from 'util/constant' - -import FilterIcon from 'assets/images/filter.svg' -import noHistoryIcon from 'assets/images/noHistory.svg' -import { FilterDropDown } from 'components/filter' -import { Svg } from 'components/global/svg' -import { TransactionsTableHeader } from 'components/global/table/themes' -import { TransactionsResolver } from './TransactionsResolver' -import { CHAIN_NAME, TRANSACTION_FILTER_STATUS } from './types' -import { SearchInput } from 'components/global/searchInput' - -import { Typography } from 'components/global/typography' -import DatePicker from './DatePicker' - -const History = () => { - const [toNetwork, setToNetwork] = useState(ALL_NETWORKS) - const [fromNetwork, setFromNetwork] = useState(ALL_NETWORKS) - const [transactionsFound, setTransactionsFound] = useState(true) - const [switched, setSwitched] = useState(false) - - const theme: any = useTheme() - - const dispatch = useDispatch() - - const now = new Date() - const last_6months = new Date( - now.getFullYear(), - now.getMonth() - 6, - now.getDate() - ) - const handleSwitchDropdowns = () => { - const temp = fromNetwork - setFromNetwork(toNetwork) - setToNetwork(temp) - setSwitched((current) => !current) - } - - const [filterStartDate, setFilterStartDate] = useState(last_6months) - const [transactionStatus, setTransactionStatus] = useState('All') - const [filterEndDate, setFilterEndDate] = useState(now) - const layer = useSelector(selectLayer()) - const accountEnabled = useSelector(selectAccountEnabled()) - - const [searchHistory, setSearchHistory] = useState('') - - const transactions = useSelector(selectTransactions, isEqual) - - // TODO: not working as implementation needs be rewrite. - const getDatePicker = (label: string, range: boolean = false) => { - const dateSelector = (date: Date) => { - label === 'To' ? setFilterEndDate(date) : setFilterStartDate(date) - } - return ( - - date && !Array.isArray(date) && dateSelector(date) - } - timeFormat="MM/DD/YYYY" - range={range} - {...(range - ? { onChangeFrom: setFilterStartDate, onChangeTo: setFilterEndDate } - : {})} - {...(label === 'To' - ? { minDate: filterStartDate } - : { maxDate: filterEndDate })} - /> - ) - } - const syncTransactions = async () => { - if (accountEnabled) { - const newTransactions = await transactionService.getTransactions() - if (newTransactions.length === 0) { - setTransactionsFound(false) - } else { - setTransactionsFound(true) - } - if ( - new Set(ValidValuesFromArray(transactions)).size !== - new Set(newTransactions).size - ) { - dispatch(fetchTransactions()) - } - } - } - - useInterval(async () => { - await syncTransactions() - }, POLL_INTERVAL) - - return ( - - {layer && ( - <> - - { - setSearchHistory(i.target.value) - }} - /> - - - Date Range From - - {getDatePicker('From')} - To - {getDatePicker('To')} - - - - Date Range - - {getDatePicker('', true)} - - - - -
- - - From - setFromNetwork(option)} - error={false} - headers={[NETWORK_TYPE.MAINNET, NETWORK_TYPE.TESTNET]} - /> - { - handleSwitchDropdowns() - }} - > - - - To - setToNetwork(option)} - error={false} - headers={[NETWORK_TYPE.MAINNET, NETWORK_TYPE.TESTNET]} - /> - - { - setTransactionStatus(item.value) - }} - error={false} - /> - -
- - - {transactionsFound && ( - - )} - -
- - )} - {!transactionsFound && ( - - -
No Transactions Found.
-
- )} - {!layer && ( - - -
No History.
- - - - ) -} - -export default React.memo(CDMCompletionModal) diff --git a/packages/boba/gateway/src/containers/modals/TransactionSuccessModal/index.styles.ts b/packages/boba/gateway/src/containers/modals/TransactionSuccessModal/index.styles.ts deleted file mode 100644 index 9f083b4796..0000000000 --- a/packages/boba/gateway/src/containers/modals/TransactionSuccessModal/index.styles.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Typography } from 'components/global' -import styled from 'styled-components' - -export const SuccessContainer = styled.div` - display: flex; - flex-direction: column; - align-items: center; - justify-content: space-around; - gap: 25px; -` - -export const TitleText = styled(Typography).attrs({ - variant: 'body1', -})` - text-align: center; -` - -export const MutedText = styled(Typography).attrs({ - variant: 'body3', -})` - color: ${({ theme }) => - theme.name === 'light' ? theme.colors.gray[700] : theme.colors.gray[50]}; -` - -export const CircleOuter = styled.div` - display: flex; - border-radius: 50%; - justify-content: center; - align-items: center; - height: 150px; - width: 150px; - background: ${({ theme }) => - theme.name === 'light' ? theme.colors.green[300] : theme.colors.green[500]}; -` -export const CircleInner = styled.div` - display: flex; - border-radius: 50%; - justify-content: center; - align-items: center; - height: 120px; - width: 120px; - background: ${({ theme }) => - theme.name === 'light' ? theme.colors.green[300] : theme.colors.green[400]}; -` - -export const SuccessCheck = styled.div` - display: flex; - border-radius: 50%; - justify-content: center; - align-items: center; - height: 90px; - width: 90px; - background: ${({ theme }) => theme.colors.green[300]}; - position: relative; - &:after { - content: 'āœ“'; - font-size: 60px; - color: #fff; - position: absolute; - margin: auto; - } -` - -export const SuccessContent = styled.div` - display: flex; - flex-direction: column; - align-items: center; - justify-content: space-around; - gap: 8px; -` diff --git a/packages/boba/gateway/src/containers/modals/TransactionSuccessModal/index.tsx b/packages/boba/gateway/src/containers/modals/TransactionSuccessModal/index.tsx deleted file mode 100644 index 3ff8726b84..0000000000 --- a/packages/boba/gateway/src/containers/modals/TransactionSuccessModal/index.tsx +++ /dev/null @@ -1,92 +0,0 @@ -import { - SuccessContainer, - SuccessCheck, - MutedText, - CircleOuter, - CircleInner, - TitleText, - SuccessContent, -} from './index.styles' -import React, { FC } from 'react' -import { closeModal } from 'actions/uiAction' -import { Button, Heading, Typography } from 'components/global' -import Modal from 'components/modal/Modal' -import { useDispatch, useSelector } from 'react-redux' -import { useNavigate } from 'react-router-dom' -import { - selectActiveNetworkName, - selectBridgeType, - selectLayer, -} from 'selectors' -import { LAYER } from 'util/constant' -import { BRIDGE_TYPE } from 'containers/Bridging/BridgeTypeSelector' - -interface Props { - open: boolean -} - -const TransactionSuccessModal: FC = ({ open }) => { - const dispatch = useDispatch() - const navigate = useNavigate() - const layer = useSelector(selectLayer()) - const name = useSelector(selectActiveNetworkName()) - const bridgeType = useSelector(selectBridgeType()) - - const estimateTime = () => { - if (bridgeType === BRIDGE_TYPE.CLASSIC) { - if (layer === LAYER.L1) { - return '13 ~ 14mins.' - } else { - return '7 days' - } - } else if (bridgeType === BRIDGE_TYPE.FAST) { - if (layer === LAYER.L1) { - return '1 ~ 5min.' - } else { - return '15min ~ 3hrs.' - } - } else { - // Teleportation, instant - return '~1min.' - } - } - - const handleClose = () => { - dispatch(closeModal('transactionSuccess')) - } - - return ( - - - - - - - - - Bridge Successful - - Your funds will arrive in {estimateTime()} at your wallet on{' '} - {layer === LAYER.L1 ? name['l2'] : name['l1']}. - - To monitor progress, go to History page. - - - - - ) -} - -export default React.memo(NewProposalModal) diff --git a/packages/boba/gateway/src/containers/modals/dao/daoModal.styles.js b/packages/boba/gateway/src/containers/modals/dao/daoModal.styles.js deleted file mode 100644 index cf70ad72e9..0000000000 --- a/packages/boba/gateway/src/containers/modals/dao/daoModal.styles.js +++ /dev/null @@ -1,9 +0,0 @@ -import { Divider, styled } from "@mui/material"; - - -export const DividerLine = styled(Divider)(({ theme }) => ({ - background: `${theme.palette.mode === 'dark' ? 'rgba(255, 255, 255, 0.04)' : 'rgba(3, 19, 19, 0.04)'}`, - boxSizing: 'border-box', - boxShadow: `${theme.palette.mode === 'dark' ? '0px 4px 4px rgba(0, 0, 0, 0.25)' : 'none'}`, - width: '100%' -})) diff --git a/packages/boba/gateway/src/containers/modals/dao/old/NewProposalModalOldDao.js b/packages/boba/gateway/src/containers/modals/dao/old/NewProposalModalOldDao.js deleted file mode 100644 index c11323a8e3..0000000000 --- a/packages/boba/gateway/src/containers/modals/dao/old/NewProposalModalOldDao.js +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright 2021-present Boba Network. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -import React, { useState } from 'react'; -import { Box, Button, Dropdown, Input, Modal, ModalTypography } from 'components/global'; -import { useDispatch, useSelector } from 'react-redux'; -import { closeModal, openAlert } from 'actions/uiAction'; -import { createDaoProposal } from 'actions/daoAction'; -import { selectProposalThreshold } from 'selectors'; - -const NewProposalModal = ({ open }) => { - const dispatch = useDispatch(); - - const initialFormState = { - action: '', - votingThreshold: '', - LPfeeMin: '', - LPfeeMax: '', - LPfeeOwn: '', - proposeText: '', - proposalUri: '' - }; - - const [formState, setFormState] = useState(initialFormState); - - const { - action, - votingThreshold, - LPfeeMin, - LPfeeMax, - LPfeeOwn, - proposeText, - proposalUri, - } = formState - - const resetState = () => setFormState(initialFormState); - - const onActionChange = (option) => { - resetState(); - setFormState(prevState => ({ ...prevState, action: option.value })); - }; - - const handleClose = () => { - resetState(); - dispatch(closeModal('newProposalModal')); - }; - - const handleCreateDaoProposal = async (action, value = [], text = '') => { - const result = await dispatch(createDaoProposal({ action, value, text })); - if (result) { - dispatch(openAlert('Proposal has been submitted. It will be listed soon')); - handleClose(); - } - }; - - const submit = async () => { - switch (action) { - case 'change-threshold': - handleCreateDaoProposal(action, [votingThreshold]); - break; - case 'text-proposal': - handleCreateDaoProposal(action, [], `${proposeText}@@${proposalUri}`); - break; - case 'change-lp1-fee': - case 'change-lp2-fee': - handleCreateDaoProposal(action, [ - Math.round(Number(LPfeeMin) * 10), - Math.round(Number(LPfeeMax) * 10), - Math.round(Number(LPfeeOwn) * 10) - ]); - break; - default: - break; - } - }; - - return ( - - - - - - At least 100000.0 BOBA + xBOBA are needed to create a new proposal - - - onActionChange(option)} - defaultItem={{ - value: null, - label: 'Choose type of proposal', - }} - items={options} - /> - {action === 'change-threshold' && - <> - - The minimum number of votes required for an account to create a proposal. The current value is {proposalThreshold}. - - - setVotingThreshold(i.target.value)} - fullWidth - sx={{ marginBottom: '20px' }} - /> - - } - {(action === 'change-lp1-fee' || action === 'change-lp2-fee') && - <> - - Possible settings range from 0.0% to 5.0%. All three values must - be specified and the maximum fee must be larger than the minimum - fee. - - setLPfeeMin(i.target.value)} - fullWidth - /> - setLPfeeMax(i.target.value)} - fullWidth - /> - setLPfeeOwn(i.target.value)} - fullWidth - /> - - } - {action === 'text-proposal' && - <> - - Your proposal title is limited to 100 characters. Use the link field below to provide more information. - - setProposeText(i.target.value.slice(0, 100))} - /> - - You should provide additional information (technical - specifications, diagrams, forum threads, and other material) on - a seperate website. The link length is limited to 150 - characters. You may need to use a link shortener. - - setProposalUri(i.target.value.slice(0, 150))} - /> - - } - - - - - - - ) -} - -export default React.memo(InstallMetaMaskModal); diff --git a/packages/boba/gateway/src/containers/modals/noMetaMask/NoMetaMaskModal.js b/packages/boba/gateway/src/containers/modals/noMetaMask/NoMetaMaskModal.js deleted file mode 100644 index 6a6563317b..0000000000 --- a/packages/boba/gateway/src/containers/modals/noMetaMask/NoMetaMaskModal.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import { useDispatch } from 'react-redux'; - -import { Box } from '@mui/material'; - -import { closeModal, openModal } from 'actions/uiAction'; -import Button from 'components/button/Button'; -import Modal from 'components/modal/Modal'; -import { MM_EXTENTION_URL } from 'util/constant'; -import { setConnect } from 'actions/setupAction'; - -function NoMetaMaskModal({open}) { - - const dispatch = useDispatch(); - - const handleClose = () => { - dispatch(closeModal('noMetaMaskModal')); - dispatch(setConnect(false)); - } - - const handleAddMetaMask = () => { - window.open(MM_EXTENTION_URL, '_blank'); - dispatch(openModal('installMetaMaskModal')); - handleClose() - } - - return ( - - - - - - ) -} - -export default React.memo(NoMetaMaskModal); diff --git a/packages/boba/gateway/src/containers/modals/settings/index.tsx b/packages/boba/gateway/src/containers/modals/settings/index.tsx deleted file mode 100644 index 18f7e90da4..0000000000 --- a/packages/boba/gateway/src/containers/modals/settings/index.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import Modal from 'components/modal/Modal' -import React, { FC } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { closeModal } from 'actions/uiAction' -import { - SettingSubTitle, - SettingTitle, - SettingsAction, - SettingsItem, - SettingsText, - SettingsWrapper, -} from './styles' -import { SwitchButton } from 'components/global' -import { setActiveNetworkType } from 'actions/networkAction' -import { NETWORK_TYPE } from 'util/network/network.util' -import { selectActiveNetworkType, selectBridgeToAddressState } from 'selectors' -import { setBridgeToAddress } from 'actions/bridgeAction' - -interface SettingsModalProps { - open: boolean -} - -const SettingsModal: FC = ({ open }) => { - const dispatch = useDispatch() - const activeNetworkType = useSelector(selectActiveNetworkType()) - const bridgeToAddressEnable = useSelector(selectBridgeToAddressState()) - - const handleClose = () => { - dispatch(closeModal('settingsModal')) - } - - const onChangeNetworkType = (value: boolean) => { - dispatch( - setActiveNetworkType({ - networkType: value ? NETWORK_TYPE.TESTNET : NETWORK_TYPE.MAINNET, - }) - ) - } - - const onChangeDestinationAddress = (value: boolean) => { - dispatch(setBridgeToAddress(value)) - } - - return ( - - - - - Show Testnets - - Testnets will be available to bridge - - - - onChangeNetworkType(v)} - /> - - - - - Add Destination Address - - Allows you to transfer to a different address - - - - - - - - - - ) -} - -export default SettingsModal diff --git a/packages/boba/gateway/src/containers/modals/settings/styles.ts b/packages/boba/gateway/src/containers/modals/settings/styles.ts deleted file mode 100644 index dbd20b339e..0000000000 --- a/packages/boba/gateway/src/containers/modals/settings/styles.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Typography } from 'components/global' -import styled from 'styled-components' - -export const SettingsWrapper = styled.div` - display: flex; - flex-direction: column; - width: 100%; - gap: 16px; -` - -export const SettingsItem = styled.div` - display: flex; - justify-content: space-between; - width: 100%; -` -export const SettingsText = styled.div` - display: flex; - flex-direction: column; - justify-content: space-between; - width: 100%; - flex: 1; -` -export const SettingsAction = styled.div` - display: flex; - justify-content: space-between; -` -export const SettingSubTitle = styled(Typography).attrs({ - variant: 'subtitle', -})` - color: ${({ theme }) => - theme.name === 'light' ? theme.colors.gray[700] : theme.colors.gray[100]}; -` -export const SettingTitle = styled(Typography).attrs({ - variant: 'body2', -})` - color: ${(props) => props.theme.color}; -` diff --git a/packages/boba/gateway/src/containers/modals/stake/DepositStake.tsx b/packages/boba/gateway/src/containers/modals/stake/DepositStake.tsx deleted file mode 100644 index a1dff0e34b..0000000000 --- a/packages/boba/gateway/src/containers/modals/stake/DepositStake.tsx +++ /dev/null @@ -1,221 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { connect, useDispatch, useSelector } from 'react-redux' - -import { openAlert, closeModal } from 'actions/uiAction' - -import Modal from 'components/modal/Modal' - -import { Button } from 'components/global/button' - -import { StakeInputContainer, Flex, StakeContent, StakeDetails } from './styles' - -import { getFS_Saves, getFS_Info, addFS_Savings } from 'actions/fixedAction' - -import { toWei_String } from 'util/amountConvert' -import networkService from 'services/networkService' -import { BigNumber, utils } from 'ethers' -import { MaxInput } from 'components/global/InputMax' - -import { ModalTypography } from 'components/global/modalTypography' -import { selectFixed, selectSetup, selectBalance } from 'selectors' - -const DepositStake = (props: any) => { - const { stakeInfo } = useSelector(selectFixed()) - const { accountEnabled, netLayer, bobaFeeChoice, bobaFeePriceRatio } = - useSelector(selectSetup()) - const balance = useSelector(selectBalance()) - const { layer2 } = balance - - const dispatch = useDispatch() - - const [state, setState] = useState({ - max_Float_String: '0.0', - fee: '0', - stakeValue: '0.0', - value_Wei_String: '', - }) - - useEffect(() => { - dispatch(getFS_Saves()) - dispatch(getFS_Info()) - getMaxTransferValue() - }, []) - - useEffect(() => { - getMaxTransferValue() - }, [layer2]) - - const getMaxTransferValue = async () => { - // as staking BOBA check the bobabalance - const token: any = Object.values(layer2).find( - (t: any) => t['symbolL2'] === 'BOBA' - ) - - // BOBA available prepare transferEstimate - if (token) { - let max_BN = BigNumber.from(token.balance.toString()) - let fee = '0' - - if (netLayer === 'L2') { - const cost_BN: any = await networkService.savingEstimate() - - if (bobaFeeChoice) { - // we are staking BOBA and paying in BOBA - // so need to subtract the BOBA fee - max_BN = max_BN.sub(cost_BN.mul(BigNumber.from(bobaFeePriceRatio))) - } - - // make sure user maintains minimum BOBA in account - max_BN = max_BN.sub(BigNumber.from(toWei_String(3.0, 18))) - - if (bobaFeeChoice) { - fee = utils.formatUnits( - cost_BN.mul(BigNumber.from(bobaFeePriceRatio)), - token.decimals - ) - } else { - fee = utils.formatUnits(cost_BN, token.decimals) - } - } - - if (max_BN.lt(BigNumber.from('0'))) { - max_BN = BigNumber.from('0') - } - - setState((prevState) => ({ - ...prevState, - max_Float_String: utils.formatUnits(max_BN, token.decimals), - fee, - })) - } - } - - const handleStakeValue = (value: any) => { - const { max_Float_String } = state - - if ( - value && - Number(value) > 0.0 && - Number(value) <= Number(max_Float_String) - ) { - setState((prevState) => ({ - ...prevState, - stakeValue: value, - stakeValueValid: true, - value_Wei_String: toWei_String(value, 18), - })) - } else { - setState((prevState) => ({ - ...prevState, - stakeValue: value, - stakeValueValid: false, - value_Wei_String: '', - })) - } - } - - const handleConfirm = async () => { - const { value_Wei_String } = state - - setState((prevState) => ({ ...prevState, loading: true })) - - const addTX = await dispatch(addFS_Savings(value_Wei_String)) - - if (addTX) { - dispatch(openAlert('Your BOBA were staked')) - } - - setState((prevState) => ({ - ...prevState, - loading: false, - stakeValue: '', - value_Wei_String: '', - })) - handleClose() - } - - let totalBOBAstaked = 0 - Object.keys(stakeInfo).forEach((v, i) => { - if (stakeInfo[i].isActive) { - totalBOBAstaked = totalBOBAstaked + Number(stakeInfo[i].depositAmount) - } - }) - - const handleClose = () => { - dispatch(closeModal('StakeDepositModal')) - } - - return ( - { - handleClose() - }} - title="Stake" - > - - - Stake Boba and earn rewards. - - - - -
- Amount -
-
- - Balance: {state.max_Float_String} BOBA - -
-
- { - handleStakeValue(value) - }} - /> -
- - - Fees - - Fee: {state.fee} {bobaFeeChoice ? 'BOBA' : 'ETH'} - - - - APY - 5.0% - - - Amount - - {state.stakeValue || '-'} - - - - - {netLayer === 'L2' && ( - - ) : null} - - -
- ); -} - -export default React.memo(TransferModal) diff --git a/packages/boba/gateway/src/containers/modals/transferPending/TransferPending.js b/packages/boba/gateway/src/containers/modals/transferPending/TransferPending.js deleted file mode 100644 index b8eec2b515..0000000000 --- a/packages/boba/gateway/src/containers/modals/transferPending/TransferPending.js +++ /dev/null @@ -1,32 +0,0 @@ -import { Box, CircularProgress, Typography } from '@mui/material'; -import { closeModal } from 'actions/uiAction'; -import Modal from 'components/modal/Modal'; -import React from 'react' -import { useDispatch } from 'react-redux'; - -function TransferPendingModal({open}) { - - const dispatch = useDispatch(); - - function handleClose () { - dispatch(closeModal('transferPending')); - } - - return ( - - - - Waiting for confirmation from MetaMask - - - ) -} - -export default React.memo(TransferPendingModal); diff --git a/packages/boba/gateway/src/containers/modals/transferPending/TransferPending.styles.js b/packages/boba/gateway/src/containers/modals/transferPending/TransferPending.styles.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/boba/gateway/src/containers/modals/walletSelector/WalletSelectorModal.js b/packages/boba/gateway/src/containers/modals/walletSelector/WalletSelectorModal.js deleted file mode 100644 index 68a457931e..0000000000 --- a/packages/boba/gateway/src/containers/modals/walletSelector/WalletSelectorModal.js +++ /dev/null @@ -1,117 +0,0 @@ - -import React, { useState } from 'react' -import { useDispatch } from 'react-redux' - -import { closeModal } from 'actions/uiAction' -import { - setConnectBOBA, - setConnectETH, -} from 'actions/setupAction.js' - -import Modal from 'components/modal/Modal' -import { Typography } from 'components/global/typography' -import { Svg } from 'components/global/svg' -import networkService from 'services/networkService' -import metaMaskLogo from 'assets/images/metamask.svg' -import walletConnectLogo from 'assets/images/walletconnect.svg' -import ArrowIcon from 'assets/images/icons/arrowright.svg' - -import { Wallets, Wallet, Icon, ArrowContainer, IconContainer } from './styles' - -import { useWalletConnect } from 'hooks/useWalletConnect' -import { setConnect } from 'actions/setupAction' -import styled from 'styled-components' - -const StyledSvg = styled(Svg)` - display: flex; - svg { - fill: ${({ theme }) => theme.name == 'light' ? theme.colors.gray[ 600 ] : theme.colors.gray[ 100 ]} - } -` - -const WalletSelectorModal = ({ open }) => { - - const { triggerInit } = useWalletConnect() - - const dispatch = useDispatch() - - const [ walletNotFound, setWalletNotFound ] = useState(false) - - const connectToWallet = async (type) => { - const resetConnectChain = () => { - dispatch(setConnectETH(false)) - dispatch(setConnectBOBA(false)) - } - - try { - if (await networkService.walletService.connectWallet(type)) { - dispatch(closeModal('walletSelectorModal')) - triggerInit(); - } else { - resetConnectChain() - } - } catch (error) { - console.log(`Error connecting wallet: ${error}`) - resetConnectChain() - } - } - - const handleClose = () => { - dispatch(closeModal('walletSelectorModal')) - dispatch(setConnect(false)) - dispatch(setConnectETH(false)) - dispatch(setConnectBOBA(false)) - } - - return ( - - - {walletNotFound ? - { - window.open('https://metamask.io/download/', '_blank'); - setWalletNotFound(false); - }}> - - - - Download MetaMask wallet - - : - - { - if (window.ethereum) { - connectToWallet('metamask') - } else { - setWalletNotFound(true); - } - }}> - - - - MetaMask - - - - - connectToWallet('walletconnect')}> - - - - WalletConnect - - - - - } - - ) -} - -export default React.memo(WalletSelectorModal) diff --git a/packages/boba/gateway/src/containers/modals/walletSelector/styles.ts b/packages/boba/gateway/src/containers/modals/walletSelector/styles.ts deleted file mode 100644 index ebdb040813..0000000000 --- a/packages/boba/gateway/src/containers/modals/walletSelector/styles.ts +++ /dev/null @@ -1,41 +0,0 @@ -import styled from 'styled-components' - -export const Wallets = styled.div` - display: flex; - flex-direction: column; - width: 100%; -` - -export const Wallet = styled.div` - display: flex; - width: 100%; - padding: 10px 16px; - border-radius: 8px; - justify-content: flex-start; - align-items: center; - cursor: pointer; - gap: 0px 10px; - &:hover { - background: ${(props) => props.theme.colors.gray[400]}; - } -` - -export const IconContainer = styled.div` - display: flex; - align-items: center; - justify-content: center; - width: 38px; - height: 38px; - padding: 5px; - border-radius: 40px; - background: ${(props) => props.theme.colors.gray[400]}; -` -export const Icon = styled.img` - width: 100%; - height: auto; -` - -export const ArrowContainer = styled.div` - margin-left: auto; - margin-right: 5px; -` diff --git a/packages/boba/gateway/src/containers/modals/wrongNetwork/WrongNetworkModal.tsx b/packages/boba/gateway/src/containers/modals/wrongNetwork/WrongNetworkModal.tsx deleted file mode 100644 index 2f2114a2ad..0000000000 --- a/packages/boba/gateway/src/containers/modals/wrongNetwork/WrongNetworkModal.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { FC, useEffect } from 'react' -import { useDispatch, useSelector } from 'react-redux' - -import Modal from 'components/modal/Modal' - -import { setConnect, setConnectETH } from 'actions/setupAction' -import { restTokenList } from 'actions/tokenAction' -import { closeModal } from 'actions/uiAction' - -import { Button } from 'components/global' -import { selectActiveNetworkType, selectNetwork } from 'selectors' - -interface Props { - open: boolean -} - -const WrongNetworkModal: FC = ({ open }) => { - const dispatch = useDispatch() - const network = useSelector(selectNetwork()) - const networkType = useSelector(selectActiveNetworkType()) - - useEffect(() => { - if (open) { - dispatch(restTokenList()) - } - }, [dispatch, open]) - - const handleClose = () => { - dispatch(setConnect(false)) - dispatch(closeModal('wrongNetworkModal')) - } - - return ( - -