Skip to content

Commit 2dd27c2

Browse files
authored
Merge pull request #1 from oasisprotocol/rube/inital-paymaster-code
initial code
2 parents 868e2b4 + 90e1bd7 commit 2dd27c2

File tree

90 files changed

+21999
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+21999
-2
lines changed

.github/workflows/ci-build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
2+
name: ci-build
3+
4+
# Trigger the workflow when:
5+
on:
6+
# A push occurs to one of the matched branches.
7+
push:
8+
branches:
9+
- main
10+
- master
11+
- stable/*
12+
# Or when a pull request event occurs for a pull request against one of the
13+
# matched branches.
14+
pull_request:
15+
branches:
16+
- main
17+
- master
18+
- stable/*
19+
20+
# Cancel in-progress jobs on same branch.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
env:
26+
CMAKE_POLICY_VERSION_MINIMUM: 3.5
27+
28+
jobs:
29+
docker-build:
30+
name: docker-build
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Show Docker and Compose versions
37+
run: |
38+
docker --version
39+
docker compose version
40+
41+
- name: Build images with Docker Compose
42+
working-directory: ./paymaster-relayer
43+
run: docker compose build

.github/workflows/ci-lint.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
2+
name: ci-lint
3+
4+
# Trigger the workflow when:
5+
on:
6+
# A push occurs to one of the matched branches.
7+
push:
8+
branches:
9+
- main
10+
- master
11+
- stable/*
12+
# Or when a pull request event occurs for a pull request against one of the
13+
# matched branches.
14+
pull_request:
15+
branches:
16+
- main
17+
- master
18+
- stable/*
19+
20+
# Cancel in-progress jobs on same branch.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
env:
26+
CMAKE_POLICY_VERSION_MINIMUM: 3.5
27+
28+
jobs:
29+
lint-markdown:
30+
name: lint-markdown
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Lint markdown
37+
uses: nosborn/[email protected]
38+
with:
39+
files: .
40+
config_file: .markdownlint.yml
41+
ignore_path: .markdownlintignore
42+
43+
lint-paymaster-relayer:
44+
name: lint-paymaster-relayer
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Setup Python and uv
51+
uses: astral-sh/setup-uv@v5
52+
with:
53+
python-version: '3.12'
54+
enable-cache: true
55+
56+
- name: Install dependencies
57+
working-directory: ./paymaster-relayer
58+
run: uv sync --dev
59+
60+
- name: Lint Python code
61+
working-directory: ./paymaster-relayer
62+
run: uv run ruff check --output-format=github .
63+
64+
lint-solidity:
65+
name: lint-solidity
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Bun
72+
uses: oven-sh/setup-bun@v1
73+
74+
- name: Install dependencies
75+
working-directory: ./contracts
76+
run: bun install
77+
78+
- name: Lint Solidity code
79+
working-directory: ./contracts
80+
run: bun run lint

.github/workflows/ci-test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
2+
name: ci-test
3+
4+
# Trigger the workflow when:
5+
on:
6+
# A push occurs to one of the matched branches.
7+
push:
8+
branches:
9+
- main
10+
- master
11+
- stable/*
12+
# Or when a pull request event occurs for a pull request against one of the
13+
# matched branches.
14+
pull_request:
15+
branches:
16+
- main
17+
- master
18+
- stable/*
19+
20+
# Cancel in-progress jobs on same branch.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
env:
26+
CMAKE_POLICY_VERSION_MINIMUM: 3.5
27+
28+
jobs:
29+
test-paymaster-relayer:
30+
name: test-paymaster-relayer
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Python and uv
37+
uses: astral-sh/setup-uv@v5
38+
with:
39+
python-version: '3.12'
40+
enable-cache: true
41+
42+
- name: Install dependencies
43+
working-directory: ./paymaster-relayer
44+
run: uv sync --dev
45+
46+
- name: Run tests
47+
working-directory: ./paymaster-relayer
48+
run: uv run pytest tests

.gitignore

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Dependencies
2+
node_modules/
3+
.npm
4+
.yarn/
5+
.pnpm-debug.log*
6+
7+
# Build outputs
8+
dist/
9+
build/
10+
out/
11+
12+
# Hardhat specific
13+
artifacts/
14+
cache/
15+
coverage/
16+
.coverage
17+
.nyc_output
18+
19+
# Python
20+
__pycache__/
21+
*.py[cod]
22+
*$py.class
23+
*.so
24+
.Python
25+
env/
26+
venv/
27+
ENV/
28+
env.bak/
29+
venv.bak/
30+
.pytest_cache/
31+
.coverage
32+
htmlcov/
33+
.tox/
34+
.nox/
35+
*.egg-info/
36+
.eggs/
37+
38+
# IDEs
39+
.vscode/
40+
.idea/
41+
*.swp
42+
*.swo
43+
*~
44+
45+
# OS
46+
.DS_Store
47+
.DS_Store?
48+
._*
49+
.Spotlight-V100
50+
.Trashes
51+
ehthumbs.db
52+
Thumbs.db
53+
54+
# Logs
55+
logs/
56+
*.log
57+
npm-debug.log*
58+
yarn-debug.log*
59+
yarn-error.log*
60+
lerna-debug.log*
61+
62+
# Environment variables
63+
.env
64+
.env.local
65+
.env.development.local
66+
.env.test.local
67+
.env.production.local
68+
.env.production
69+
70+
# Temporary files
71+
tmp/
72+
temp/
73+
74+
# Blockchain specific
75+
.openzeppelin/
76+
deployments/
77+
.chainId
78+
79+
# Python virtual environments
80+
.venv
81+
venv/
82+
virtualenv/
83+
my_env/
84+
85+
# MyPy
86+
.mypy_cache/
87+
.dmypy.json
88+
dmypy.json
89+
90+
# Jupyter Notebook
91+
.ipynb_checkpoints
92+
93+
# pyenv
94+
.python-version
95+
96+
# wake
97+
/.wake/
98+
99+
# Configuration files that might contain secrets
100+
config.local.*
101+
*.local.*
102+
!compose.local.yaml

.markdownlint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Enable default rules and set a stricter line length
2+
default: true
3+
4+
# MD013: Line length
5+
MD013:
6+
line_length: 80
7+
code_blocks: false # allow long lines in fenced code blocks
8+
tables: false # allow long lines in tables
9+
10+
# MD009: No trailing spaces at end of lines
11+
MD009:
12+
br_spaces: 0 # disallow hard line break spaces
13+
strict: true # flag any trailing whitespace
14+
15+
# MD029: Disable ordered list item prefix checking
16+
MD029: false # allow sequential numbering (1, 2, 3, 4)
17+
18+
# MD047: Files should end with a single newline character
19+
MD047: true

.markdownlintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
**/node_modules/
3+
.venv/
4+
**/.venv/
5+
dist/
6+
build/
7+
coverage/
8+
*.min.js
9+
vendor/
10+
*.local.*

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## ROFL Paymaster - Root Makefile
2+
3+
.PHONY: help lint-markdown fix-markdown
4+
.DEFAULT_GOAL := help
5+
6+
# Colors for output
7+
BLUE := \033[0;34m
8+
GREEN := \033[0;32m
9+
YELLOW := \033[1;33m
10+
NC := \033[0m # No Color
11+
12+
help: ## Show this help message
13+
@echo "$(BLUE)ROFL Paymaster - Repository Tasks$(NC)"
14+
@echo ""
15+
@echo "$(YELLOW)Top-level targets:$(NC)"
16+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(GREEN)%-22s$(NC) %s\n", $$1, $$2}'
17+
@echo ""
18+
@echo "$(YELLOW)Component workflows:$(NC)"
19+
@echo " - Contracts: see contracts/README.md"
20+
@echo " - Relayer: see paymaster-relayer/README.md"
21+
22+
lint-markdown: ## Lint Markdown files using markdownlint (Docker)
23+
@echo "$(BLUE)Linting Markdown files with markdownlint...$(NC)"
24+
docker run --rm -v "$$PWD:/work" -w /work ghcr.io/igorshubovych/markdownlint-cli:latest \
25+
markdownlint -c .markdownlint.yml --ignore-path .markdownlintignore .
26+
27+
fix-markdown: ## Auto-fix Markdown issues using markdownlint (Docker)
28+
@echo "$(BLUE)Fixing Markdown files with markdownlint --fix...$(NC)"
29+
docker run --rm -v "$$PWD:/work" -w /work ghcr.io/igorshubovych/markdownlint-cli:latest \
30+
markdownlint -c .markdownlint.yml --ignore-path .markdownlintignore --fix .

0 commit comments

Comments
 (0)