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

[DRAFT] feat: Add Escrow Milestones Transaction Type #487

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c5a1fc9
change button to create instead of submit
0xMillz Nov 4, 2024
98f4ff7
Testing PR deployment preview workflow
0xMillz Nov 5, 2024
f20dced
Take 2: Testing PR deployment preview workflow
0xMillz Nov 5, 2024
5ca1c5c
Take 3: Comment out legacy workflowe that is interfering
0xMillz Nov 5, 2024
c059145
Update prod workflow
0xMillz Nov 7, 2024
96f6a24
Add VERCEL_TOKEN
0xMillz Nov 7, 2024
7e36675
Add pnpm step to workflow
0xMillz Nov 7, 2024
84636b6
Add pnpm caching step to workflow
0xMillz Nov 7, 2024
6a6e29a
Optimize preview workflow for efficiency and speed
0xMillz Nov 7, 2024
5a79677
Add build step to workflow
0xMillz Nov 7, 2024
ab24b4a
Get token before build
0xMillz Nov 7, 2024
676bbe2
lnaguage: change words Submit to Create
0xMillz Nov 7, 2024
2a6651a
fix typo
0xMillz Nov 7, 2024
ca8102d
Merge branch 'staging' into test_PR_preview
0xMillz Nov 7, 2024
6bdfa20
Merge pull request #1 from 0xMillz/test_PR_preview
0xMillz Nov 7, 2024
9ef5f4b
Update subgraph docs (#4)
0xMillz Dec 4, 2024
ad054d5
Update subgraph URLs and run format (#6)
0xMillz Dec 5, 2024
4f95b86
Deploy and update final subgraph URLs (#7)
0xMillz Dec 6, 2024
64e8816
update subgraph README (#10)
0xMillz Dec 8, 2024
a382cb0
Add .nvmrc
0xMillz Dec 12, 2024
669cd7e
Update READMEs and links to docs (#26)
0xMillz Dec 21, 2024
216ab31
Update env vars (#28)
0xMillz Dec 21, 2024
c8dcadd
added execution tx hash to proposal entity
dan13ram Dec 10, 2024
439d52c
added types for executionTxHash
dan13ram Jan 8, 2025
6181fa2
use etherscan v2 api
dan13ram Jan 23, 2025
f82bcce
added support for gnosis safe connector
dan13ram Jan 23, 2025
6f144ab
add support for escrow proposal type
dan13ram Jan 23, 2025
2ed8d31
added escrow milestones view for proposal
dan13ram Jan 23, 2025
a558a24
added support for escrow delegate
wtfsayo Sep 25, 2024
8a55495
reset rpc for old envs
dan13ram Jan 23, 2025
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
35 changes: 35 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: GitHub Actions Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Ensure pnpm store directory exists
run: mkdir -p ~/.pnpm-store
- name: Cache Node Modules and pnpm Store
uses: actions/cache@v3
with:
path: |
~/.pnpm-store
node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm and Vercel CLI
run: |
npm install -g pnpm vercel@canary
- name: Pull Vercel Environment Information
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
22 changes: 17 additions & 5 deletions .github/workflows/main.yml → .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This workflow runs the CI command defined in package.json
name: CI

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: [main]

branches:
- main
jobs:
ci:
name: CI
Expand Down Expand Up @@ -79,3 +79,15 @@ jobs:
# Need to shutdown Anvil so cache gets created
- name: 💤 Shutdown Anvil
run: pkill -2 anvil

# TODO @0xMillz for production: (https://vercel.com/guides/how-can-i-use-github-actions-with-vercel)

# - uses: actions/checkout@v2
# - name: Install Vercel CLI
# run: npm install --global vercel@latest
# - name: Pull Vercel Environment Information
# run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
# - name: Build Project Artifacts
# run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
# - name: Deploy Project Artifacts to Vercel
# run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Nouns Builder monorepo
# ![Builder Avatar](apps/web/public/builder-avatar-circle60x60.png) Nouns Builder Monorepo

This is Nouns Builder front-end mono-repo. You can find Nouns Builder deployed on:
This is Nouns Builder front-end website and subgraph mono-repo. You can find Nouns Builder deployed on:

- [Mainnet](//nouns.build)
- [Goerli testnet](//testnet.nouns.build)
- [Sepolia testnet](//testnet.nouns.build)

For an introduction to Nouns Builder and its concept, you can find further [documentation here](https://docs.zora.co/docs/smart-contracts/nouns-builder/intro). You can also find [Nouns Protocol here](https://github.com/ourzora/nouns-protocol).
For an introduction to Nouns Builder and its concept, you can find further [documentation here](https://nouns-builder-docs.vercel.app/).
You can also find the [Builder Protocol code here](https://github.com/BuilderOSS/builder-protocol).

### Apps and packages in this repository include:

Expand Down Expand Up @@ -77,37 +78,39 @@ pnpm run type-check

This app has several third party api keys that you need in order to run Builder:

- [alchemy](https://www.alchemy.com/) as the main rpc node provider in addition to mainnet forks for testing
- [tenderly](https://docs.tenderly.co/simulations-and-forks/simulation-api) in order to simulate transactions
- [etherscan](https://docs.etherscan.io/api-endpoints/contracts) to dyanamically fetch abis
- [Tenderly](https://docs.tenderly.co/simulations-and-forks/simulation-api) as the main rpc node provider and transaction simulator
- [Etherscan](https://docs.etherscan.io/api-endpoints/contracts) to dynamically fetch abis

We ask that you supply your own secrets locally for running in development environment. Non-secret environment variables are already included in the `.env` files in this repo.

Add the following variables to `.env.local` within this root directory (needed to run tests against a local anvil node):

```
#alchemy
PRIVATE_ALCHEMY_ID=<ALCHEMY_API_KEY>
ANVIL_FORK_URL=https://eth-mainnet.alchemyapi.io/v2/$PRIVATE_ALCHEMY_ID
ANVIL_FORK_URL=https://eth-mainnet.alchemyapi.io/v2/$TENDERLY_RPC_KEY
ANVIL_BLOCK_NUMBER=8305745
```

Add the following variables to `apps/web/.env.local`:

```
#alchemy
NEXT_PUBLIC_TENDERLY_RPC_KEY=<ALCHEMY_API_KEY>
# tenderly RPCs
NEXT_PUBLIC_TENDERLY_MAINNET_RPC_KEY
NEXT_PUBLIC_TENDERLY_BASE_RPC_KEY
NEXT_PUBLIC_TENDERLY_OPTIMISM_RPC_KEY
NEXT_PUBLIC_TENDERLY_SEPOLIA_RPC_KEY

# conduit RPC for Zora
NEXT_PUBLIC_ZORA_CONDUIT_RPC_KEY

#tenderly
# tenderly simulator env variables
TENDERLY_ACCESS_KEY=<API_KEY>
TENDERLY_PROJECT=<PROJECT_NAME>
TENDERLY_USER=<ACCOUNT_NAME>

#etherscan (optional to run locally, this is for dynamically fetching abis in the custom transaction builder)
ETHERSCAN_API_KEY=<ETHERSCAN_API_KEY>

#optional zora api key
# optional zora api key
NEXT_PUBLIC_ZORA_API_KEY=
```

Expand All @@ -134,19 +137,16 @@ The Nouns Builder client is deployed on [Vercel](https://vercel.com/). Any pull

The Nouns Builder subgraph is deployed for the following networks:

- [Ethereum Mainnet](https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-mainnet)
- [Ethereum Goerli](https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-goerli)
- [Optimism Mainnet](https://api.thegraph.com/subgraphs/name/neokry/noun-builder-optimism-mainnet)
- [Optimism Goerli](https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-optimism-goerli)
- [Zora Mainnet](https://api.goldsky.com/api/public/project_clkk1ucdyf6ak38svcatie9tf/subgraphs/nouns-builder-zora-mainnet/stable/gn)
- [Zora Goerli](https://api.goldsky.com/api/public/project_clkk1ucdyf6ak38svcatie9tf/subgraphs/nouns-builder-zora-testnet/stable/gn)
- [Base Mainnet](https://api.goldsky.com/api/public/project_clkk1ucdyf6ak38svcatie9tf/subgraphs/nouns-builder-base-mainnet/stable/g)
- [Base Goerli](https://api.studio.thegraph.com/query/49279/nouns-builder-base-goerli/version/latest)
- [Ethereum](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-ethereum-mainnet/latest/gn)
- [Ethereum Sepolia](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-ethereum-sepolia/latest/gn)
- [Base](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-base-mainnet/latest/gn)
- [Optimism](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-optimism-mainnet/latest/gn)
- [Zora](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-zora-mainnet/latest/gn)

## Contributions

Please refer to our [contributions guideline](/.github/contributing.md) on how best to contribute.

## Questions?

Feel free to reach out to us via [twitter](https://twitter.com/nounsbuilder), [discord](https://discord.gg/JpMKps2W), or via email at <[email protected]>
Feel free to reach out to us via [Discord](https://discord.gg/rSswr2wC)
6 changes: 2 additions & 4 deletions apps/subgraph/.env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Docker config

## For the Goerli testnet use goerli
## For local testing leave empty (docker compose file has defaults)
## Example: for Ethereum Sepolia the value is ethereum-sepolia
NETWORK_NAME=

## For Goerli use https://goerli.infura.io/v3/<your API key>
## For local testing leave empty
## Example: for Ethereum Sepolia the value is https://sepolia.infura.io/v3/<your API key>
NETWORK_RPC=
129 changes: 96 additions & 33 deletions apps/subgraph/README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,114 @@
# Nouns Builder Subgraph

This `README` is intended to provide app specific context.
## Index

### App Dependencies
- [Getting Started](#getting-started)
- [Step 1 - Install Dependencies](#step-1---install-dependencies)
- [Step 2 - Set Up a Personal Goldsky API Key](#step-2---set-up-a-personal-goldsky-api-key)
- [Step 3 - Log in with the API Key](#step-3---log-in-with-the-api-key)
- [Step 4 - Build the Subgraph from Source](#step-4---build-the-subgraph-from-source)
- [Step 5 - Deploy the Subgraph to Production](#step-5---deploy-the-subgraph-to-production)
- [Step 6 - Query the Subgraph](#step-6---query-the-subgraph)
- [Production Endpoints](#production-endpoints)

The Nouns Builder Subgraph is built on the Graph Protocol and includes the following dependencies:
## Getting Started

- [@graphprotocol/graph-cli](https://www.npmjs.com/package/@graphprotocol/graph-cli) - cli for developing and testing subgraphs
- [@graphprotocol/graph-ts](https://www.npmjs.com/package/@graphprotocol/graph-ts) - core typescript library for writing subgraphs
👉 [Read the Goldsky docs](https://docs.goldsky.com/subgraphs/deploying-subgraphs)

### Chain Environment
The Nouns Builder subgraph supports five networks:

Nouns Builder subgraph currently supports two networks: `mainnet` and `goerli`. The environment variables indicated below dictate the network that the app interacts with.
- `ethereum`
- `ethereum-sepolia`
- `base`
- `optimism`
- `zora`

You can swap out the environment variables as defined below to run the subgraph locally against mainnnet or testnet locally.
### Step 1 - Install Dependencies

Navigate to the subgraph directory and run:

```bash
# FROM: ./apps/subgraph
pnpm install
```

### Step 2 - Set Up a Personal Goldsky API Key

1. Request to join the team account at [goldsky.com](https://goldsky.com).
2. Create an API key on your Settings page.
3. Install the Goldsky CLI:
```bash
curl https://goldsky.com | sh
```

### Step 3 - Log in with the API Key

Use the API key you created:

```bash
# FROM: ./apps/subgraph
goldsky login
```

### Step 4 - Build the Subgraph from Source

Run the following commands (these scripts are defined in `package.json`):

```bash
# FROM: ./apps/subgraph
pnpm prepare:<desired network>
pnpm codegen
pnpm build:subgraph
```
# the default chain id defined in .env, to run against testnet
NETWORK_RPC=<TESTNET_RPC_ENDPOINT>
NETWORK_NAME=goerli

# to run against mainnet locally
NETWORK_RPC=<MAINNET_RPC_ENDPOINT>
NETWORK_NAME=mainnet
This will generate types, build the subgraph, and create a local `subgraph.yaml` file.

### Step 5 - Deploy the Subgraph to Production

#### IMPORTANT:

**To avoid downtime during upgrades, maintain a backup subgraph. If issues arise, you can redirect traffic to the backup rather than waiting for redeployment or rollback, which can take hours.**

- The subgraph name follows the pattern `nouns-builder-<network>`, so clients won’t need to update their URI for minor version changes.
- Increase the `specVersion` at the top of `subgraph.yaml.mustache` for each new version.
- Use the **--tag** flag to alias `latest` with the current `specVersion`.

*If you are making breaking changes, make sure to notify clients first and provide a migration path.

**Always remember to tag!**

```bash
# FROM: ./apps/subgraph
# Example with specVersion 0.0.6

goldsky subgraph deploy nouns-builder-<network>/0.0.6 --path .
goldsky subgraph tag create nouns-builder-<network>/0.0.6 --tag latest
# API endpoint format: api.goldsky.com/api/public/<project name>/subgraphs/nouns-builder-ethereum-sepolia/latest/gn
```

### Development
### Step 6 - Query the Subgraph

You can now query the subgraph in the Goldsky GraphQL playground to test your changes. **Note: Full indexing may take several hours.**

- create a `.env` file with the required environment variables
- generate types with `pnpm codegen`
- build the subgraph with `pnpm build`
- run the local graph node with `pnpm local-node`
- for M1 mac users you will need to use a local image of `graphprotocol/graph-node` [instructions here](https://github.com/graphprotocol/graph-node/tree/master/docker)
- create the local subgraph with `pnpm create-local`
- deploy changes to the local subgraph with `pnpm deploy-local`
## Production Endpoints

### Deployment
The subgraph is currently deployed to the following networks:

The subgraph is currently deployed for the following networks:
- [Ethereum](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-ethereum-mainnet/latest/gn)
- [Ethereum Sepolia](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-ethereum-sepolia/latest/gn)
- [Base](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-base-mainnet/latest/gn)
- [Optimism](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-optimism-mainnet/latest/gn)
- [Zora](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-zora-mainnet/latest/gn)
- TODO?: [Optimism Sepolia](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-optimism-sepolia/latest/gn)
- TODO?: [Zora Sepolia](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-zora-sepolia/latest/gn)
- TODO?: [Base Sepolia](https://api.goldsky.com/api/public/project_cm33ek8kjx6pz010i2c3w8z25/subgraphs/nouns-builder-base-sepolia/latest/gn)

- [Ethereum Mainnet](https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-mainnet)
- [Ethereum Goerli](https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-goerli)
- [Optimism Mainnet](https://api.thegraph.com/subgraphs/name/neokry/noun-builder-optimism-mainnet)
- [Optimism Goerli](https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-optimism-goerli)
- [Zora Mainnet](https://api.goldsky.com/api/public/project_clkk1ucdyf6ak38svcatie9tf/subgraphs/nouns-builder-zora-mainnet/stable/gn)
- [Zora Goerli](https://api.goldsky.com/api/public/project_clkk1ucdyf6ak38svcatie9tf/subgraphs/nouns-builder-zora-testnet/stable/gn)
- [Base Mainnet](https://api.goldsky.com/api/public/project_clkk1ucdyf6ak38svcatie9tf/subgraphs/nouns-builder-base-mainnet/stable/g)
- [Base Goerli](https://api.studio.thegraph.com/query/49279/nouns-builder-base-goerli/version/latest)
## (DEPRECATED) Local Development with Docker Compose (TODO: fix - pnpm create:local step not working)

To deploy your own version edit the `deploy` script in `package.json` with your deployment information
- Generate the subgraph.yml file with `pnpm prepare:<desired network>`
- Generate types with `pnpm codegen`
- Build the subgraph with `pnpm build`
- Run the local graph node with `pnpm local:node`
- For Mac users on Apple Silicon, use a local image of `graphprotocol/graph-node` (see [instructions here](https://github.com/graphprotocol/graph-node/tree/master/docker)).
- Create the local subgraph with `pnpm create:local`
- Deploy changes to the local subgraph with `pnpm deploy-local`
8 changes: 0 additions & 8 deletions apps/subgraph/config/base-goerli.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"network": "mainnet",
"network": "ethereum",
"manager": {
"address": "0xd310a3041dfcf14def5ccbc508668974b5da7174",
"startBlock": 15799000
Expand Down
8 changes: 0 additions & 8 deletions apps/subgraph/config/goerli.json

This file was deleted.

8 changes: 0 additions & 8 deletions apps/subgraph/config/optimism-goerli.json

This file was deleted.

8 changes: 0 additions & 8 deletions apps/subgraph/config/zora-goerli.json

This file was deleted.

2 changes: 1 addition & 1 deletion apps/subgraph/config/zora.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"network": "zora-mainnet",
"network": "zora",
"manager": {
"address": "0x3ac0E64Fe2931f8e082C6Bb29283540DE9b5371C",
"startBlock": 1778012
Expand Down
Loading