Initial build for QIE Mainnet Hackathon 3.0 (DeFi & Financial Infrastructure track). Includes: - packages/contracts: constant-product AMM (factory/pair/router), over-collateralized lending vault, and an oracle adapter wrapping QIE's real deployed price-feed contracts. 25/25 Foundry tests pass locally. Clean-room: no existing DEX/lending protocol source was read or copied. - packages/core: TypeScript SDK (viem-based) for QIE's chain, the real (corrected) oracle ABI, a fail-closed QUSDC helper, a Blockscout explorer client, and QIE Wallet connection constants. Live-verified against real testnet (chain 1983) and mainnet (chain 1990) RPCs and the real oracle contracts. - packages/cli: a small CLI built on @qie-forge/core. Real findings from building this, documented in README.md and docs/STATUS.md: the previously-documented testnet RPC URL is dead (replacement found and verified live); QIE's own oracle docs describe a getPrice(string) function that reverts on the real deployed contracts, which actually implement a Chainlink AggregatorV3-style interface (verified live via raw eth_call); the oracle is deployed on Mainnet only, not Testnet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
140 lines
3.8 KiB
YAML
140 lines
3.8 KiB
YAML
name: checks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- next-v*
|
|
- release-v*
|
|
pull_request: {}
|
|
workflow_dispatch: {}
|
|
|
|
concurrency:
|
|
group: checks-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read # actions/checkout
|
|
actions: read # gas-compare: gh run list / gh run download
|
|
pull-requests: read # gas-compare: gh pr diff
|
|
|
|
env:
|
|
NODE_OPTIONS: --max_old_space_size=8192
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Set up environment
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
foundry: 'on'
|
|
- run: npm run lint
|
|
- run: forge compile && forge lint --deny notes --only-lint unused-import
|
|
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
FORCE_COLOR: 1
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up environment
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
foundry: 'on' # needed by npm run test:pragma
|
|
- name: Run tests and generate gas report
|
|
run: npm run test -- --gas-stats-json gasReport.json
|
|
- name: Check linearisation of the inheritance graph
|
|
run: npm run test:inheritance
|
|
- name: Check pragma validity
|
|
run: npm run test:pragma -- --concurrency 1
|
|
- name: Check procedurally generated contracts are up-to-date
|
|
run: npm run test:generation
|
|
- name: Compare gas costs
|
|
uses: ./.github/actions/gas-compare
|
|
with:
|
|
token: ${{ github.token }}
|
|
report: gasReport.json
|
|
|
|
tests-upgradeable:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
FORCE_COLOR: 1
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0 # Include history so patch conflicts are resolved automatically
|
|
- name: Set up environment
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
foundry: 'on' # needed by npm run test:pragma
|
|
- name: Copy non-upgradeable contracts as dependency
|
|
run: |
|
|
mkdir -p lib/openzeppelin-contracts
|
|
cp -rnT contracts lib/openzeppelin-contracts/contracts
|
|
- name: Transpile to upgradeable
|
|
run: bash scripts/upgradeable/transpile.sh
|
|
- name: Run tests
|
|
run: npm run test
|
|
- name: Check linearisation of the inheritance graph
|
|
run: npm run test:inheritance
|
|
- name: Check pragma validity
|
|
run: npm run test:pragma -- --concurrency 1
|
|
- name: Check storage layout
|
|
uses: ./.github/actions/storage-layout
|
|
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'breaking change') }}
|
|
with:
|
|
token: ${{ github.token }}
|
|
|
|
coverage:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up environment
|
|
uses: ./.github/actions/setup
|
|
- name: Run coverage
|
|
run: npm run coverage
|
|
- uses: codecov/codecov-action@v7
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
harnesses:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up environment
|
|
uses: ./.github/actions/setup
|
|
- name: Compile harnesses
|
|
run: |
|
|
make -C fv apply
|
|
npm run compile:harnesses
|
|
|
|
slither:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
FOUNDRY_PROFILE: slither
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Set up environment
|
|
uses: ./.github/actions/setup
|
|
- uses: crytic/slither-action@v0.4.1
|
|
|
|
codespell:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Run CodeSpell
|
|
uses: codespell-project/actions-codespell@v2.4.3
|
|
with:
|
|
check_hidden: true
|
|
check_filenames: true
|
|
skip: package-lock.json,*.pdf,vendor
|