diff --git a/.github/deployed-bytecode-consts.js b/.github/deployed-bytecode-consts.js index 4959d22f2..f82ca979e 100644 --- a/.github/deployed-bytecode-consts.js +++ b/.github/deployed-bytecode-consts.js @@ -1,7 +1,6 @@ const APPS_TO_NAMES = new Map([ ['lido', 'Lido'], ['node-operators-registry', 'NodeOperatorsRegistry'], - ['oracle', 'LidoOracle'] ]) const CONTRACTS_TO_NAMES = new Map([ diff --git a/apps/lidooracle/app/.babelrc b/apps/lidooracle/app/.babelrc deleted file mode 100644 index 13d2b95a1..000000000 --- a/apps/lidooracle/app/.babelrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "modules": false, - "targets": { - "browsers": [ - "> 1%", - "last 3 versions", - "ie >= 9", - "ios >= 8", - "android >= 4.2" - ] - }, - "useBuiltIns": "entry", - "corejs": 3, - "shippedProposals": true, - } - ] - ], - "plugins": [ - [ - "styled-components", - { - "displayName": true - } - ] - ] -} diff --git a/apps/lidooracle/app/.eslintrc b/apps/lidooracle/app/.eslintrc deleted file mode 100644 index b6dad13e0..000000000 --- a/apps/lidooracle/app/.eslintrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "env": { - "browser": true, - "es6": true - }, - "extends": [ - "standard", - "standard-react", - "plugin:prettier/recommended", - "prettier/react" - ], - "parser": "babel-eslint", - "plugins": ["prettier", "react", "react-hooks"], - "rules": { - "valid-jsdoc": "error", - "react/prop-types": 0, - "linebreak-style": ["error", "unix"], - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn", - "no-unused-vars": "warn", - "react/jsx-handler-names": "off", - "react/jsx-key": "off" - } -} diff --git a/apps/lidooracle/app/.gitignore b/apps/lidooracle/app/.gitignore deleted file mode 100644 index 8c784e35c..000000000 --- a/apps/lidooracle/app/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# cache -.cache - -# dependencies -/node_modules - -# testing -/coverage - -# production -/build -/dist - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# built assets -/public/aragon-ui -/public/script.js -/public/script.map diff --git a/apps/lidooracle/app/.prettierrc b/apps/lidooracle/app/.prettierrc deleted file mode 100644 index 5824bbabb..000000000 --- a/apps/lidooracle/app/.prettierrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "singleQuote": true, - "semi": false, - "trailingComma": "es5", - "bracketSpacing": true, - "jsxBracketSameLine": false -} diff --git a/apps/lidooracle/app/index.html b/apps/lidooracle/app/index.html deleted file mode 100644 index 07f0586fb..000000000 --- a/apps/lidooracle/app/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - Aragon App - - - -
- - - diff --git a/apps/lidooracle/app/package.json b/apps/lidooracle/app/package.json deleted file mode 100644 index f2c83046b..000000000 --- a/apps/lidooracle/app/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "lidooracle-frontend", - "version": "1.0.0", - "main": "src/index.js", - "dependencies": { - "@aragon/api": "^2.0.0", - "@aragon/api-react": "^2.0.0", - "@aragon/ui": "^1.7.0", - "@openzeppelin/contracts": "3.1.0", - "core-js": "^3.6.5", - "formik": "^2.2.0", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "regenerator-runtime": "^0.13.7", - "styled-components": "^5.2.0", - "web3-utils": "^1.3.0", - "yup": "^0.29.3" - }, - "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/preset-env": "^7.11.5", - "@babel/preset-react": "^7.10.1", - "babel-eslint": "^10.1.0", - "babel-plugin-styled-components": "^1.11.1", - "copyfiles": "^2.3.0", - "eslint": "^7.9.0", - "eslint-config-prettier": "^6.11.0", - "eslint-config-standard": "^14.1.1", - "eslint-config-standard-react": "^9.2.0", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.1.4", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-react": "^7.20.6", - "eslint-plugin-react-hooks": "^4.1.2", - "eslint-plugin-standard": "^4.0.1", - "parcel-bundler": "^1.12.4", - "prettier": "^2.1.2" - }, - "scripts": { - "build": "yarn sync-assets && yarn build:app && yarn build:script", - "build:app": "parcel build index.html -d ../dist/ --public-url \".\" --no-cache", - "build:script": "parcel build src/script.js --out-dir ../dist/ --no-cache", - "watch:script": "parcel watch src/script.js --out-dir ../dist/ --no-hmr", - "serve": "parcel serve index.html --out-dir ../dist/ --no-cache", - "watch": "yarn watch:script", - "sync-assets": "copy-aragon-ui-assets ../dist && copyfiles -u 1 './public/**/*' ../dist", - "start": "yarn sync-assets && yarn watch:script & yarn serve", - "dev": "yarn sync-assets && yarn watch:script & yarn serve -- --port 3011", - "dev-fallback": "bash -c 'yarn sync-assets && yarn watch:script & yarn serve --port 3011'" - } -} diff --git a/apps/lidooracle/app/public/meta/details.md b/apps/lidooracle/app/public/meta/details.md deleted file mode 100644 index fb71ccc9d..000000000 --- a/apps/lidooracle/app/public/meta/details.md +++ /dev/null @@ -1,6 +0,0 @@ -An application for Aragon. - -**Features** -- Feature \#1. -- Feature \#2. -- Feature \#3. diff --git a/apps/lidooracle/app/public/meta/icon.svg b/apps/lidooracle/app/public/meta/icon.svg deleted file mode 100644 index 546d85afe..000000000 --- a/apps/lidooracle/app/public/meta/icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/lidooracle/app/public/meta/screenshot-1.png b/apps/lidooracle/app/public/meta/screenshot-1.png deleted file mode 100644 index b7f817650..000000000 Binary files a/apps/lidooracle/app/public/meta/screenshot-1.png and /dev/null differ diff --git a/apps/lidooracle/app/src/App.js b/apps/lidooracle/app/src/App.js deleted file mode 100644 index 335ff31f9..000000000 --- a/apps/lidooracle/app/src/App.js +++ /dev/null @@ -1,454 +0,0 @@ -import React, { useCallback, useState } from 'react' -import { useAragonApi } from '@aragon/api-react' -import { - Button, - ContextMenu, - DataView, - GU, - Header, - IconTrash, - IdentityBadge, - Main, - Split, - SyncIndicator, - textStyle, - useTheme, -} from '@aragon/ui' -import AddMemberSidePanel from './components/AddMemberSidePanel' -import MenuItem from './components/MenuItem' -import InfoBox from './components/InfoBox' -import ChangeQuorumSidePanel from './components/ChangeQuorumSidePanel' -import ChangeBeaconReportReceiverSidePanel from './components/ChangeBeaconReportReceiverSidePanel' -import IconEdit from '@aragon/ui/dist/IconEdit' -import ChangeIncreaseSidePanel from './components/ChangeIncreaseSidePanel' -import ChangeDecreaseSidePanel from './components/ChangeDecreaseSidePanel' -import { constants, ethers } from 'ethers' - -export default function App() { - const { api, appState, currentApp, guiStyle } = useAragonApi() - const theme = useTheme() - const { - isSyncing, - oracleMembers, - quorum, - currentFrame, - expectedEpochId, - currentOraclesReportStatus, - allowedBeaconBalanceAnnualRelativeIncrease, - allowedBeaconBalanceRelativeDecrease, - beaconReportReceiver, - currentReportVariants, - lastCompletedReportDelta, - version, - } = appState - const { appearance } = guiStyle - const appName = (currentApp && currentApp.name) || 'app' - - // MEMBERS - - const [addMemberSidePanelOpen, setAddMemberSidePanelOpen] = useState(false) - - const openAddMemberSidePanel = useCallback( - () => setAddMemberSidePanelOpen(true), - [] - ) - - const closeAddMemberSidePanel = useCallback( - () => setAddMemberSidePanelOpen(false), - [] - ) - - const addOracleMember = useCallback( - (address) => { - return api.addOracleMember(address).toPromise() - }, - [api] - ) - - const removeOracleMember = useCallback( - (address) => { - return api.removeOracleMember(address).toPromise() - }, - [api] - ) - - // INCREASE - const [increaseSidePanelOpen, setIncreaseSidePanelOpen] = useState(false) - - const openIncreaseSidePanel = useCallback( - () => setIncreaseSidePanelOpen(true), - [] - ) - - const closeIncreaseSidePanel = useCallback( - () => setIncreaseSidePanelOpen(false), - [] - ) - - const changeIncrease = useCallback( - (value) => { - return api - .setAllowedBeaconBalanceAnnualRelativeIncrease(value) - .toPromise() - }, - [api] - ) - - // DECREASE - const [decreaseSidePanelOpen, setDecreaseSidePanelOpen] = useState(false) - - const openDecreaseSidePanel = useCallback( - () => setDecreaseSidePanelOpen(true), - [] - ) - - const closeDecreaseSidePanel = useCallback( - () => setDecreaseSidePanelOpen(false), - [] - ) - - const changeDecrease = useCallback( - (value) => { - return api.setAllowedBeaconBalanceRelativeDecrease(value).toPromise() - }, - [api] - ) - - // QUORUM - const [changeQuorumSidePanelOpen, setChangeQuorumSidePanelOpen] = useState( - false - ) - - const openChangeQuorumSidePanel = useCallback( - () => setChangeQuorumSidePanelOpen(true), - [] - ) - - const closeChangeQuorumSidePanel = useCallback( - () => setChangeQuorumSidePanelOpen(false), - [] - ) - - const setQuorum = useCallback( - (quorum) => { - return api.setQuorum(quorum).toPromise() - }, - [api] - ) - - // BEACON REPORT RECEIVER - const [ - reportReceiverSidePanelOpen, - setReportReceiverSidePanelOpen, - ] = useState(false) - - const openReportReceiverSidePanel = useCallback( - () => setReportReceiverSidePanelOpen(true), - [] - ) - const closeReportReceiverSidePanel = useCallback( - () => setReportReceiverSidePanelOpen(false), - [] - ) - - const setBeaconReceiver = useCallback( - (address) => { - return api.setBeaconReportReceiver(address).toPromise() - }, - [api] - ) - - // RENDER ELEMENTS - - const currentFrameEl = renderCurrentFrame(currentFrame) - const lastCompletedReportDeltaEl = renderLastCompletedReportDelta( - lastCompletedReportDelta - ) - - const renderSettings = useCallback( - (value, i) => { - switch (i) { - case 0: - return [ - 'Max Allowed APR', -
- {value ? `${value / 100}%` : 'Unavailable'} -
, - ] - case 1: - return [ - 'Drop Limit Between Frames', -
- {value ? `${value / 100}%` : 'Unavailable'} -
, - ] - case 2: - return [ - 'Beacon Report Receiver', -
- -
, - ] - default: - return null - } - }, - [openDecreaseSidePanel, openIncreaseSidePanel, openReportReceiverSidePanel] - ) - - return ( -
- {isSyncing && } -
- } - /> - - [ - , - - {(2 ** i) & currentOraclesReportStatus ? 'Submitted' : ''} - , - ]} - renderEntryActions={(memberAddress) => ( - - removeOracleMember(memberAddress)} - label="delete" - icon={} - iconColor={theme.negative} - /> - - )} - /> -

