Skip to content

chore(repo): promote contracts to root and update CI #1

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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ae7ae1e
chore(repo): promote contracts to root and update CI
bitbeckers Jan 19, 2025
242855d
fix(gha): submodule files not found
bitbeckers Jan 19, 2025
a6662c5
fix(gha): foundy ci flow
bitbeckers Jan 19, 2025
1be19f7
fix(gha): ensure submodules are present
bitbeckers Jan 19, 2025
1d0b970
fix(gha): log dir and find files
bitbeckers Jan 19, 2025
125739f
fix(gha): fix submodule tag oz-contracts-upgradeable
bitbeckers Jan 19, 2025
b4afadd
fix(gha): log package.json and missing sol file
bitbeckers Jan 19, 2025
abcd8cd
fix(gha): log cryptography directory structure
bitbeckers Jan 19, 2025
8f45fa9
fix(gha): init submodules
bitbeckers Jan 19, 2025
4c196b3
fix(gha): debug submodules
bitbeckers Jan 19, 2025
133f6b7
fix(gha): force specific version checkout
bitbeckers Jan 19, 2025
f33f3c7
fix(gha): set fetch-depth to 0
bitbeckers Jan 19, 2025
53146b7
fix(gha): remove forced tag checkout in ci script
bitbeckers Jan 19, 2025
f9408e1
fix(gha): debug oz checkout
bitbeckers Jan 19, 2025
b5c3db5
fix(gha): fetch tags and checkout
bitbeckers Jan 19, 2025
2410853
fix(gha): tagagagagag
bitbeckers Jan 19, 2025
b1b990b
fix(gha): use commit hash instead of tag
bitbeckers Jan 19, 2025
f517ad7
fix(gha): try to debug why it cannot fetch commit
bitbeckers Jan 19, 2025
fd6528b
fix(gha): steps sequence for debugging
bitbeckers Jan 19, 2025
1f66c6d
fix(gha): debugging submodule
bitbeckers Jan 19, 2025
985650c
fix(gha): better debug log
bitbeckers Jan 19, 2025
ff169ba
fix(gha): force commit hash checkout
bitbeckers Jan 19, 2025
ea83325
fix(gha): log moaaaar
bitbeckers Jan 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 17 additions & 11 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
name: Bug Report
description: Create a bug report for the Hypercerts protocol
labels: ['type:bug']
labels: ["type:bug"]
body:
- type: markdown
attributes:
value: If you leave out sections there is a high likelihood it will be moved to the [GitHub Discussions](https://github.com/Network-Goods/hypercerts/discussions).
value:
If you leave out sections there is a high likelihood it will be moved to the [GitHub
Discussions](https://github.com/Network-Goods/hypercerts/discussions).
- type: dropdown
attributes:
label: Which area(s) of Hypercerts are affected? (leave empty if unsure)
multiple: true
options:
- 'Smart Contracts'
- 'SDK'
- 'Frontend Dapp'
- 'Docs'
- 'The Graph integration'
- 'OpenZeppelin Defender integration'
- 'Other'
- "Smart Contracts"
- "SDK"
- "Frontend Dapp"
- "Docs"
- "The Graph integration"
- "OpenZeppelin Defender integration"
- "Other"
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue. Screenshots can be provided in the issue body below.
description:
Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue. Screenshots
can be provided in the issue body below.
validations:
required: true
- type: textarea
Expand All @@ -37,4 +41,6 @@ body:
required: true
- type: markdown
attributes:
value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. Contributors should be able to follow the steps provided in order to reproduce the bug.
value:
Before posting the issue go through the steps you've written down to make sure the steps provided are detailed
and clear. Contributors should be able to follow the steps provided in order to reproduce the bug.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2.feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature Request
description: Create a feature request
labels: 'type:featurerequest'
labels: ["type:featurerequest"]
body:
- type: markdown
attributes:
Expand Down
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/3.docs_request.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: 'Docs Request'
name: "Docs Request"
description: A request to update or improve documentation
title: 'Docs: '
labels:
- 'category:docs'
title: "Docs: "
labels: ["category:docs"]
body:
- type: textarea
attributes:
label: What is the improvement or update you wish to see?
description: 'Example: I would like to see more examples of how to use the SDK to detect hypercert claim collisions.'
description:
"Example: I would like to see more examples of how to use the SDK to detect hypercert claim collisions."
validations:
required: true
- type: textarea
Expand All @@ -19,6 +19,6 @@ body:
- type: input
attributes:
label: Does the docs page already exist? Please link to it.
description: 'Example: https://hypercerts.org/docs/api-reference/'
description: "Example: https://hypercerts.org/docs/api-reference/"
validations:
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/9.other.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Other'
name: "Other"
description: For internal use only
body:
- type: textarea
Expand Down
96 changes: 79 additions & 17 deletions .github/workflows/ci-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ name: ci-default
env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
FOUNDRY_PROFILE: "ci"

# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
pull_request:
branches:
- "main"
- "dev"
push:
branches:
- "main"
- "dev"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -20,42 +27,97 @@ jobs:
lint-and-test:
# NOTE: This name appears in GitHub's Checks API.
name: test
environment: testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Check out pull request's HEAD commit instead of the merge commit to
# prevent gitlint from failing due to too long commit message titles,
# e.g. "Merge 3e621938d65caaa67f8e35d145335d889d470fc8 into 19a39b2f66cd7a165082d1486b2f1eb36ec2354a".
ref: ${{ github.event.pull_request.head.sha }}
# Fetch all history so gitlint can check the relevant commits.
fetch-depth: "0"
submodules: "recursive"
fetch-depth: 0

- name: Log content of lib/openzeppelin-contracts-upgradeable/package.json
run: |
cat lib/openzeppelin-contracts-upgradeable/package.json

- name: Debug submodule state
run: |
echo "1. Current directory structure:"
ls -la
echo "\n2. Content of .gitmodules:"
cat .gitmodules
echo "\n3. Submodule status before:"
git submodule status
echo "\n4. Initialize submodules:"
git submodule update --init --recursive
echo "\n5. Submodule status after init:"
git submodule status
echo "\n6. List lib directory:"
ls -la lib/
echo "\n7. Entering submodule:"
cd lib/openzeppelin-contracts-upgradeable
git remote -v
git fetch --all --tags --force
git tag -l
git checkout 2d081f24cac1a867f6f73d512f2022e1fa987854
cd ../..

- name: Debug tags
run: |
cd lib/openzeppelin-contracts-upgradeable
git tag -l
cd ../..

- name: Debug OpenZeppelin version
run: |
cd lib/openzeppelin-contracts-upgradeable
echo "Current git status:"
git status
echo "\nCurrent commit hash:"
git rev-parse HEAD
echo "\nCurrent tag:"
git describe --tags
echo "\nAvailable branches:"
git branch -a

- name: Debug directory structure
run: |
ls -la lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/
pwd

- name:
Log content of lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/MerkleProofUpgradeable.sol
run: |
cat lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/MerkleProofUpgradeable.sol

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

- run: corepack enable

- name: Set up Node.js 18
uses: actions/setup-node@v4
with:
cache: "pnpm"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install
- name: Install dependencies
run: |
pnpm install
pnpm i
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Build

- name: Build packages
run: |
pnpm run build
pnpm build
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Lint

- name: Lint code
run: |
pnpm run lint
pnpm lint
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Test

- name: Test contracts
run: |
pnpm test
# Always run this step so that all linting errors can be seen at once.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
name: Static Analysis

on:
push:
branches:
- "main"
- "dev"
pull_request:
branches:
- "main"
- "dev"
workflow_dispatch:

jobs:
analyze:
Expand Down
74 changes: 36 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# directories
node_modules
**/artifacts
**/build
**/cache
**/coverage
**/contracts
**/.coverage_artifacts
**/.coverage_cache
**/.coverage_contracts
**/dist
**/deployments/localhost
**/out*
**/typechain
**/types
**/cache**
**/abi
**/rollup-cache

# dependencies
**/node_modules/
.pnp/
# files
*.env
*.log
.pnp.*
coverage.json
npm-debug.log*
.pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# testing
coverage/
.eslintcache

# builds
out/
build/
dist/
.turbo/
.next/
.docusaurus/

# files
**/.openzeppelin/*-31337.json
.DS_Store
*.pem
*.env
.env*.local
*.log
coverage.json
/.idea
test*.svg
lcov.info

# broadcasts
!/broadcast
/broadcast/*
/broadcast/*/31337/

# typescript
*.tsbuildinfo
next-env.d.ts
.idea/
.vscode/
graph/.test.subgraph.yaml
# platform specific
shell.nix

# playwright
playwright-report/
# IDES
.idea
.vscode
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "lib/murky"]
path = lib/murky
url = https://github.com/dmfxyz/murky
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/prb-test"]
path = lib/prb-test
url = https://github.com/paulrberg/prb-test/
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm format:staged
pnpm dlx lint-staged
forge snapshot
pnpm docs
10 changes: 0 additions & 10 deletions .lintstagedignore

This file was deleted.

7 changes: 2 additions & 5 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"**/*.{js,jsx,ts,tsx,sol}": [
"eslint --ignore-path .gitignore --ignore-path .lintstagedignore",
"prettier --write"
],
"**/*.{md,json}": ["prettier --write"]
"*.{js,json,md,ts,yml}": ["prettier --config ./.prettierrc.yml --write"],
"*.{sol}": ["forge fmt"]
}
File renamed without changes.
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading