Skip to content

Commit

Permalink
Merge pull request #17 from 0xPilou/vesting-scheduler-1_2_1
Browse files Browse the repository at this point in the history
Added Claimable Vesting Schedule feature
  • Loading branch information
kasparkallas authored Jun 10, 2024
2 parents 8d00a99 + d4173fe commit 732df4e
Show file tree
Hide file tree
Showing 63 changed files with 13,779 additions and 8,151 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/aw-subgraph-ci-goldsky.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Superfluid WrapScheduler Subgraphs
name: Deploy WrapScheduler Subgraphs (Goldsky)

on:
workflow_dispatch:
Expand All @@ -15,6 +15,7 @@ jobs:
run:
working-directory: subgraphs/wrap-scheduler
strategy:
fail-fast: false
matrix:
networks:
[
Expand All @@ -25,14 +26,16 @@ jobs:
"xdai-mainnet",
"optimism-mainnet",
"polygon-mainnet",
"optimism-sepolia",
"base-mainnet"
]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v2
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Install
Expand All @@ -52,7 +55,20 @@ jobs:
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('package.json'));
return packageJson.version;
- name: Goldsky Login
run: pnpm exec goldsky login --token ${{secrets.GOLDSKY_API_KEY}}
- name: Goldsky Deploy
run: pnpm exec goldsky subgraph deploy ${{format('auto-wrap-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --path ./build --token ${{secrets.GOLDSKY_API_KEY}}
run: pnpm exec goldsky subgraph deploy ${{format('auto-wrap-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --path ./build
continue-on-error: true # We still want to tag the latest deployment if it was already deployed.
- name: Check Subgraph Sync Status
id: check-sync
run: |
SYNC=$(pnpm exec goldsky subgraph list ${{format('auto-wrap-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} | grep "Synced:" | awk '{print $2}' | cut -d'%' -f1)
if (( $(echo "$SYNC > 98" | bc -l) )); then
echo "::set-output name=sync::true"
else
echo "::set-output name=sync::false"
fi
- name: Goldsky Tag
run: pnpm exec goldsky subgraph tag ${{format('auto-wrap-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --tag latest --token ${{secrets.GOLDSKY_API_KEY}}
if: steps.check-sync.outputs.sync == 'true'
run: pnpm exec goldsky subgraph tag create ${{format('auto-wrap-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --tag prod
40 changes: 0 additions & 40 deletions .github/workflows/aw-subgraph-ci.yml

This file was deleted.

30 changes: 23 additions & 7 deletions .github/workflows/fs-subgraph-ci-goldsky.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Superfluid FlowScheduler Subgraphs (Goldsky)
name: Deploy FlowScheduler Subgraphs (Goldsky)

on:
workflow_dispatch:
Expand All @@ -15,6 +15,7 @@ jobs:
run:
working-directory: subgraphs/flow-scheduler
strategy:
fail-fast: false
matrix:
networks:
[
Expand All @@ -25,14 +26,16 @@ jobs:
"xdai-mainnet",
"optimism-mainnet",
"polygon-mainnet",
"optimism-sepolia",
"base-mainnet"
]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v2
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Install
Expand All @@ -52,7 +55,20 @@ jobs:
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('package.json'));
return packageJson.version;
- name: Goldsky Login
run: pnpm exec goldsky login --token ${{secrets.GOLDSKY_API_KEY}}
- name: Goldsky Deploy
run: pnpm exec goldsky subgraph deploy ${{format('scheduling-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --path ./build --token ${{secrets.GOLDSKY_API_KEY}}
run: pnpm exec goldsky subgraph deploy ${{format('scheduling-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --path ./build
continue-on-error: true # We still want to tag the latest deployment if it was already deployed.
- name: Check Subgraph Sync Status
id: check-sync
run: |
SYNC=$(pnpm exec goldsky subgraph list ${{format('scheduling-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} | grep "Synced:" | awk '{print $2}' | cut -d'%' -f1)
if (( $(echo "$SYNC > 98" | bc -l) )); then
echo "::set-output name=sync::true"
else
echo "::set-output name=sync::false"
fi
- name: Goldsky Tag
run: pnpm exec goldsky subgraph tag ${{format('scheduling-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --tag latest --token ${{secrets.GOLDSKY_API_KEY}}
if: steps.check-sync.outputs.sync == 'true'
run: pnpm exec goldsky subgraph tag create ${{format('scheduling-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --tag prod
40 changes: 0 additions & 40 deletions .github/workflows/fs-subgraph-ci.yml

This file was deleted.

28 changes: 22 additions & 6 deletions .github/workflows/vs-subgraph-ci-goldsky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
run:
working-directory: subgraphs/vesting-scheduler
strategy:
fail-fast: false
matrix:
networks:
[
Expand All @@ -25,14 +26,16 @@ jobs:
"xdai-mainnet",
"optimism-mainnet",
"polygon-mainnet",
"optimism-sepolia",
"base-mainnet"
]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v2
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Install
Expand All @@ -52,7 +55,20 @@ jobs:
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('package.json'));
return packageJson.version;
- name: Goldsky Login
run: pnpm exec goldsky login --token ${{secrets.GOLDSKY_API_KEY}}
- name: Goldsky Deploy
run: pnpm exec goldsky subgraph deploy ${{format('vesting-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --path ./build --token ${{secrets.GOLDSKY_API_KEY}}
run: pnpm exec goldsky subgraph deploy ${{format('vesting-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --path ./build
continue-on-error: true # We still want to tag the latest deployment if it was already deployed.
- name: Check Subgraph Sync Status
id: check-sync
run: |
SYNC=$(pnpm exec goldsky subgraph list ${{format('vesting-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} | grep "Synced:" | awk '{print $2}' | cut -d'%' -f1)
if (( $(echo "$SYNC > 98" | bc -l) )); then
echo "::set-output name=sync::true"
else
echo "::set-output name=sync::false"
fi
- name: Goldsky Tag
run: pnpm exec goldsky subgraph tag ${{format('vesting-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --tag latest --token ${{secrets.GOLDSKY_API_KEY}}
if: steps.check-sync.outputs.sync == 'true'
run: pnpm exec goldsky subgraph tag create ${{format('vesting-v1-{0}/{1}', matrix.networks, steps.get-version.outputs.result) }} --tag prod
40 changes: 0 additions & 40 deletions .github/workflows/vs-subgraph-ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ Superfluid Automation Subgraphs index the [peripheral Superfluid automation cont
- Inspect the source code in the [protocol-monorepo](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/automation-contracts)
- Find the deployment addresses programmatically from [@superfluid-finance/metadata](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/metadata)

## Other
The Graph Supported Networks CLI names: https://thegraph.com/docs/en/developing/supported-networks/

## License
The Superfluid Automation Subgraphs are [MIT licensed](./LICENSE).
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superfluid-finance/automation-subgraphs",
"version": "1.0.0",
"version": "1.0.2",
"description": "",
"keywords": [],
"license": "MIT",
Expand All @@ -11,6 +11,6 @@
"test": "pnpm -r test"
},
"devDependencies": {
"@goldskycom/cli": "^8.5.1"
"@goldskycom/cli": "^8.7.0"
}
}
52 changes: 31 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions subgraphs/flow-scheduler/config/base-mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"network": "base",
"flowSchedulerAddress": "0xC72CEd15204d02183c83fEbb918b183E400811Ee",
"flowSchedulerStartBlock": 13848318
}
Loading

0 comments on commit 732df4e

Please sign in to comment.