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: new features implementation #68

Open
wants to merge 122 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
9ac380c
decrease a and formatting
Nov 9, 2024
b609ee9
stable asset factory
Nov 10, 2024
d32bd88
finish stable asset factory
Nov 19, 2024
d2812fc
feat: migrated to foundry
0xSolDev Dec 9, 2024
18cd0cb
feat: updated readme
0xSolDev Dec 9, 2024
4e4ecf7
fix: added yarn lock
0xSolDev Dec 9, 2024
b17fa58
fix: fixed lint
0xSolDev Dec 9, 2024
cdd4e40
feat: use beacon
0xSolDev Dec 9, 2024
881ea96
feat: added configs
0xSolDev Dec 10, 2024
014d415
feat: modify symbol
0xSolDev Dec 10, 2024
0c052c1
fix: added admin modified event
0xSolDev Dec 10, 2024
c2e61a8
feat: choose exchange rate provider
0xSolDev Dec 11, 2024
39d6dd3
feat: renamed lp token contracts
0xSolDev Dec 11, 2024
3de94d1
feat: auto percision
0xSolDev Dec 11, 2024
e0d94f7
feat: wip - tests
0xSolDev Dec 11, 2024
7f42b40
feat: check balance in test
0xSolDev Dec 12, 2024
99af94b
fix: fixed build
0xSolDev Dec 12, 2024
28ec9a5
fix: fixed factory size
0xSolDev Dec 12, 2024
93d0f27
feat: added deployment scripts
0xSolDev Dec 12, 2024
466f46e
chore: fixed lint
0xSolDev Dec 12, 2024
3650acb
fix: fixed build
0xSolDev Dec 12, 2024
ad8b003
feat: deployed to testnet
0xSolDev Dec 13, 2024
c31ef7b
feat: instructions to verify contract
0xSolDev Dec 13, 2024
16a059c
feat: added create pool script
0xSolDev Dec 13, 2024
358c676
fix: redeployed
0xSolDev Dec 13, 2024
9ef1bd9
fix: updated to v1.5 audited code
0xSolDev Dec 16, 2024
b7debda
fix: fixed compiler version
0xSolDev Dec 16, 2024
38f09c2
fix: fixed lint
0xSolDev Dec 16, 2024
a655f38
fix: removed lastRedeemOrMint
0xSolDev Dec 16, 2024
77caec2
fix: removed lastRedeemOrMint
0xSolDev Dec 16, 2024
68aef87
feat: added types for token A
0xSolDev Dec 17, 2024
3b31965
feat: added a unit test
0xSolDev Dec 17, 2024
dc5e9fa
feat: added test for exchange rate tokens
0xSolDev Dec 17, 2024
1b39a88
fix: fixed lint
0xSolDev Dec 17, 2024
5274a0e
feat: convert WLPToken to ERC4626 standard
0xSolDev Dec 18, 2024
777c498
feat: use uups upgrades
0xSolDev Dec 18, 2024
3e49ab3
fix: fixed lint
0xSolDev Dec 18, 2024
64a16b2
feat: updated governance model for factory
0xSolDev Dec 19, 2024
ee4c890
fix: fixed test
0xSolDev Dec 19, 2024
30ab88e
fix: fixed scripts
0xSolDev Dec 19, 2024
ea8bfe6
fix: remove timelock from factory
0xSolDev Dec 21, 2024
421add1
feat: renamed to self pegging asset
0xSolDev Dec 23, 2024
19e12d4
feat: use custom errors
0xSolDev Dec 24, 2024
d31c92f
fix: fixed admin privilages
0xSolDev Dec 24, 2024
fd0f54d
fix: merge conflict
0xSolDev Dec 24, 2024
5677293
fix: removed application contract
0xSolDev Dec 25, 2024
d8e4540
fix: merge conflict
0xSolDev Dec 25, 2024
d7da416
feat: added netspec
0xSolDev Dec 25, 2024
846fa0c
fix: added netspec
0xSolDev Dec 25, 2024
6d763d4
fix: refactored tests
0xSolDev Dec 25, 2024
b3e76a4
feat: upgraded oz
0xSolDev Dec 28, 2024
f30361a
feat: added tests
0xSolDev Dec 28, 2024
9f2a7be
feat: added tests
0xSolDev Dec 28, 2024
790ba15
feat: added tests
0xSolDev Dec 28, 2024
8b03f90
feat: added tests
0xSolDev Dec 28, 2024
acbf81b
feat: added tests
0xSolDev Dec 28, 2024
2e87c5e
feat: reverted tests
0xSolDev Dec 28, 2024
cfe6617
feat: added lp and wlp token tests
0xSolDev Dec 29, 2024
1a28658
feat: deployed on base sepolia
0xSolDev Dec 30, 2024
88d46b4
feat: created pool
0xSolDev Dec 30, 2024
dc3116d
fix: revert contract
0xSolDev Dec 30, 2024
78e79e0
fix: updated readme
0xSolDev Dec 30, 2024
323b737
fix: fixed lint
0xSolDev Dec 31, 2024
b376364
fix: fixed lint
0xSolDev Dec 31, 2024
b443603
Merge pull request #66 from nutsfinance/feat/demo-deployment
0xSolDev Dec 31, 2024
27790a9
Merge pull request #65 from nutsfinance/feat/tests
0xSolDev Dec 31, 2024
3b60b4a
Merge pull request #64 from nutsfinance/feat/coding-standard
0xSolDev Dec 31, 2024
993b4c7
Merge pull request #63 from nutsfinance/feat/timelock-integration
0xSolDev Dec 31, 2024
db8eaed
Merge pull request #62 from nutsfinance/feat/uups-upgradable
0xSolDev Dec 31, 2024
89e99ce
feat: overwrite preview and withdraw funcs
0xSolDev Dec 31, 2024
4ff4518
fix: remove duplicate override
0xSolDev Dec 31, 2024
c07f54e
fix: added mint function override
0xSolDev Dec 31, 2024
430f9d3
Merge pull request #61 from nutsfinance/feat/erc-4626
0xSolDev Dec 31, 2024
de3d17d
Merge pull request #60 from nutsfinance/feat/token-a-types
0xSolDev Dec 31, 2024
aa6bf74
Merge pull request #59 from nutsfinance/feat/factory-enhancements
0xSolDev Dec 31, 2024
eabe609
fix: fixed comment
0xSolDev Dec 31, 2024
15c8d44
feat: increase/decrease supply for updating A
0xSolDev Jan 4, 2025
67901f9
fix: added tests
0xSolDev Jan 4, 2025
fcb6d06
fix: fixed lint
0xSolDev Jan 4, 2025
9f1e446
feat: use global A
0xSolDev Jan 5, 2025
42ae050
feat: optimise loops
0xSolDev Jan 5, 2025
7f995ec
feat: added erc4626 test
0xSolDev Jan 5, 2025
63b0609
feat: increase coverage
0xSolDev Jan 5, 2025
28a78ff
fix: added custom errors
0xSolDev Jan 5, 2025
f66b3f2
fix: added custom error
0xSolDev Jan 5, 2025
3700a7e
Merge pull request #67 from nutsfinance/feat/updateA
0xSolDev Jan 5, 2025
9e09a7e
feat: addressed comments
0xSolDev Jan 5, 2025
0ece430
fix: fixed test
0xSolDev Jan 5, 2025
854b7bd
fix: fixed comments
0xSolDev Jan 6, 2025
12706a1
fix: remove unused dependency
0xSolDev Jan 6, 2025
429dfc0
fix: removed event param
0xSolDev Jan 6, 2025
77c47b4
fix: fixed lint
0xSolDev Jan 6, 2025
de11b05
fix: added dependency
0xSolDev Jan 6, 2025
6611725
fix: fixed lint
0xSolDev Jan 6, 2025
eb135cc
fix: update docs
0xSolDev Jan 9, 2025
180bb93
fix: generated docs
0xSolDev Jan 9, 2025
c104563
fix: added docs ci
0xSolDev Jan 9, 2025
00cfe46
fix: test page
0xSolDev Jan 9, 2025
c3238d0
fix: added setup
0xSolDev Jan 9, 2025
f005497
fix: fixed lint
0xSolDev Jan 9, 2025
0bf6df3
fix: added scope
0xSolDev Jan 9, 2025
0936d18
fix: change docs branch
0xSolDev Jan 9, 2025
90fda47
fix: test ci
0xSolDev Jan 9, 2025
6c5f037
Revert "fix: test ci"
0xSolDev Jan 9, 2025
811d6e2
fix: fixed wlptoken name and symbol
0xSolDev Jan 30, 2025
68daf16
fix: use bytes instead of string for function signature
0xSolDev Jan 30, 2025
51e69a0
fix: make allowance mapping private
0xSolDev Jan 30, 2025
da39399
fix: renamed getPendingYieldAmount
0xSolDev Jan 30, 2025
10ee4b5
fix: prevent revert if D doesn't increase
0xSolDev Jan 30, 2025
906ed86
fix: fixed inflation attack
0xSolDev Jan 30, 2025
e858e2a
feat: added dynamic fees
0xSolDev Feb 2, 2025
6bd8d0b
fix: fixed var for dynamic calc
0xSolDev Feb 11, 2025
7687b7c
fix: fixed var case
0xSolDev Feb 11, 2025
ee6b6d0
fix: recover bad debt of buffer
0xSolDev Feb 15, 2025
9a37b95
fix: automatic loss handling using buffer and negative rebase using g…
0xSolDev Feb 15, 2025
7d96f06
fix: make debt optional
0xSolDev Feb 15, 2025
c8f2fe0
fix: get decimals dynamically for custom oracle
0xSolDev Feb 15, 2025
7ad7719
fix: fixed lint
0xSolDev Feb 15, 2025
78e3bd5
fix: tests coverage for loss handling
0xSolDev Feb 15, 2025
ba0f096
fix: tests coverage for recovering bad debt
0xSolDev Feb 15, 2025
5a3da22
fix: added netspec
0xSolDev Feb 20, 2025
b5b9278
fix: optimise isFee
0xSolDev Feb 20, 2025
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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig http://EditorConfig.org

