Skip to content

Commit

Permalink
Merge pull request #418 from consensusnetworks/develop
Browse files Browse the repository at this point in the history
Promote develop to master
  • Loading branch information
shanejearley authored Oct 24, 2023
2 parents 7d5f658 + ca96cae commit a51906f
Show file tree
Hide file tree
Showing 334 changed files with 20,661 additions and 19,697 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"quotes": ["error", "single"]
},
"ignorePatterns": [
"contracts/**/scripts/resources",
"scripts/**/resources",
"lib",
"cdk.out",
"*.js"
]
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install mdBook plugins
uses: actions-rs/cargo@v1
with:
command: install
args: mdbook-katex mdbook-mermaid

- name: Install and build all package dependencies
run: npm ci
env:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ jobs:

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install mdBook plugins
uses: actions-rs/cargo@v1
with:
command: install
args: mdbook-katex mdbook-mermaid

- name: Install and build all package dependencies
run: npm ci
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install mdBook plugins
uses: actions-rs/cargo@v1
with:
command: install
args: mdbook-katex mdbook-mermaid

- name: Install and build all package dependencies
run: npm ci
env:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install mdBook plugins
uses: actions-rs/cargo@v1
with:
command: install
args: mdbook-katex mdbook-mermaid

- name: Install and build all package dependencies
run: npm ci
env:
Expand Down
31 changes: 8 additions & 23 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
[submodule "scripts/ledger/resources/app-bitcoin"]
path = scripts/ledger/resources/app-bitcoin
url = https://github.com/LedgerHQ/app-bitcoin-new.git
[submodule "scripts/ledger/resources/app-ethereum"]
path = scripts/ledger/resources/app-ethereum
url = https://github.com/LedgerHQ/app-ethereum.git
[submodule "scripts/ledger/resources/app-solana"]
path = scripts/ledger/resources/app-solana
url = https://github.com/LedgerHQ/app-solana.git
[submodule "scripts/ledger/resources/speculos"]
path = scripts/ledger/resources/speculos
url = https://github.com/LedgerHQ/speculos.git
[submodule "scripts/trezor/resources/trezor-user-env"]
path = scripts/trezor/resources/trezor-user-env
url = https://github.com/trezor/trezor-user-env.git
[submodule "contracts/ethereum/scripts/resources/ssv-network"]
path = contracts/ethereum/scripts/resources/ssv-network
url = https://github.com/bloxapp/ssv-network.git
branch = contract-v3
[submodule "contracts/ethereum/lib/forge-std"]
path = contracts/ethereum/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "services/oracle/scripts/resources/rockx-dkg-cli"]
path = services/oracle/scripts/resources/rockx-dkg-cli
url = https://github.com/RockX-SG/rockx-dkg-cli.git
branch = main
[submodule "contracts/ethereum/lib/ssv-network"]
path = contracts/ethereum/lib/ssv-network
url = https://github.com/bloxapp/ssv-network.git
branch = jato-v2
[submodule "services/oracle/lib/dkg"]
path = services/oracle/lib/dkg
url = https://github.com/consensusnetworks/ssv-dkg.git
branch = feature/operator-env
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@
"typescript"
],
"css.lint.unknownAtRules": "ignore",
"jupyter.notebookFileRoot": "${fileDirname}",
"volar.inlayHints.eventArgumentInInlineHandlers": false
}
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img width="50px" alt="Casimir logo" src="common/images/casimir.png">
<img width="50px" alt="Casimir logo" src="casimir.png">

# Casimir

Expand Down Expand Up @@ -41,15 +41,11 @@ Configure the following prerequisite global dependency versions.

