Skip to content

Commit

Permalink
chore: merge develop into main (#35)
Browse files Browse the repository at this point in the history
* feat: copied files from the simple-storage-example-plugin repo into package/contracts

* set monorepo package.json

* fix: CI/CD

* init subgraph

* fix: CI/CD

* feat: CI/CD improvements

* feat: cleaned devDependencies

* feat: improve CI step description

* subgraph bare bone (WIP)

* feat: add subpackages and cleaned dependencies

* feat: temporary readme

* feat: move packages

* fix: wrong path

* add post install

* plugin repo only

* switch to osx-ethers

* fix missing dir issue

* make it build

* build 1

* chore: cleaning

* feat: deleted contracts-versions

* feat: refactoring

* feat: refactoring

* feat: improvements

* feat: refactoring

* fix: linting and prettier

* feat: print more infos, remove unused function

* fix: print more info

* More infos

* Renaming

* More info

* fix: test failing because of wrong default test network

* feature: add subgraph workflow

* fix: rename flows

* fix: adapt triggers

* fix: install packages first

* fix: triggers

* feat: one .env file

* fix: .env paths

* fix: remove redundant checkout

* debug: print info

* debug: attempt fix

* fix: missing env variable

* fix: triggers

* Removed summaries

* WIP

* improvements

* fix: path

* fix: empty json handling

* fix: lint warnings

* add psp and pluginRepos related mapping WIP

* refactor PSP handlers (WIP)

* refactor PSP handlers (WIP)

* refactor PSP handlers (WIP)

* refactor PSP handlers (WIP)

* clean up

* create common id functions

* clean up

* Feature: Add js client (#2)

* add dummy js-client

* update yarn.lock

* update package.json

* fix formatting

* fix comments and add js-client github actions

* update js-client test workflow

* fix test workflow

* fix lint

* update workflow

* wip

* fix comments and add implementation

* update yarn lock and remove docs workflow

* Update packages/contracts-ethers/package.json

Co-authored-by: Jør∂¡ <[email protected]>

* Update packages/js-client/src/context.ts

Co-authored-by: Jør∂¡ <[email protected]>

* Update packages/js-client/test/unit/context.test.ts

Co-authored-by: Jør∂¡ <[email protected]>

* add tests

* fix comments

* fix comments

* update client-common version

* fix lint command

* Update packages/js-client/src/internal/modules/methods.ts

Co-authored-by: Jør∂¡ <[email protected]>

* update size limit

* update gh actions

* update gh actions

* fix gh actions

* add build command

* update gh actions

* fix gh action

* fix lint

* fix lint

* ignore js-client tests

* minor fixes

---------

Co-authored-by: Jør∂¡ <[email protected]>

* fix subgraph build

* fix lint

* map 1 event

* chore: bump package versions

* feat: added event, tests, and improved signer, renamed plugin

* fix: linting and formatting errors

* feature: support base goerli network

* Add missing migration import for setup processing

* feat: added sepolia and base support and fix IPFS returning empty strings (#10)

* feat: added sepolia and base support

* fix: replaced outdated IPFS server url

* fix: empty return value

* OS-593: refactors repo for linting and linting during workflows (#11)

* chore(OS-593): Removes .editorconfig from project root

Prettier uses its .prettierrc as a first priority to configure the
formatter

* chore(OS-593): Updates node to v18 in gitpod

* chore(OS-593): same network for subgraph and contracts

Use the same network for subgraph and contracts in the .env.example file

* chore(OS-593): configure vscode editor correctly

configures vscode to use fixed a tabsize of 4 and adds commitizen
extentions into recommendations

* chore(OS-593): reconfigures linting system to start from the root

all linting commands have to be run from the root, then eslint merges
the configs per package and lints those

* build(OS-593): refactors package.json and dependency handling

moves all linting commands to the root of the repo for proper config
merging

* chore(OS-593): adds solidity visual developer as recommmended

we recommend to use the solidity visual auditor extension for
development

* style(OS-593): fixes linting issues

fixes some linting issues in contracts and js-client

* ci(OS-593): refactor workflows and include linting

refactors workflows to be easier and includes formatting and linting in
all workflows

* style(OS-593): apply prettier formatting

* ci(OS-593): lint all packages indiviually

lints the packages individually and adds step summaries for important
steps

* ci(OS-593): remove prettier output from summary

prettiers output isn't really working with step summary

* ci(OS-593): uses now node 18 in workflows

* chore(OS-593): fix typo in formatting-linting.yml

* docs: added readme (#13)

* docs: added readme

* docs: fix typos

* Os 782 remove the contracts ethers and do rollup in mini sdk (#12)

* refactor(OS-782): removes contracts-ethers package

Removes a now unecessary contracts-ethers package. js-client creates its
own typechain now

BREAKING CHANGE: Removal of contracts-ethers

* refactor(OS-782): js-client generates typescript

js-client doesn't depend on contracts-ethers anymore and creates the
typechain typings during its own build

* test(OS-782): ganache replacment, optimizations, use native jest

replaces depricated ganache setup with hardhat for testing, removes
contract interactions where they aren't necessary, upgrades jest by not
using tsdx for testing

* ci(OS-782): fixes js-client publish and tests workflows

corrects reusable worfklow in js-client publishing workflow, adapts
js-client-tests to use the new typechain integration properly

* build(OS-782): removes contracts-ethers linting command

* chore(OS-782): applies prettier formatting

* refactor: renamed and refactored files

* refactor: skip repo creation if ENS name is already taken

* docs: added usage guide and improved comments

* ci: fix workflow by removing outdated lint

* ci: formatting & linting on every push

* docs: improve migration file comment

* ci: fix linting workflow

* build: use the same typescript version everywhere

* docs: improve usage guide

* docs: improved usage guide

* OS-754 : re-organize entity relations & add testing (#15)

* re organize entity relations

* add testing for OSx & Plugin

* remove extra files

* Update Satsuma deploy node url

* Clean up

* fix lint

* fix subgraph scripts

* fix subgraph test flow

* ci: fixed linting work flow

* add comment

* OSx: Remove redundant code

* flow: build contracts for subgraph testing

* flow: build root for subgraph testing

* flow: remove comments

* subgraph: update test constants and comments

* subgraph: refactor & add comments

* ci: skip js-client linting

* docs: fix typo

---------

Co-authored-by: Michael Heuer <[email protected]>

* fix(js-client): exclude dist from tsconfig.json (#20)

* fix(js-client): exclude dist from tsconfig.json

not excluding dist would result in an error trying to run tests after
the client has been built

* ci(js-client): fix missing env in build

* chore: added arbitrum and arbitrumGoerli (#18)

* chore: added arbitrum and arbitrumGoerli

* ci: fix ci pipeline by adding typescript dev dependency

* ci: fix pipeline by removing leftover contracts-ethers lint

* ci: do a global lint on every push

* fix: etherscan arbitrum name

* ci: skip js-client linting

* build: add cross-env to fix subgraph ci

* refactor: add event explicitly

* build(js-client): replaces tsdx with dts-cli (#21)

* build(js-client): replace tsdx with dts-cli
deps(js-client): update to typescript 5.2.2
deps(root): update eslint packages

* lint(js-client): fixes linting errors

* test(js-client): fixes jest-environment import

* style: apply prettier changes

* chore: bump OZ dependency (#22)

* docs: add readme and usage guide

* OS-888 fix: Import Repo address from plugin-info (#26)

* fix: Import repo address from plugin-info

* fix: fix typo

* update plugin-info.json location

* update script

* update gitignore

* update osx-ethers to version 1.3.0

* Update .gitignore

Co-authored-by: Michael Heuer <[email protected]>

* fix import

* remove alias import

---------

Co-authored-by: Jose Manuel Mariñas Bascoy <[email protected]>
Co-authored-by: josemarinas <[email protected]>
Co-authored-by: Michael Heuer <[email protected]>

* build: clean-up of dependecy and commands  (#19)

* build: remove docker-related commands

* build: remove local subgraphs commands

* chore: bump dependencies

* build: bump OZ version and fix unmet dependencies

* Feature: Add Subgraph step-by-step guide (#25)

* add step-by-step guide

* fiux lintint

* fix comments

* fix lint

* fix: Remove individual usage

* fix: update .env.example to include Sepolia

* docs: Improve usage guide

* fix: replace arbitrumGoerli and baseGoerli with the sepolia replacements

* fix: improve usage format

* Apply suggestions from code review

Co-authored-by: Michael Heuer <[email protected]>

* feat: improve usage guide file structure & address comments

* fix: remove redundant titles

* fix: link dependencies in the usage guide

* fix: fix typo

* Apply suggestions from code review

Co-authored-by: Michael Heuer <[email protected]>

---------

Co-authored-by: Rekard0 <[email protected]>
Co-authored-by: Michael Heuer <[email protected]>

* feat: use `osx-commons-contracts` and `osx-commons-configs` (#28)

* build: use ts 5.2.2

* refactor: use osx-commons

* refactor: use osx-commons

* build: use osx-commons-sdk

* build: use osx-commons-sdk

* refactor: contract improvements

* build: print coverage report

* chore: bump osx-commons-sdk version

* feat: use the latest osx-commons-contracts

* refactor: use osx-commons-configs and deploy script refactor

* build: subgraph fix

* docs: improve .env example

* style: fix prettier

* build: use osx-commons

* chore: bump subgraph osx-ethers dependency

* chore: remove todo

* test: remove redundant expect

* fix: use unknown instead of any

* fix: imports

* fix: wrong type

* fix: import

* fix: import

* feat: use typechain binding

* refactor: deploy script simplification

* refactor: findPluginRepo and domain

* refactor: improve code, comments, and tests

* refactor: improved helpers

* style: fix linting issues

* chore: remove todos

* revert: deletion of hashHelpers

* feat: catch errors properly

* refactor: folder structure

* refactor: help gh to track files

* refactor: help gh to track files

* refactor: improve folder structure (#30)

* build: remove js client (#31)

* ci: clean GH flows and remove gitpod (#32)

* ci: improve flows

* style: remove unused commitizen config file

* build: update yarn.lock

* docs: update README.md (#33)

* docs: update README.md

* doc: improve README and USAGE_GUIDE

* doc: minor improvement

* feat: use commons subgraph (#29)

* use commons subgraph

* update events folder structure

* fix comments

* fix tests

* build: update yarn.lock

---------

Co-authored-by: Michael Heuer <[email protected]>

* build: improve  package.json files (#34)

---------

Co-authored-by: Rekard0 <[email protected]>
Co-authored-by: josemarinas <[email protected]>
Co-authored-by: Jør∂¡ <[email protected]>
Co-authored-by: Jør∂¡ <[email protected]>
Co-authored-by: Mathias Scherer <[email protected]>
Co-authored-by: Aaron Abu Usama <[email protected]>
Co-authored-by: Jose Manuel Mariñas Bascoy <[email protected]>
  • Loading branch information
8 people authored Feb 14, 2024
1 parent f808146 commit 5f69964
Show file tree
Hide file tree
Showing 73 changed files with 15,318 additions and 67 deletions.
32 changes: 32 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# GENERAL

## The network used for testing purposes
NETWORK_NAME="sepolia" # ["mainnet", "sepolia", "polygon", "polygonMumbai", "base", "baseSepolia", "arbitrum", "arbitrumSepolia"]

# CONTRACTS

## One or multiple hex encoded private keys separated by commas `,` replacing the hardhat default accounts.
PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" # Default hardhat account 0 private key. DON'T USE FOR DEPLOYMENTS

## Infura credentials
INFURA_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"

## Gas Reporting
REPORT_GAS='true'
COINMARKETCAP_API_KEY="zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz"

## Block explorers
ETHERSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
POLYGONSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
BASESCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
ARBISCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"

# SUBGRAPH

## The Graph credentials
GRAPH_KEY="zzzzzzzzzzzz"

## Subgraph
SUBGRAPH_NAME="osx"
SUBGRAPH_VERSION="v1.0.0"
SUBGRAPH_NETWORK_NAME="mainnet" # ["mainnet", "goerli", "sepolia", "polygon", "polygonMumbai", "base", "baseSepolia", "arbitrum", "arbitrumSepolia"]
27 changes: 27 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
root: true
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/eslint-recommended'
- 'plugin:@typescript-eslint/recommended'
- 'prettier'
plugins:
- '@typescript-eslint'
rules:
'@typescript-eslint/no-floating-promises':
- error
- ignoreIIFE: true
ignoreVoid: true
'@typescript-eslint/no-inferrable-types': 'off'
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: '_'
varsIgnorePattern: '_'

ignorePatterns:
- '*.log'
- '*.env'
- '.env'
- '.DS_Store'
- .pnp.*
- 'node_modules'
10 changes: 10 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# These labels (common, client, ipfs and client-common) are only informative.
# While the labels <pkg-name>-release are for triggering the release process.

contracts:
- ./packages/contracts/**/*
- ./packages/contracts/*

subgraph:
- ./packages/subgraph/**/*
- ./packages/subgraph/*
39 changes: 39 additions & 0 deletions .github/workflows/contracts-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'contracts'

on:
workflow_dispatch:
push:
paths:
- 'packages/contracts/**'
- '.github/workflows/contracts-*.yml'

jobs:
formatting-linting:
uses: ./.github/workflows/formatting-linting.yml
tests:
runs-on: 'ubuntu-latest'
defaults:
run:
working-directory: packages/contracts
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@v3'

- name: 'Install Node.js'
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
node-version: 18

- name: 'Install the dependencies'
run: 'yarn install --frozen-lockfile'

- name: 'Build the contracts'
run: 'yarn build'
env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

- name: 'Test the contracts and generate the coverage report'
run: 'yarn coverage'
env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
34 changes: 34 additions & 0 deletions .github/workflows/formatting-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'formatting & linting'

on:
workflow_dispatch:
workflow_call:
push:

jobs:
checks:
runs-on: 'ubuntu-latest'
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@v3'

- name: 'Install Node.js'
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
node-version: 18

- name: 'Install the dependencies'
run: 'yarn install --frozen-lockfile'

- name: 'Check code formatting'
run: 'yarn prettier:check'

- name: 'Lint contracts solidity'
run: 'yarn lint:contracts:sol'

- name: 'Lint contracts ts and js'
run: 'yarn lint:contracts:ts'

- name: 'Lint subgraph ts and js'
run: 'yarn lint:subgraph:ts'
11 changes: 11 additions & 0 deletions .github/workflows/pull-request-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Pull Request Labeler
on:
- pull_request_target

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
sync-labels: true
48 changes: 48 additions & 0 deletions .github/workflows/subgraph-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'subgraph'

on:
workflow_dispatch:
push:
paths:
- 'packages/subgraph/**'
- 'packages/contracts/**'
- '.github/workflows/subgraph-*.yml'

jobs:
formatting-linting:
uses: ./.github/workflows/formatting-linting.yml
tests:
runs-on: 'ubuntu-latest'

steps:
- name: 'Check out the repo'
uses: 'actions/checkout@v3'

- name: 'Install Node.js'
uses: 'actions/setup-node@v3'
with:
cache: 'yarn'
node-version: 18

- name: 'Install root dependencies'
run: 'yarn install --frozen-lockfile'
working-directory: .

- name: 'Install dependencies for contracts'
run: 'yarn install --frozen-lockfile'
working-directory: packages/contracts

- name: 'Install the dependencies for subgraph'
run: 'yarn install --frozen-lockfile'
working-directory: packages/subgraph

- name: 'Build the subgraph'
run: yarn build
working-directory: packages/subgraph
env:
SUBGRAPH_NETWORK_NAME: ${{ vars.SUBGRAPH_NETWORK_NAME }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}

- name: 'Test the subgraph'
run: yarn test
working-directory: packages/subgraph
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# directories
.coverage_artifacts
.coverage_cache
.coverage_contracts
artifacts
build
cache
coverage
dist
node_modules
typechain

packages/subgraph/imported
packages/subgraph/generated
packages/subgraph/tests/.bin

# files
*.env
*.log
.DS_Store
.pnp.*
coverage.json

packages/subgraph/deploy-output.txt
packages/subgraph/subgraph.yaml
packages/subgraph/tests/.latest.json
packages/subgraph/tests/helpers/extended-schema.ts
27 changes: 27 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# directories
.coverage_artifacts
.coverage_cache
.coverage_contracts
artifacts
build
cache
coverage
deployments
dist
node_modules
typechain
types
imported
generated
*/js-client/test/integration/*.test.ts

# files
*.env
*.log
.DS_Store
.pnp.*
coverage.json
package-lock.json
pnpm-lock.yaml
yarn.lock
extended-schema.ts
28 changes: 28 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"bracketSpacing": false,
"singleQuote": true,
"arrowParens": "avoid",

"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 100,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.md",
"options": {
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false
}
}
]
}
19 changes: 19 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.8.4"],
"func-visibility": ["error", {"ignoreConstructors": true}],
"max-line-length": ["error", 120],
"named-parameters-mapping": "warn",
"no-console": "off",
"not-rely-on-time": "off",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
}
3 changes: 3 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# directories
**/artifacts
**/node_modules
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"NomicFoundation.hardhat-solidity",
"KnisterPeter.vscode-commitizen",
"tintinweb.solidity-visual-auditor"
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.documentSelectors": ["**/*.sol"],
"solidity.formatter": "prettier",
"editor.tabSize": 4
}
Loading

0 comments on commit 5f69964

Please sign in to comment.