Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/clone nor simpledvt holesky #801

Merged
merged 57 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
4ee8ada
test: clone module
krogla Aug 31, 2023
d6e87d1
test: refactor dao factory
krogla Sep 7, 2023
1ea7f42
feat: clone NOR scripts
krogla Sep 7, 2023
01a63f2
fix: config block gas limit
krogla Sep 7, 2023
d62005c
fix: add module role on Agent
krogla Sep 14, 2023
6245bee
feat: add simple dvt aragon ui
krogla Sep 14, 2023
d2e4796
fix: hardcode simple dvt ui ipfs cid
krogla Sep 14, 2023
671a192
fix: custom module manager + post deploy checks
krogla Sep 22, 2023
f799e46
fix: post deploy checks
krogla Sep 22, 2023
faf9a3c
fix: remove custom manager
krogla Sep 25, 2023
f18b09a
fix: direct voting tx from deployer
krogla Sep 26, 2023
00ba894
Merge branch 'feat/scratch-holesky' into clone-nor-simpledvt-holesky
krogla Oct 3, 2023
9499b53
fix: deploy simpledvt proxy
krogla Oct 3, 2023
87272fe
fix: easytrack permissions
krogla Oct 8, 2023
a132f8d
fix: check deployed with easytrak
krogla Oct 8, 2023
8373964
fix: check created voting
krogla Oct 9, 2023
8e2b3ce
fix: deployed app proxy - goerli
krogla Oct 9, 2023
0a9eb95
Merge branch 'feat/scratch-holesky' into clone-nor-simpledvt-holesky
krogla Oct 9, 2023
ab98b5c
Merge branch 'clone-nor-simpledvt' into clone-nor-simpledvt-holesky
krogla Oct 9, 2023
02a2b14
fix: refactor
krogla Oct 9, 2023
bdfe635
Merge branch 'clone-nor-simpledvt' into clone-nor-simpledvt-holesky
krogla Oct 9, 2023
3a9f559
Merge branch 'feat/scratch-holesky' into clone-nor-simpledvt-holesky
krogla Oct 9, 2023
e984114
Merge branch 'feat/scratch-holesky' into clone-nor-simpledvt-holesky
krogla Oct 11, 2023
4eec85c
fix: missed log data
krogla Oct 11, 2023
66f51be
fix: revert localhost config
krogla Oct 11, 2023
0a16ee4
fix: read state kernel address
krogla Oct 11, 2023
7fcfbfd
Merge branch 'clone-nor-simpledvt' into clone-nor-simpledvt-holesky
krogla Oct 11, 2023
57d4f5b
fix: missed log data
krogla Oct 11, 2023
a67d158
fix: simpledvt deploy and checks
krogla Oct 12, 2023
9749698
fix: simpledvt deploy and checks
krogla Oct 12, 2023
fc7f4d8
fix: deployed holesky data, fixes
krogla Oct 12, 2023
dfb4353
fix: add REQUEST_BURN_SHARES_ROLE
krogla Oct 17, 2023
a334d87
Merge branch 'feat/scratch-holesky' into clone-nor-simpledvt-holesky
krogla Oct 18, 2023
b401b1c
Merge branch 'clone-nor-simpledvt' into clone-nor-simpledvt-holesky
krogla Oct 18, 2023
023676a
fix: module type
krogla Oct 19, 2023
b838209
fix: acceptance test for empty proxy
krogla Oct 19, 2023
d31d37f
feat: decode evm script + pause prompt
krogla Oct 23, 2023
e8bc073
test: et extended checks
krogla Oct 23, 2023
a14afc8
fix: goerli module type
krogla Oct 23, 2023
39ac4c8
fix: checks and no def value for params
krogla Oct 23, 2023
260ff35
fix: factory name
krogla Oct 23, 2023
62f57be
fix: simple dvt ui: sample env
krogla Oct 23, 2023
6397370
fix: easytrack factories
krogla Oct 23, 2023
2ef88ab
feat: commit-holesky-changes
mkurayan Oct 23, 2023
c3756aa
fix: accounts.json sample cleanup
krogla Oct 23, 2023
f83ff6d
fix: minor deploy flow changes
krogla Oct 23, 2023
a6240d4
Merge branch 'feat/scratch-holesky' into feat/clone-nor-simpledvt-hol…
krogla Oct 23, 2023
ce07567
fix: check trustedCaller, enhance simulation logic
krogla Oct 25, 2023
9b1c869
Merge branch 'develop' into feat/clone-nor-simpledvt-holesky
krogla Dec 5, 2023
ac0564d
fix: simple dvt deploy scripts
krogla Dec 7, 2023
23dad88
fix: deploy scripts: show deployer
krogla Dec 7, 2023
b4038dd
fix: mainnet deployed data
krogla Dec 7, 2023
d487323
fix: test oracle report on simpledvt
krogla Dec 19, 2023
2b8edc0
fix: mainnet easytrack contracts
krogla Jan 15, 2024
9e19e93
fix: oracle quorum in tests
krogla Jan 15, 2024
afaadb3
Merge branch 'develop' into feat/clone-nor-simpledvt-holesky
krogla Jan 26, 2024
54c7846
fix: deployed-mainnet.json update
krogla Feb 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions accounts.sample.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
{
"eth": {
"localhost": {
"dev-example": {
"mnemonic": "test test test test test test test test test test test junk",
"path": "m/44'/60'/0'/0",
"initialIndex": 0,
"count": 20
},
"dev": {
"mnemonic": "rich dune dash tag exercise veteran sword speed spike absorb disease brush bracket doll noodle",
"path": "m/44'/60'/0'/0",
"initialIndex": 0,
"count": 20
},
"e2e": {
"mnemonic": "explain tackle mirror kit van hammer degree position ginger unfair soup bonus",
"path": "m/44'/60'/0'/0",
"initialIndex": 0,
"count": 50
},
"mainnet-fork-shapella-upgrade": ["4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]
"fork-example": ["ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"]
},
"infura": {
"projectId": "INFURA_PROJECT_ID"
Expand Down
82 changes: 82 additions & 0 deletions apps/simple-dvt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# StakingRouter Aragon App

This directory contains source files for the [StakingRouter Aragon frontend app](https://mainnet.lido.fi/#/lido-dao/0x55032650b14df07b85bf18a3a3ec8e0af2e028d5/).

## Verifying source code

To verify that the StakingRouter app frontend was built from this source code, please follow instructions below.

### Prerequisites

- git
- Node.js 16.14.2
- ipfs 0.19.0

### 1. Replicating IPFS hash and content URI

Clone the Lido DAO repo,

```bash
git clone https://github.com/lidofinance/lido-dao.git
```

Go into the directory,

```bash
cd lido-dao
```

Checkout [this commit](https://github.com/lidofinance/lido-dao/commit/34f5d0d428fcb51aae74f0cb7387b9bd59916817) (the latest `yarn.lock` update for the StakingRouter app),

```bash
git checkout 34f5d0d428fcb51aae74f0cb7387b9bd59916817
```

Install dependencies **without updating the lockfile**. This will make sure that you're using the same versions of the dependencies that were used to develop the app,

```bash
yarn install --immutable
```

Build the static assets for the app,

```bash
# legacy app name
export APPS=simple-dvt
npx hardhat run scripts/build-apps-frontend.js
```

Get the IPFS hash of the build folder,

```bash
ipfs add -qr --only-hash apps/simple-dvt/dist/ | tail -n 1
```


This command should output `QmaSSujHCGcnFuetAPGwVW5BegaMBvn5SCsgi3LSfvraSo`.


Now we have to obtain the content URI, which is this hash encoded for Aragon.

Now we run the script,

```bash
export IPFS_HASH=QmaSSujHCGcnFuetAPGwVW5BegaMBvn5SCsgi3LSfvraSo
npx hardhat run scripts/helpers/getContentUri.js
```

This command should print `0x697066733a516d54346a64693146684d454b5576575351316877786e33365748394b6a656743755a7441684a6b6368526b7a70`, which is our content URI.

### 2. Verifying on-chain StakingRouter App content URI

Open the [NodeOperatorsRegistry App Repo](https://etherscan.io/address/0x0D97E876ad14DB2b183CFeEB8aa1A5C788eB1831#readProxyContract) and scroll down to `getLatest` method, open the dropdown and click "Query". This will give you the NodeOperatorsRegistry app version, contract address and the content URI. Now check that the content URI that you've obtained in the previous step matches the one that Etherscan fetched for you from the contract.

### 3. Verifying client-side resources

Now that we have the IPFS hash and content URI, let's see that it is, in fact, the one that's used on the DAO website.

Open the [StakingRouter app](https://mainnet.lido.fi/#/lido-dao/0x55032650b14df07b85bf18a3a3ec8e0af2e028d5/) in your browser, then open the network inspector and refresh the page to track all of the network requests that the website makes.

You will find that one of the two HTML files has, in fact, been loaded from `https://ipfs.mainnet.fi/ipfs/QmaSSujHCGcnFuetAPGwVW5BegaMBvn5SCsgi3LSfvraSo/index.html`.

You are done! ✨
30 changes: 30 additions & 0 deletions apps/simple-dvt/app/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"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
}
]
]
}
21 changes: 21 additions & 0 deletions apps/simple-dvt/app/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"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"
}
}
31 changes: 31 additions & 0 deletions apps/simple-dvt/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# cache
.cache

# dependencies
/node_modules

# testing
/coverage

# production
/build
/dist

# misc
.env
.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
7 changes: 7 additions & 0 deletions apps/simple-dvt/app/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false
}
16 changes: 16 additions & 0 deletions apps/simple-dvt/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Aragon App</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script src="./src/index.js"></script>
</body>
</html>
50 changes: 50 additions & 0 deletions apps/simple-dvt/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "simple-dvt-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",
"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",
"yup": "^0.29.3"
},
"devDependencies": {
"@babel/core": "^7.21.0",
"@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": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-react": "^9.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-standard": "^5.0.0",
"parcel-bundler": "^1.12.4",
"prettier": "^2.8.4"
},
"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 3012",
"dev-fallback": "bash -c 'yarn sync-assets && yarn watch:script & yarn serve --port 3012'"
}
}
6 changes: 6 additions & 0 deletions apps/simple-dvt/app/public/meta/details.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
An application for Aragon.

