Skip to content

Commit

Permalink
Merge branch 'main' into acre-sdk-current-position
Browse files Browse the repository at this point in the history
  • Loading branch information
ioay committed Mar 4, 2024
2 parents d1c8ef7 + 846494b commit a939be9
Show file tree
Hide file tree
Showing 42 changed files with 405 additions and 71 deletions.
72 changes: 64 additions & 8 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
paths:
- "core/**"
pull_request:
workflow_dispatch:
inputs:
environment:
description: "Testnet to deploy contracts to"
required: true
type: choice
options:
- "sepolia"
default: "sepolia"

defaults:
run:
Expand All @@ -23,7 +32,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -35,7 +44,7 @@ jobs:
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
Expand All @@ -50,7 +59,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -71,7 +80,7 @@ jobs:
run: pip3 install slither-analyzer==$SLITHER_VERSION

- name: Download Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
Expand All @@ -86,7 +95,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -98,7 +107,7 @@ jobs:
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
Expand All @@ -113,7 +122,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -125,10 +134,57 @@ jobs:
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core-build
path: core/

- name: Deploy
run: pnpm run deploy --no-compile

core-deploy-testnet:
needs: [core-deploy-dry-run]
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/

- name: Remove existing deployment artifacts for the selected network
run: rm -rf deployments/${{ github.event.inputs.environment }}

- name: Deploy contracts
env:
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
CHAIN_API_URL: ${{ secrets.SEPOLIA_CHAIN_API_URL }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
run: |
pnpm run deploy --network ${{ github.event.inputs.environment }}
- name: Upload deployed contracts as workflow artifact
# The step will be executed even if the previous step fails (can be
# useful for partially failed deployments).
if: always()
uses: actions/upload-artifact@v4
with:
name: deployed-contracts-${{ github.event.inputs.environment }}
path: |
core/deployments/${{ github.event.inputs.environment }}
if-no-files-found: error
8 changes: 4 additions & 4 deletions .github/workflows/dapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -32,7 +32,7 @@ jobs:
cache: "pnpm"

- name: Download SDK Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: sdk-build
path: sdk/dist
Expand All @@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -59,7 +59,7 @@ jobs:
cache: "pnpm"

- name: Download SDK Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: sdk-build
path: sdk/dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-core-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -27,7 +27,7 @@ jobs:
run: pnpm run build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: core-build
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/reusable-sdk-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -25,7 +25,7 @@ jobs:
cache: "pnpm"

- name: Download Core Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
Expand All @@ -37,7 +37,7 @@ jobs:
run: pnpm run build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sdk-build
path: sdk/dist/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -32,7 +32,7 @@ jobs:
cache: "pnpm"

- name: Download Core Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
Expand All @@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -59,7 +59,7 @@ jobs:
cache: "pnpm"

- name: Download Core Build Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set up Node
uses: actions/setup-node@v4
Expand Down
10 changes: 10 additions & 0 deletions dapp/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
"react/require-default-props": [0],
"no-console": ["error", { "allow": ["error"] }],
},
"overrides": [
{
"files": [
"src/store/**/*Slice.ts"
],
"rules": {
"no-param-reassign": ["error", {"ignorePropertyModificationsFor": ["state"] }]
}
}
],
"settings": {
"import/resolver": {
"alias": {
Expand Down
3 changes: 2 additions & 1 deletion dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@
"@emotion/styled": "^11.11.0",
"@ledgerhq/wallet-api-client": "^1.5.0",
"@ledgerhq/wallet-api-client-react": "^1.3.0",
"@reduxjs/toolkit": "^2.2.0",
"@sentry/react": "^7.98.0",
"@sentry/types": "^7.102.0",
"@tanstack/react-table": "^8.11.3",
"axios": "^1.6.7",
"ethers": "^6.10.0",
"axios": "^1.6.7",
"formik": "^2.4.5",
"framer-motion": "^10.16.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-number-format": "^5.3.1",
"react-redux": "^9.1.0",
"react-router-dom": "^6.22.0",
"recharts": "^2.12.0"
},
Expand Down
1 change: 1 addition & 0 deletions dapp/public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
20 changes: 10 additions & 10 deletions dapp/src/DApp.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from "react"
import { Box, ChakraProvider } from "@chakra-ui/react"
import { Provider as ReduxProvider } from "react-redux"
import { RouterProvider } from "react-router-dom"
import { useInitializeAcreSdk } from "./hooks"
import { useInitApp } from "./hooks"
import { store } from "./store"
import theme from "./theme"
import {
DocsDrawerContextProvider,
Expand All @@ -15,13 +17,9 @@ import Sidebar from "./components/Sidebar"
import DocsDrawer from "./components/DocsDrawer"
import GlobalStyles from "./components/GlobalStyles"
import { router } from "./router"
import { useSentry } from "./hooks/sentry"

function DApp() {
// TODO: Let's uncomment when dark mode is ready
// useDetectThemeMode()
useSentry()
useInitializeAcreSdk()
useInitApp()

return (
<>
Expand All @@ -42,10 +40,12 @@ function DAppProviders() {
<AcreSdkProvider>
<DocsDrawerContextProvider>
<SidebarContextProvider>
<ChakraProvider theme={theme}>
<GlobalStyles />
<DApp />
</ChakraProvider>
<ReduxProvider store={store}>
<ChakraProvider theme={theme}>
<GlobalStyles />
<DApp />
</ChakraProvider>
</ReduxProvider>
</SidebarContextProvider>
</DocsDrawerContextProvider>
</AcreSdkProvider>
Expand Down
4 changes: 2 additions & 2 deletions dapp/src/components/Header/ConnectWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { CurrencyBalance } from "#/components/shared/CurrencyBalance"
import { TextMd } from "#/components/shared/Typography"
import { Bitcoin, EthereumIcon } from "#/assets/icons"
import { truncateAddress, asyncWrapper } from "#/utils"
import { truncateAddress, logPromiseFailure } from "#/utils"

export type ConnectButtonsProps = {
leftIcon: typeof Icon
Expand All @@ -25,7 +25,7 @@ function ConnectButton({
const colorScheme = !account ? "error" : undefined

const handleClick = () => {
asyncWrapper(requestAccount())
logPromiseFailure(requestAccount())
}

return (
Expand Down
Loading

0 comments on commit a939be9

Please sign in to comment.