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

feat: add AgTokens, CoreBorrow and FlashLoan #1

Merged
merged 20 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
26 changes: 26 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Add URI and BIP39 mnemonic, and etherscan API key for every network that you plan to use
## These are used in `hardhat.config.ts` (see `nodeUrl` and `accounts` calls in network definitions)
#ETH_NODE_URI_FORK=""
#MNEMONIC_FORK=""
#ETHERSCAN_API_KEY=""

## To do mainnet fork in Polygon
#ETH_NODE_URI_FORKPOLYGON=""

## To do a local Ethereum mainnet fork
#ETH_NODE_URI_MAINNETFORKREMOTE=""

#ETH_NODE_URI_GOERLI=""
#MNEMONIC_GOERLI=""
#GOERLI_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_MAINNET=""
#MNEMONIC_MAINNET=""
#MAINNET_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_POLYGON=""
#MNEMONIC_POLYGON=""
#POLYGON_ETHERSCAN_API_KEY=""

#ETH_NODE_URI_FANTOM=""

35 changes: 35 additions & 0 deletions .github/actions/setup-repo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Setup repo
description: Runs all steps to setup the repo (install node_modules, build, etc...)
inputs:
registry-token:
description: 'PAT to access registries'
runs:
using: 'composite'
steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: |
echo "::set-output name=dir::$(yarn cache dir)"
echo "::set-output name=version::$(yarn -v)"

- uses: actions/setup-node@v3
with:
node-version: '20'

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}

key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
shell: bash
run: echo "//npm.pkg.github.com/:_authToken=$GH_REGISTRY_ACCESS_TOKEN" >> .npmrc && yarn install --frozen-lockfile --verbose && rm -f .npmrc
env:
GH_REGISTRY_ACCESS_TOKEN: ${{ inputs.registry-token }}
14 changes: 14 additions & 0 deletions .github/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 173 additions & 0 deletions .github/workflows/ci-deep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: "CI Deep"

env:
FOUNDRY_PROFILE: "ci"

on:
schedule:
- cron: "0 3 * * 0" # at 3:00am UTC every Sunday
workflow_dispatch:
inputs:
fuzzRuns:
default: "10000"
description: "Unit: number of fuzz runs."
required: false
invariantRuns:
default: "300"
description: "Unit: number of invariant runs."
required: false
invariantDepth:
default: "50"
description: "Unit: invariant depth."
required: false

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Setup repo
uses: ./.github/actions/setup-repo
with:
registry-token: ${{ secrets.GH_REGISTRY_ACCESS_TOKEN }}

- name: Run solhint
run: yarn lint:check

- name: "Add lint summary"
run: |
echo "## Lint result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

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

- name: Setup repo
uses: ./.github/actions/setup-repo
with:
registry-token: ${{ secrets.GH_REGISTRY_ACCESS_TOKEN }}

- name: Compile foundry
run: yarn compile --sizes

- name: "Cache the build so that it can be re-used by the other jobs"
uses: "actions/cache/save@v3"
with:
key: "build-${{ github.sha }}"
path: |
cache-forge
out
node_modules

- name: "Add build summary"
run: |
echo "## Build result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

test-unit:
needs: ["build", "lint"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

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

- name: Run Foundry tests
run: yarn test:unit
env:
ETH_NODE_URI_POLYGON: ${{ secrets.ETH_NODE_URI_POLYGON }}
ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }}
ETH_NODE_URI_OPTIMISM: ${{ secrets.ETH_NODE_URI_OPTIMISM }}
ETH_NODE_URI_MAINNET: ${{ secrets.ETH_NODE_URI_MAINNET }}

# test-invariant:
# needs: ["build", "lint"]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: "recursive"
#
# - uses: actions/cache/restore@v3
# with:
# fail-on-cache-miss: true
# path: |
# cache-forge
# out
# node_modules
# key: "build-${{ github.sha }}"
#
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly
#
# - name: Run Foundry tests
# run: yarn test:invariant
# env:
# FOUNDRY_INVARIANT_RUNS: ${{ github.event.inputs.invariantRuns || '300' }}
# FOUNDRY_INVARIANT_DEPTH: ${{ github.event.inputs.invariantDepth || '50' }}
# ETH_NODE_URI_POLYGON: ${{ secrets.ETH_NODE_URI_POLYGON }}
# ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }}
# ETH_NODE_URI_OPTIMISM: ${{ secrets.ETH_NODE_URI_OPTIMISM }}
# ETH_NODE_URI_MAINNET: ${{ secrets.ETH_NODE_URI_MAINNET }}
#
# test-fuzz:
# needs: ["build", "lint"]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: "recursive"
#
# - uses: actions/cache/restore@v3
# with:
# fail-on-cache-miss: true
# path: |
# cache-forge
# out
# node_modules
# key: "build-${{ github.sha }}"
#
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly
#
# - name: Run Foundry tests
# run: yarn test:fuzz
# env:
# FOUNDRY_FUZZ_RUNS: ${{ github.event.inputs.fuzzRuns || '10000' }}
# ETH_NODE_URI_POLYGON: ${{ secrets.ETH_NODE_URI_POLYGON }}
# ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }}
# ETH_NODE_URI_OPTIMISM: ${{ secrets.ETH_NODE_URI_OPTIMISM }}
# ETH_NODE_URI_MAINNET: ${{ secrets.ETH_NODE_URI_MAINNET }}
Loading
Loading