FlashBank

io.github.Rotwang9000由 GitHub 帳號 Rotwang9000 發布v1.1.1更新於 Oct 24, 2026

Fixed-fee P2P term loans (no oracles) and flash loans on Ethereum, Base, Arbitrum and Sepolia.

已驗證STDIO僅桌面金融開發者工具

概覽

AI 產生的概覽

讓助理瀏覽、報價,並可選擇在以太坊、Base、Arbitrum 與 Sepolia 上參與 FlashBank 的鏈上 P2P 定期貸款與閃電貸。

可以做什麼
此伺服器把 FlashBank 的鏈上借貸合約暴露給 MCP 用戶端。唯讀工具讓助理無需設定即可瀏覽未成交的 P2P 報價、取得報價、查看閃電貸流動性與費用。設定一次性私鑰後,寫入工具可以張貼、接受或償還 P2P 貸款,並使用 Sepolia 水龍頭;接受報價會在鏈上鎖定已審閱的確切條款,在 v2 鏈上工具會報出隨時間歸屬的費用並回報冷靜期回饋。
適用情境
當助理需要檢視或操作 FlashBank 的 P2P 貸款市場或閃電貸流動性時使用,例如比較未成交報價、取得條款報價,或在測試網上走完一次貸款生命週期。唯讀使用無需任何設定;寫入使用適合確實想讓代理在鏈上交易的用戶。
執行需求
透過 npx @flashbank/mcp 以 stdio 在本機執行;未宣告身分驗證。唯讀無需設定。寫入需要 FLASHBANK_MCP_PRIVATE_KEY(一次性 EVM 私鑰),主網寫入還需 FLASHBANK_MCP_ALLOW_MAINNET=true;可選按鏈覆寫 RPC,例如 FLASHBANK_MCP_RPC_SEPOLIA。需要存取相應鏈的網路。
安裝前請注意
當 FLASHBANK_MCP_ALLOW_MAINNET 為 true 時,寫入工具會在主網上轉移真實資產;README 建議使用一次性私鑰,並聲明此軟體為實驗性、未經審計且沒有外部審計。主網寫入受 FLASHBANK_MCP_PRIVATE_KEY 與 FLASHBANK_MCP_ALLOW_MAINNET 雙重限制。可能產生可選費用(介面費、推廣費、服務費),且推廣費不予退還。切勿使用持有你無法承受損失資金的私鑰。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 FlashBank,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

FlashBank

Non-custodial, on-chain lending where your funds stay in your wallet until the moment they're used. FlashBank is two complementary products that share that principle:

ProductWhat it isContractPage
Flash LoansAtomic, same-transaction liquidity for arbitrage, liquidations and MEV. Lenders approve and commit WETH from their own wallet — no deposits — and earn a fee on every loan.flashloans/ · FlashBankRouter.sol/
P2P Term LoansFixed-term, collateral-backed loans agreed directly between two people. One flat fee instead of interest, settled purely on time — no pools, no price oracle, no liquidations to watch.loans/ · FlashBankP2PLoan.sol/p2p

Branding rule: "flashbank" is only ever used as a verb (you flashbank a loan). FlashBank is not a bank, does not hold deposits and takes no custody as a financial institution.

Website: flashbank.net · Source: github.com/Rotwang9000/flashbank-net


Flash Loans (the Router)

FlashBankRouter is a multi-provider flash-loan pool where liquidity providers keep custody:

  • No deposits. Providers approve the router and call setCommitment(token, limit, expiry, paused). WETH stays in their wallet and is only pulled for the microseconds of a flash loan.
  • Atomic or nothing. The borrower implements IL2FlashLoan and must repay principal + fee in the same transaction, or the whole thing reverts.
  • Configurable, bounded fees. Per-token feeBps (1–100 bps) with a separate owner cut (ownerFeeBps) and a per-tx max-borrow share of the pool (maxBorrowBps).
  • Dual-control admin. Sensitive changes (token config, ownership, profit withdrawal) use a propose-then-execute flow split between the owner and a separate admin. See docs/security/DUAL_CONTROL.md.

Provider flow (WETH):

js
await weth.deposit({ value: ethers.parseEther("5") });        // wrap ETH (stays in your wallet)await weth.approve(routerAddress, ethers.MaxUint256);         // approve onceawait router.setCommitment(wethAddress, ethers.parseEther("3"), 0, false); // lend up to 3 WETH// pause/resume any time — just flip the paused flag or drop the limit to 0

