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

Deploy v1 public beta contracts #434

Merged
merged 38 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e904518
Migrate oracle to new dkg lib
shanejearley Oct 5, 2023
b748dfa
Fix operator test
shanejearley Oct 7, 2023
4b61186
Change example filenames
shanejearley Oct 7, 2023
53330ae
Merge branch 'develop' into test/new-dkg
shanejearley Oct 7, 2023
52fccdd
Remove remote submodule pull
shanejearley Oct 8, 2023
1c30ebd
Add contract tasks
shanejearley Oct 11, 2023
df04f36
Make factory contract entrypoint
shanejearley Oct 19, 2023
db54832
Handle multiple contracts in oracle
shanejearley Oct 19, 2023
3323e41
Merge develop
shanejearley Oct 19, 2023
5ce68b2
Move users db clean to service script
shanejearley Oct 19, 2023
857cf7d
Integrate blog with dev workflow
shanejearley Oct 19, 2023
edefde2
Update operators.ts with contract factory
ccali11 Oct 19, 2023
cb3b9d1
Implement contract factory approach in staking and breakdownMetrics c…
ccali11 Oct 19, 2023
3f59db9
Merge branch 'enhancement/use-factory-in-composables' into deployment…
ccali11 Oct 19, 2023
44568ae
Add blog deployment
shanejearley Oct 19, 2023
b97f9bb
Get hackmd token for dev
shanejearley Oct 19, 2023
abeb95a
Update env signers
shanejearley Oct 19, 2023
89cb834
Add deployed contract addresses
shanejearley Oct 19, 2023
2d5baf7
Change blogs route to blog
shanejearley Oct 19, 2023
ae79a4a
Update hardcoded operator urls in web
shanejearley Oct 19, 2023
7fb5447
Change Pool to PoolConfig
shanejearley Oct 19, 2023
a447fa7
Fix web build errors
ccali11 Oct 19, 2023
7ad2134
Add contract upgrade test
shanejearley Oct 20, 2023
479a923
Quick fix of async factory contract call
ccali11 Oct 20, 2023
c191c08
Merge branch 'deployment/goerli' into fix/async-environment
ccali11 Oct 20, 2023
5ef8453
DRY up getting factory addresses info
ccali11 Oct 20, 2023
eb6955c
Add mock eigen deploy to dev script
shanejearley Oct 21, 2023
a94c4f4
Merge branch 'deployment/goerli' into fix/async-environment
ccali11 Oct 23, 2023
479f528
Add eigen contract addresses & update breakdownMetrics composable
ccali11 Oct 23, 2023
c11ce45
Update operator with defaultManager
ccali11 Oct 23, 2023
a9accd3
Resolve breakdownMetrics and staking component bug
ccali11 Oct 23, 2023
834df65
Remove user from initializeOperatorComposable method
ccali11 Oct 23, 2023
f6ade2e
Add docs app
shanejearley Oct 23, 2023
d2fe084
Add docs deploy
shanejearley Oct 23, 2023
020057e
Merge branch 'feature/docs' into deployment/goerli
shanejearley Oct 23, 2023
ed0083a
Fix ethereum dev script
shanejearley Oct 23, 2023
0b0083a
Clean deployment
shanejearley Oct 24, 2023
573528d
Add blog and docs to dev stage deploy
shanejearley Oct 24, 2023
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
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
15 changes: 8 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[submodule "contracts/ethereum/scripts/resources/ssv-network"]
path = contracts/ethereum/scripts/resources/ssv-network
url = https://github.com/bloxapp/ssv-network.git
branch = jato-v2
[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/consensusnetworks/rockx-dkg-cli.git
[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
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ 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` |
| `MOCK_SERVICES` | Whether to mock backend services | `true` |
Expand Down
1 change: 0 additions & 1 deletion apps/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@casimir/landing",
"description": "Casimir landing page",
"private": true,
"version": "0.0.1",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
11 changes: 3 additions & 8 deletions apps/landing/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<script lang="ts" setup>
// Initalize blogs here for least amount of fetch calls
import useBlogs from '@/composables/blogs.ts'

const {
activeBlog,
allBlogs,
loadingBlogs,
} = useBlogs()
import useBlog from '@/composables/blog'
useBlog()
</script>

<template>
Expand All @@ -16,4 +11,4 @@ const {
</template>


<style scoped></style>
<style scoped></style>@/composables/blog
11 changes: 0 additions & 11 deletions apps/landing/src/blogs/blog.md

This file was deleted.

60 changes: 60 additions & 0 deletions apps/landing/src/composables/blog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { onMounted, onUnmounted, readonly, ref } from 'vue'
import snarkdown from 'snarkdown'
import { Article } from '@casimir/types'

const initializeComposable = ref(false)

const blogUrl = import.meta.env.PUBLIC_BLOG_URL || 'http://localhost:4001'
const articles = ref([] as Article[])
const loadingArticles = ref(true)

export default function useBlog() {
async function getArticleContent(itemId: string) {
const response = await fetch(`${blogUrl}/articles/${itemId}`)
const json = await response.json()
const md = snarkdown(json.content)
return md
}

onMounted(async () => {
if (!initializeComposable.value) {
loadingArticles.value = true
try {
const response = await fetch(`${blogUrl}/articles`)
const jsonList = await response.json()
const articleList = []

for (let i = 0; i < jsonList.length; i++) {
const title = jsonList[i].title
const content = await getArticleContent(jsonList[i].id)
const timestamp = jsonList[i].publishedAt
const id = jsonList[i].id
articleList.push({
title: title,
content: content,
timestamp: timestamp,
type: 'Blog',
id: id,
})
}

articles.value = articleList
loadingArticles.value = false
} catch (error) {
console.log('Error fetching article', error)
loadingArticles.value = false
}

initializeComposable.value = true
}
})

onUnmounted(() => {
initializeComposable.value = false
})

return {
articles: readonly(articles),
loadingArticles: readonly(loadingArticles),
}
}
67 changes: 0 additions & 67 deletions apps/landing/src/composables/blogs.ts

This file was deleted.

50 changes: 25 additions & 25 deletions apps/landing/src/composables/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ import { createWebHistory, createRouter } from 'vue-router'
import Landing from '@/pages/landing/Landing.vue'
import Changelog from '@/pages/changelog/Changelog.vue'
import Blog from '@/pages/blog/Blog.vue'
import SingleBlog from '@/pages/blog/components/SingleBlog.vue'
import Article from '@/pages/blog/components/Article.vue'
const routes = [
{
path: '/',
name: Landing,
component: Landing,
},
{
path: '/blogs',
name: Blog,
component: Blog,
},
{
path: '/blog/:id',
component: SingleBlog,
children: [{ path: '', name: SingleBlog, component: SingleBlog }],
},
{
path: '/changelog',
name: Changelog,
component: Changelog,
},
{
path: '/',
name: Landing,
component: Landing,
},
{
path: '/blogs',
name: Blog,
component: Blog,
},
{
path: '/blog/:id',
component: Article,
children: [{ path: '', name: Article, component: Article }],
},
{
path: '/changelog',
name: Changelog,
component: Changelog,
},
]

const router = createRouter({
history: createWebHistory(),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
routes,
history: createWebHistory(),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
routes,
})

export default router
67 changes: 33 additions & 34 deletions apps/landing/src/pages/blog/Blog.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<script setup>
import { onMounted, ref, computed, watch } from 'vue'
<script lang="ts" setup>
import VueFeather from 'vue-feather'
import useBlogs from '@/composables/blogs.ts'
import useBlog from '@/composables/blog.ts'

const {
allBlogs,
loadingBlogs,
} = useBlogs()
articles,
loadingArticle,
} = useBlog()

</script>

Expand Down Expand Up @@ -44,35 +43,35 @@ const {
</nav>
<section class="max-w-[960px] mx-auto mt-[60px] min-h-[650px] relative overflow-auto">
<div
v-if="loadingBlogs"
v-if="loadingArticle"
class="absolute top-0 left-0 w-full h-full z-[2] rounded-[3px] overflow-hidden"
>
<div class="skeleton_box" />
</div>
<router-link
v-for="blog in allBlogs"
:key="blog"
:to="`/blog/${blog.id}`"
v-for="article in articles"
:key="article"
:to="`/blog/${article.id}`"
class="blog_card flex flex-col mb-[50px]"
>
<div class="flex items-center gap-5">
<span class="text-[0.833rem] font-[500]">
{{ blog.type }} •
{{ article.type }} •
</span>
<span class="text-8">
{{ new Date(blog.timestamp).toDateString() }}
{{ new Date(article.timestamp).toDateString() }}
</span>
</div>

<div class="text-[1.574rem] font-[600] py-10">
{{ blog.title }}
{{ article.title }}
</div>


<div class="h-full w-full overflow-hidden ">
<div
class="overview_blog_content"
v-html="blog.content"
v-html="article.content"
/>
</div>

Expand Down Expand Up @@ -125,33 +124,33 @@ const {

<style lang="scss">
.blog_card {
background-color: rgb(242, 242, 245);
border: 1px solid hsl(236, 10.6%, 87.9%);
width: 100%;
height: 320px;
overflow: hidden;
cursor: pointer;
border-radius: 8px;
padding: 30px 30px 30px 30px;
background-color: rgb(242, 242, 245);
border: 1px solid hsl(236, 10.6%, 87.9%);
width: 100%;
height: 320px;
overflow: hidden;
cursor: pointer;
border-radius: 8px;
padding: 30px 30px 30px 30px;
}

.blog_card:hover {
box-shadow: inset 0px 1px 0px rgba(0, 0, 0, 0.1),
inset 0px -1px 0px 1px rgba(0, 0, 0, 0.1);
box-shadow: inset 0px 1px 0px rgba(0, 0, 0, 0.1),
inset 0px -1px 0px 1px rgba(0, 0, 0, 0.1);
}

.overview_blog_content {
font-size: 1.074rem;
font-weight: 300;
font-size: 1.074rem;
font-weight: 300;

h1,
ul,
il,
img {
display: none;
width: 0;
height: 0;
}
h1,
ul,
il,
img {
display: none;
width: 0;
height: 0;
}

}
</style>
Loading
Loading