# top-most EditorConfig file
root = true

# All files
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.sol]
indent_size = 4

[*.tree]
indent_size = 1
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
MNEMONIC=
export TESTNET=true
export HEX_PRIV_KEY="HEX_PRIV_KEY"
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
custom: "https://3cities.xyz/#/pay?c=CAESFAKY9DMuOFdjE4Wzl2YyUFipPiSfIgICATICCAJaFURvbmF0aW9uIHRvIFBhdWwgQmVyZw"
github: "PaulRBerg"
20 changes: 20 additions & 0 deletions .github/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup Node and Foundry
description: Comprehensive setup for Node.js environment with Foundry toolchain

runs:
using: composite
steps:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- uses: actions/setup-node@v4
with:
node-version: 20.x
check-latest: true
cache: yarn

- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile --audit
224 changes: 72 additions & 152 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,177 +1,97 @@
name: E2E (tapio-qa)
name: "CI"

env:
FOUNDRY_PROFILE: "ci"

# Trigger this workflow on merge (push the code to the main)
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- workflow-for-running-tapio-qa-tests
workflow_dispatch:

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
github.head_ref || github.ref }}"
cancel-in-progress: true
- "main"

jobs:
e2e-chrome:
runs-on: ubuntu-latest
lint:
runs-on: "ubuntu-latest"
steps:
- name: Checkout nutsfinance/tapio-qa private repo
uses: actions/checkout@main
- name: "Check out the repo"
uses: "actions/checkout@v4"