**Features**
- Feature \#1.
- Feature \#2.
- Feature \#3.
1 change: 1 addition & 0 deletions apps/simple-dvt/app/public/meta/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/simple-dvt/app/public/meta/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/simple-dvt/app/sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SK_LIMIT=20
SUBGRAPH_ENDPOINT=https://holesky.lido.fi/key-checker/api/subgraph
SIGNATURE_VERIFY_ENDPOINT=https://holesky.lido.fi/key-checker/api/signature
36 changes: 36 additions & 0 deletions apps/simple-dvt/app/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react'
import { useAragonApi, useGuiStyle } from '@aragon/api-react'
import {
Button,
Header,
Main,
Split,
SyncIndicator,
useTheme,
} from '@aragon/ui'
import { ThemeProvider } from 'styled-components'
import { SimpleDVTPrimary, SimpleDVTSecondary } from './components/SimpleDVT'

const App = () => {
const { appState } = useAragonApi()
const { appearance } = useGuiStyle()
const { isSyncing } = appState

console.log(appState)

const theme = useTheme()

return (
<Main theme={appearance}>
<ThemeProvider theme={theme}>
<SyncIndicator visible={isSyncing} shift={50} />
<Header
primary="SimpleDVT"
/>
<Split primary={<SimpleDVTPrimary />} secondary={<SimpleDVTSecondary />} />
</ThemeProvider>
</Main>
)
}

