Found by actually using the live site and testing against the real deployed demo contract, not just reading code: - QieForgeVault.deposit() minted a first lender's shares against their own amount alone, ignoring any totalAssets() already in the vault before totalLenderShares existed -- exactly the state DeployDemo.s.sol's own seeding pattern creates. Reproduced live: a 1,000 TUSD first deposit into the pre-funded demo vault minted shares worth 501,000 TUSD (100% of totalAssets, including 500,000 pre-funded liquidity + 20,000 outstanding debt) -- the textbook ERC4626 donation/inflation attack, no mitigation unlike QieForgePair's MINIMUM_LIQUIDITY burn. Fixed with an equivalent MINIMUM_LENDER_SHARES floor locked on first deposit into a non-pristine vault; forge test 41/41 -> 43/43 with two new regression tests; re-verified live against a freshly redeployed demo stack (same documented 500,000/ 20,000/2.8x numbers) that the same attack now round-trips exactly. - SwapCard/VaultCard's own "Connect Wallet" buttons hardcoded chainId 1983 (QIE Testnet) regardless of the actually configured network, so a real wallet user on the live demo (chain 31337) would connect to the wrong chain. Fixed to derive chainId from getNetworkConfig(), same pattern the header's WalletConnectButton already used correctly. - The live demo oracle's mock price feed staleness window (1 hour) had elapsed since deploy, so borrow()/healthFactor() were reverting for everyone including the documented demo position. Fixed live via setMaxStaleness() and in DeployDemo.s.sol for future redeploys. Shipped the actual missing feature that prompted this pass: /vault only ever exposed depositCollateral() in the UI, never borrow/repay/withdraw- collateral or the lender deposit()/withdraw() that have existed in the contract and SDKs since f55e3c6. Added those to VaultCard plus a new LendCard (supply/withdraw liquidity, live pool stats), a shared erc20Actions.ts approve-then-send helper, and verified every new handler's exact encoding against the live redeployed contract with cast send/call. Also fixed infra: the self-hosted demo RPC's Caddy site had silently dropped out of sites-enabled a second time (not in the box's managed caddy/sites/ dir or CADDY_SITES) -- added it for real this time in the infra-box repo instead of hand-copying into /etc/caddy/ again.
43 lines
494 B
Plaintext
43 lines
494 B
Plaintext
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
|
|
# dependencies
|
|
/node_modules
|
|
/.pnp
|
|
.pnp.*
|
|
.yarn/*
|
|
!.yarn/patches
|
|
!.yarn/plugins
|
|
!.yarn/releases
|
|
!.yarn/versions
|
|
|
|
# testing
|
|
/coverage
|
|
|
|
# next.js
|
|
/.next/
|
|
/out/
|
|
|
|
# production
|
|
/build
|
|
|
|
# misc
|
|
.DS_Store
|
|
*.pem
|
|
|
|
# debug
|
|
npm-debug.log*
|
|
yarn-debug.log*
|
|
yarn-error.log*
|
|
.pnpm-debug.log*
|
|
|
|
# env files (can opt-in for committing if needed)
|
|
.env*
|
|
!.env.example
|
|
|
|
# vercel
|
|
.vercel
|
|
|
|
# typescript
|
|
*.tsbuildinfo
|
|
next-env.d.ts
|