Borrower flow (MEV / arbitrage bots):

js
await router.flashLoan(  wethAddress,  ethers.parseEther("100"),  true,            // receive native ETH (router unwraps WETH for you)  strategyCalldata // forwarded to IL2FlashLoan.executeFlashLoan);

Lives in flashloans/. Deploy with cd flashloans && npx hardhat run scripts/deploy-router.js --network <network> (set ADMIN_ADDRESS / TESTNET_ADMIN_ADDRESS in the repository-root .env). Per-network addresses are read from NEXT_PUBLIC_* env vars by the website.


P2P Term Loans

FlashBankP2PLoan is a neutral escrow that lets two parties flashbank a fixed-term, collateral-backed loan:

  • Time-only settlement. Repay principal + a flat fee before maturity + grace, or the lender claims the collateral. Nothing is priced on-chain, so no oracle is needed.
  • Optional surplus return (no oracle). An offer can set an agreed rate (stored as settlementValue — how much principal the whole collateral is taken to be worth, frozen at origination); on default the borrower then recovers any collateral beyond principal + fee. Leave it 0 for a pure pledge/forfeit. This honours Lorrow's surplus-return guardrail without an oracle — see docs/design/LORROW_COMPATIBILITY.md.
  • Editable offers, front-running-safe. While an offer is open the creator can re-price or amend its non-escrow terms in place (updateOffer) and top up featured placement (boostOffer) without forfeiting the existing boost. Each edit bumps a version; a taker can call takeChecked(id, version) to pin the exact terms they reviewed.
  • Flat fee, not interest. A single fixed fee rather than time-accruing interest — more compatible with faith-based finance that avoids riba (this is not a Sharia-certification claim).
  • Three optional, default-off fees:
    • an opt-in interface fee (lender-paid, only on offers posted through flashbank; 0% introductory),
    • an optional boost that buys featured marketplace placement ranked by spend (an advert, not interest — non-refundable),
    • a per-offer service fee to any address (insurance / third party). Go direct on the contract and it is zero commission.
  • Tokens are just ERC-20s. On mainnet/L2 the escrow uses real assets (WETH, USDC, …). On the testnet playground, fpETH/fpUSD are free faucet tokens with no value.

Lives in loans/. Full design: docs/design/P2P_LENDING_DESIGN.md.

Live on mainnet (Ethereum + Base)

FlashBankP2PLoan is deployed and verified on mainnet — judged solid by the self-audit and shipped while ETH gas was cheap. Same bytecode on each chain; Ownable, fee recipient = Vultisig vault, 0 bps introductory (a listing fee only ever applies to offers that opt in via listed, hard-capped on-chain at 1%). No external audit — use real assets at your own risk.

ChainFlashBankP2PLoan (verified)
Ethereum0x131C…18A0
Base0x86Fb…FcbB

The mainnet UI uses real WETH/USDC. (Arbitrum pending — deployer balance too thin to deploy yet; add later with MAX_FEE_GWEI pinned low.) Per-chain records in loans/deployments/*-p2p.json.

Mainnet interface is restricted to ETH and USDC for now — custom-token entry is testnet-only — so the front end never invites an unknown/fake token (the contract itself stays permissionless for anyone calling it directly).

v2 — live on the Sepolia playground. FlashBankP2PLoanV2 adds on-chain token sanity-validation, a graduated cooling-off rebate (the flat fee vests from a 10% floor so a near-instant return is cheap — killing fake-token fee-farming — while consuming a listing is never free, and a same-block guard stops free flash loans), and pull-payout fallbacks so a blocklisted recipient can never brick the other party's repayment or default claim. Adversarially reviewed, unit-tested (22 cases) and deployed to Sepolia (verified, seeded) where it has passed a live two-agent lifecycle drill; mainnets stay on v1 until it graduates. Full pitfall analysis in docs/design/P2P_V2_COOLING_OFF.md.

Live on Sepolia (playground — testnet only, no real value)

A self-serve playground is deployed on Sepolia so anyone can try the whole flow end-to-end — it runs the v2 escrow, so the cooling-off rebate and pull-payouts are live there first. All source is verified on Etherscan; only key material stays in the untracked .env. Unaudited demo — never send real assets.

ContractAddress (verified)
FlashBankP2PLoanV2 (cooling-off rebate + token checks + pull-payouts)0x536f…1E76
PlaygroundToken fpUSD (6d)0x4aBb…760c
PlaygroundToken fpETH (18d)0xB9CC…96F5

Try it: open /p2p (defaults to Ethereum mainnet), switch to Sepolia, hit the faucet to mint test tokens, then post or take an offer (a few offers are pre-seeded, including boosted ones to show ranking and one with a creator-set 2-day cooling window). Redeploy with cd loans && npx hardhat run scripts/deploy-playground-v2.js --network sepolia (addresses recorded in loans/deployments/sepolia-playground-v2.json; the retired v1 playground 0x3Ce4…1017 stays on-chain).


For AI agents (MCP)

[npm] [MCP Registry] [Listed on Glama]

bash
npx -y @flashbank/mcp     # zero-config read-only MCP server, any MCP client

The repo ships a self-contained Model Context Protocol server (mcp/, published as @flashbank/mcp, listed in the official MCP Registry and on Glama) so agents can flashbank too: browse open P2P offers, get quotes, check flash-loan liquidity and fees — and, with an explicitly configured throwaway key, post/take/repay loans and use the Sepolia faucet. Reads need no configuration; mainnet writes are double-gated behind FLASHBANK_MCP_PRIVATE_KEY and FLASHBANK_MCP_ALLOW_MAINNET=true. Takes always pin the exact reviewed terms on-chain, and on v2 chains the tools quote vested fees and report cooling-off rebates. The whole lifecycle is proven by a live two-agent drill (npm run drill) that walks faucet → create → take → early repay (rebate verified) → cancel through two real MCP server instances on Sepolia. Details and the tool catalogue: mcp/README.md.


Repository layout

Each feature is a self-contained Hardhat project. The two never import each other's Solidity, so you can fork this repo, delete the feature you don't want, and the other still compiles, tests and deploys.

flashloans/           Flash-loan router feature — own contracts/, test/, scripts/, test-scripts/, hardhat.config.jsloans/                P2P term-loan feature — own contracts/, test/, scripts/, deployments/, hardhat.config.jscommon/               Shared toolchain (hardhat.base.js) inherited by both features — do not deletewebsite/              Next.js front end (static export, deployed to flashbank.net) — showcases both featuresmcp/                  Model Context Protocol server so AI agents can browse/quote/transact (see mcp/README.md)docs/                 Documentation (see docs/README.md) — architecture, security, deployment, designpackage.json          Thin root: installs the shared dependencies and runs both features' scripts

Want only one feature? Delete the other top-level directory:

bash
rm -rf flashloans   # keep just the P2P term loans# ...or...rm -rf loans        # keep just the flash-loan router

common/ is shared by both and must stay. The website/ is a combined shopfront; if you drop a feature, also remove its page (website/src/pages/index.tsx for flash loans, website/src/pages/p2p.tsx for P2P) and its link in website/src/components/Nav.tsx.

A previous deposit-based design, FlashBankRevolutionary, predates the no-deposit Router. Its contracts and notes live under flashloans/ for historical context; the Router and P2P escrow are the current products.


Quick start

bash
npm install            # installs the shared toolchain both features build againstnpm run compile        # compile both featuresnpm test               # run both features' test suites
# work inside a single featurecd flashloans && npx hardhat testcd loans && npx hardhat test
# websitenpm run website:dev    # local dev server on http://localhost:3000npm run website:build  # static export

Dependencies are installed once at the repository root; each feature resolves Hardhat, the plugins and OpenZeppelin from there, so there is no per-feature npm install.

Tests

The Solidity suites cover the router (flash-loan flow, owner-fee accrual, dual control, validation) and the P2P escrow (lifecycle, time-based default, the three-tier fee model and boost, reentrancy, plus a randomised fund-conservation fuzz test).

bash
npm test                            # both featuresnpm run test:flashloans             # router suite onlynpm run test:loans                  # P2P suite only

Documentation

Browse docs/ for the full set:

Vulnerability disclosure: SECURITY.md · Contributing: CONTRIBUTING.md · Changes: CHANGELOG.md


Disclaimers

Experimental, unaudited DeFi software. Smart contracts can have bugs; collateral values can move during a loan term; flash-loan profitability depends on market opportunities. Use at your own risk and do your own research.

License

MIT.

來源:README.md,提交 4197a8d

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分