- uses: actions/setup-node@v2
with:
repository: nutsfinance/tapio-qa
token: ${{ secrets.GH_PAT }} #Please provide your Personal Access Token
node-version: 18
cache: "yarn"

- name: Install pnpm
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # [email protected]
- name: "Install the Node.js dependencies"
run: "yarn install"

- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # [email protected]
with:
node-version: 18.16
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: Set pnpm cache directory
run: pnpm config set store-dir .pnpm-store
continue-on-error: true
- name: "Lint the code"
run: "yarn run lint"

- name: Setup cache
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # pin@v2
with:
path: |
.pnpm-store
node_modules
/home/runner/.cache/Cypress
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-v1-
continue-on-error: true

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Install linux deps
- name: "Add lint summary"
run: |
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb
echo "## Lint result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

- name: Run xvfb and fluxbox as virtual monitors
run: |
Xvfb :0 -screen 0 1024x768x24 -listen tcp -ac &
fluxbox &
env:
DISPLAY: :0.0

- name: Run e2e tests (cypress-action)
uses: cypress-io/github-action@cdbbcd60fb5d967d7a37d8eb148add76a7ded7b6 # [email protected]
continue-on-error: true
build:
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"

- uses: actions/setup-node@v2
with:
command: pnpm cypress:run:chrome
browser: chrome
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
DISPLAY: :0.0
- name: Generate HTML report
node-version: 18
cache: "yarn"