- Current Report Variants -

- [ - {i}, - {beaconBalance} gwei, - {beaconValidators}, - {count}, - ]} - /> -

- Settings -

- - - } - secondary={ - <> - - - {currentFrameEl && ( - api.emitTrigger('UI:UpdateFrame')} - /> - )} - {lastCompletedReportDeltaEl && ( - - )} - {version && ( -

- Lido Oracle v{+version + 1} -

- )} - - } - /> - - - - - -
- ) -} - -function renderCurrentFrame(frame) { - if (!frame) { - return null - } - return ( - <> - - - - - ) -} - -function renderLastCompletedReportDelta(lastCompletedReportDelta) { - if (!lastCompletedReportDelta) return null - - return ( - <> - - - - - ) -} - -function LabelValue({ label, value }) { - return ( -
-

- {label} -

-

- {value} -

-
- ) -} - -function formatUnixTime(unixTime) { - return new Date(1000 * unixTime).toISOString().replace(/[.]\d+Z$/, 'Z') -} diff --git a/apps/lidooracle/app/src/components/AddMemberSidePanel.js b/apps/lidooracle/app/src/components/AddMemberSidePanel.js deleted file mode 100644 index cb21e90b1..000000000 --- a/apps/lidooracle/app/src/components/AddMemberSidePanel.js +++ /dev/null @@ -1,77 +0,0 @@ -import { Button, GU, SidePanel } from '@aragon/ui' -import React, { useCallback } from 'react' -import { Formik, Field } from 'formik' -import * as yup from 'yup' -import TextField from './TextField' -import Info from '@aragon/ui/dist/Info' - -const initialValues = { - address: '', -} - -const validationSchema = yup.object().shape({ - address: yup.string().required().min(1), -}) - -function PanelContent({ api, onClose }) { - const onSubmit = useCallback( - ({ address }) => { - api(address).then(() => { - onClose() - }) - }, - [api, onClose] - ) - - return ( - - {({ submitForm, isSubmitting }) => { - return ( -
{ - e.preventDefault() - submitForm() - }} - > - - This action will add an oracle member. - - -