1. [Docker (v24.x)](https://docs.docker.com/engine/install/).

2. [Git (v2.x)](https://git-scm.com/downloads)
2. [Go (v1.18.x)](https://golang.org/doc/install).

> 🚩 GitHub submodule support: You also need to make sure to have at least one SSH authentication key on your GitHub account (for the git cloning of submodules in various scripts). See [Adding a new SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).
3. [Node.js (v18.x)](https://nodejs.org/en/download/).

3. [Go (v1.18.x)](https://golang.org/doc/install).

4. [Node.js (v18.x)](https://nodejs.org/en/download/).

5. [Optional: AWS CLI (v2.x)](https://aws.amazon.com/cli/)
4. [Optional: AWS CLI (v2.x)](https://aws.amazon.com/cli/)

> 🚩 **Consensus Networks team only**: Create an [AWS profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) named `consensus-networks-dev`.
Expand Down Expand Up @@ -125,17 +121,12 @@ echo "USE_SECRETS=false" > .env
| `ETHEREUM_RPC_URL` | Ethereum RPC network URL | `http://127.0.0.1:8545` |
| `NETWORK` | Network name (`mainnet || testnet || hardhat || localhost`) | `localhost` |
| `FORK` | Fork network name (`mainnet || testnet || hardhat`) | `testnet` |
| `MANAGER_ADDRESS` | Manager contract address | (predicted manager address) |
| `VIEWS_ADDRESS` | Views contract address | (predicted views address) |
| `FACTORY_ADDRESS` | Base factory contract address | (predicted factory address) |
| `CRYPTO_COMPARE_API_KEY` | CryptoCompare API key | `` |
| `TUNNEL` | Whether to tunnel local network RPC URLs (for remote wallets) | `false` |
| `EMULATE` | Whether to emulate wallets | `false` |
| `LEDGER_APP` | Ledger app name | `ethereum` |
| `MOCK_SERVICES` | Whether to mock backend services | `true` |
| `BUILD_PREVIEW` | Whether to preview web app production build | `false` |

> 🚩 While running the Ledger Speculos emulator on MacOS (with EMULATORS=true), if you get a surprising error that port 5000 is in use, go to  > System Preferences... > Sharing and uncheck Airplay Receiver.
### Apps

The apps packages provide a UI to end-users.
Expand Down Expand Up @@ -192,8 +183,6 @@ The common packages provide shared code for the project:

- [@casimir/aws](common/aws): AWS helpers
- [@casimir/data](common/data): data schemas and operational workflows
- [@casimir/helpers](common/helpers): general utilities
- [@casimir/speculos](common/speculos): Ledger emulator helpers
- [@casimir/ssv](common/ssv): SSV helpers
- [@casimir/types](common/types): shared types
- [@casimir/uniswap](common/uniswap): Uniswap helpers
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cache
dist
61 changes: 61 additions & 0 deletions apps/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { withMermaid } from 'vitepress-plugin-mermaid'

// https://vitepress.dev/reference/site-config
export default withMermaid({
title: "Casimir Docs",
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
rewrites: {
'index.md': 'introduction/what-is-casimir.md',
},
cleanUrls: true,
markdown: {
math: true
},
srcDir: 'src',
outDir: './dist',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: '/casimir.svg',
search: {
provider: 'local'
},
sidebar: [
{
text: 'Introduction',
base: '/introduction',
items: [
{ text: 'What is Casimir?', link: '/what-is-casimir' },
{ text: 'Architecture', link: '/architecture' }
]
},
{
text: 'Guide',
base: '/guide',
items: [
{ text: 'Accounts', link: '/accounts' },
{ text: 'Staking', link: '/staking' },
{ text: 'Operating', link: '/operating' }
]
},
{
text: 'Reference',
base: '/reference',
items: [
{ text: 'Contract Addresses', link: '/contract-addresses' },
{ text: 'Solidity API', link: '/solidity-api' }
]
},
{
text: 'Troubleshooting',
base: '/troubleshooting',
items: [
{ text: 'Operator Issues', link: '/operator-issues' },
{ text: 'Wallet Issues', link: '/wallet-issues' }
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/consensusnetworks/casimir' }
]
}
})
1 change: 1 addition & 0 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @casimir/docs
20 changes: 20 additions & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@casimir/docs",
"private": "true",
"scripts": {
"dev": "npx vitepress dev",
"docgen": "npx esno -r dotenv/config ./scripts/docgen.ts",
"build": "npx vitepress build",
"preview": "npx vitepress preview",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@types/node": "^17.0.38",
"dotenv": "^16.3.1",
"esno": "0.17.0",
"markdown-it-mathjax3": "^4.3.2",
"mermaid": "^10.5.1",
"vitepress": "^1.0.0-rc.23",
"vitepress-plugin-mermaid": "^2.0.15"
}
}
7 changes: 7 additions & 0 deletions apps/docs/scripts/docgen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { run } from '@casimir/shell'

void async function () {
const outputDir = `${process.cwd()}/src/reference`
const templateDir = `${process.cwd()}/templates/solidity`
await run(`DOCS_OUTPUT_DIR=${outputDir} DOCS_TEMPLATE_DIR=${templateDir} npm run docgen --workspace @casimir/ethereum`)
}()
5 changes: 5 additions & 0 deletions apps/docs/src/guide/accounts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
::: warning
🚧 This page is incomplete.
:::

# Accounts
7 changes: 7 additions & 0 deletions apps/docs/src/guide/operating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
::: warning
🚧 This page is incomplete.
:::

# Operating

Operators owners will need to [set up an SSV node with RockX](https://github.com/consensusnetworks/ssv-dkg) and register with Casimir. The operators page in the Casimir app guides an owner through the process and provides an easy interface for registration and operator management.
7 changes: 7 additions & 0 deletions apps/docs/src/guide/staking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
::: warning
🚧 This page is incomplete.
:::

# Staking

Users can deposit any amount of ETH to the manager contract. Their deposits are staked to validators run by SSV operators (see [Operators](#operators)). Rewards are auto-compounded into stake and users can withdraw their principal plus any earned proportion of new stake (or a partial amount of their choice) at any time.
17 changes: 17 additions & 0 deletions apps/docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
::: warning
🚧 This page is incomplete.
:::

# What is Casimir?

Casimir is a platform... TODO

## Casimir Ethereum Staking

Currlently stakers either need to solo-stake (and have least 32 Ether), or they need to pool their assets in a liquid staking protocol (LSD). While the former choice is a reliably secure choice for Ether holders (if they have solid infrastructure), the latter, LSDs, often present an inherent counterparty risk to the user because of their centralized control of staking node operators (see [The Risks of LSD](https://notes.ethereum.org/@djrtwo/risks-of-lsd)).

Casimir is designed to offer users the experience and security of solo-staking while pooling their assets. The Casimir contracts seamlessly connect stakers with any amount of Ether to a permissionless registry of high-performing node operators. Casimir aims to minimize counterparty risk for users and improve decentralization in Ethereum staking:

- Validators duties are performed by registered (collateralized) operators running distributed validator technology (DVT)
- Keys are created and reshared using distributed key generation (DKG)
- Balance and status reports are reported by a decentralized oracle network (DON)
Loading

0 comments on commit a51906f

Please sign in to comment.