export default App
76 changes: 76 additions & 0 deletions apps/simple-dvt/app/src/components/AddNodeOperatorSidePanel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { Button, GU, SidePanel } from '@aragon/ui'
import React from 'react'
import { Formik, Field } from 'formik'
import * as yup from 'yup'
import TextField from './TextField'

const initialValues = {
name: '',
address: '',
}

const validationSchema = yup.object().shape({
name: yup.string().required().min(1),
address: yup.string().required().min(1),
})

function PanelContent({ addNodeOperatorApi, onClose }) {
const onSubmit = ({ name, address }) => {
addNodeOperatorApi(name, address)
.catch(console.error)
.finally(() => {
onClose()
})
}

return (
<Formik
initialValues={initialValues}
validationSchema={validationSchema}
onSubmit={onSubmit}
validateOnBlur={false}
validateOnChange={false}
>
{({ submitForm, isSubmitting, errors, values }) => {
return (
<form
css={`
margin-top: ${3 * GU}px;
`}
onSubmit={(e) => {
e.preventDefault()
submitForm()
}}
>
<pre>
{JSON.stringify(errors, null, 2)}
{JSON.stringify(values, null, 2)}
</pre>
<Field name="name" label="Name" required component={TextField} />
<Field
name="address"
label="Address"
required
component={TextField}
/>

<Button
mode="strong"
wide
required
disabled={isSubmitting}
label="Add Node Operator"
type="submit"
/>
</form>
)
}}
</Formik>
)
}

export default (props) => (
<SidePanel title="ADD NODE OPERATOR" {...props}>
<PanelContent {...props} />
</SidePanel>
)
Loading
Loading