- name: "Install the Node.js dependencies"
run: "yarn install"

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

- name: "Build the contracts and print their size"
run: "forge build --sizes"

- name: "Add build summary"
run: |
pnpm run posttest
- name: Archive e2e artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v2
if: always()
with:
name: e2e-artifacts
path: |
/home/runner/work/tapio-eth/tapio-eth/output.html
/home/runner/work/tapio-eth/tapio-eth/cypress/mochawesome-report
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/videos
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/screenshots
continue-on-error: true
- name: Send Slack notification
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
e2e-edge:
runs-on: ubuntu-latest
echo "## Build result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

test:
needs: ["lint", "build"]
runs-on: "ubuntu-latest"
steps:
- name: Checkout nutsfinance/tapio-qa private repo
uses: actions/checkout@main
- name: "Check out the repo"
uses: "actions/checkout@v4"

- uses: actions/setup-node@v2
with:
repository: nutsfinance/tapio-qa
token: ${{ secrets.GH_PAT }} #Please provide your Personal Access Token
node-version: 18
cache: "yarn"

- name: Install pnpm
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # [email protected]
- name: "Install the Node.js dependencies"
run: "yarn install"

- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # [email protected]
with:
node-version: 18.16
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: Set pnpm cache directory
run: pnpm config set store-dir .pnpm-store
continue-on-error: true
- name: "Show the Foundry config"
run: "forge config"

- name: Setup cache
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # pin@v2
with:
path: |
.pnpm-store
node_modules
/home/runner/.cache/Cypress
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-v1-
continue-on-error: true

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Install linux deps
run: |
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb
- name: "Generate a fuzz seed that changes weekly to avoid burning through RPC allowance"
run: >
echo "FOUNDRY_FUZZ_SEED=$(
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800))
)" >> $GITHUB_ENV

- name: Run xvfb and fluxbox as virtual monitors
run: |
Xvfb :0 -screen 0 1024x768x24 -listen tcp -ac &
fluxbox &
env:
DISPLAY: :0.0

- name: Run e2e tests (cypress-action)
uses: cypress-io/github-action@cdbbcd60fb5d967d7a37d8eb148add76a7ded7b6 # [email protected]
continue-on-error: true
with:
command: pnpm cypress:run:edge
browser: edge
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
DISPLAY: :0.0
- name: Generate HTML report
- name: "Run the tests"
run: "forge test"

- name: "Add test summary"
run: |
pnpm run posttest
- name: Archive e2e artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v2
if: always()
with:
name: e2e-artifacts
path: |
/home/runner/work/tapio-eth/tapio-eth/output.html
/home/runner/work/tapio-eth/tapio-eth/cypress/mochawesome-report
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/videos
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/screenshots
continue-on-error: true
- name: Send Slack notification
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
echo "## Tests result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
52 changes: 52 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy mdBook to Pages

on:
push:
branches: ["develop"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up environment
uses: ./.github/setup

- name: Generate Documentation
run: forge doc

- name: Install mdBook
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y
rustup update
cargo install mdbook

- name: Build with mdBook
run: mdbook build docs/

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/book

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
20 changes: 0 additions & 20 deletions .github/workflows/test.yml

This file was deleted.

22 changes: 13 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

# Hardhat files
# directories
cache
artifacts
coverage
node_modules
out
broadcast/**/dry-run/

# files
*.env
*.log
.DS_Store
.pnp.*
lcov.info
package-lock.json
pnpm-lock.yaml
Loading
Loading