Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Moonwell redeem fails on Base Sepolia and uses 18 decimals for cbBTC

Aperta Adatta ai principianti
#1,578 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sebxt ci sta già lavorando.

Dal 20/10/2026.

  • #1579 di @sebxt — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Inizia da typescript/agentkit/src/action-providers/moonwell/moonwellActionProvider.ts e ricostruisci come redeem seleziona la mappa degli indirizzi specifica della rete e determina i decimali del token sottostante. Poi leggi typescript/agentkit/src/action-providers/moonwell/constants.ts per le voci dei decimali di cbBTC e USDBC. Aggiorna le mappe in modo che redeem funzioni su entrambe le reti e che cbBTC usi 8 decimali per mint e redeem; verifica che gli importi di riproduzione vengano codificati correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

  1. On Base Sepolia, MoonwellActionProvider.redeem always returns Error: Unsupported token address <mToken>. The redeem path picks the right address map for the network when validating the mToken, but then looks up the underlying decimals with the mainnet map:

    const decimals = MTOKENS_UNDERLYING_DECIMALS[MOONWELL_BASE_ADDRESSES[args.mTokenAddress]];
    

    Sepolia mToken addresses are not in MOONWELL_BASE_ADDRESSES, so decimals is undefined. MOONWELL_USDBC is also missing from MTOKENS_UNDERLYING_DECIMALS.

  2. MTOKENS_UNDERLYING_DECIMALS.MOONWELL_cbBTC is 18, but cbBTC (0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf) has 8 decimals. Redeeming 0.5 cbBTC encodes redeemUnderlying(500000000000000000), which is 5,000,000,000 cbBTC, instead of redeemUnderlying(50000000). The transaction reverts.

  3. TOKEN_DECIMALS has no entry for cbBTC, so mint into the Moonwell cbBTC market returns Error: Unsupported token address 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf.

What should happen

Redeem works on both supported networks and uses the underlying token's real decimals. cbBTC can be supplied and redeemed with 8 decimals.

Minimal repro

// wallet on base-sepolia
await moonwell.redeem(wallet, {
  mTokenAddress: "0x876852425331a113d8E432eFFB3aC5BEf38f033a", // Sepolia mUSDBC
  assets: "1.5",
});
// => "Error: Unsupported token address 0x876852425331a113d8E432eFFB3aC5BEf38f033a. ..."

// wallet on base-mainnet
await moonwell.redeem(wallet, {
  mTokenAddress: "0xF877ACaFA28c19b96727966690b2f44d35aD5976", // Moonwell cbBTC
  assets: "0.5",
});
// sends redeemUnderlying(500000000000000000) instead of redeemUnderlying(50000000)

Onchain check of the underlying tokens (underlying() then decimals()):

Base Sepolia 0x876852425331a113d8E432eFFB3aC5BEf38f033a -> USDBC 6
Base         0xF877ACaFA28c19b96727966690b2f44d35aD5976 -> cbBTC 8

Root cause

typescript/agentkit/src/action-providers/moonwell/moonwellActionProvider.ts uses MOONWELL_BASE_ADDRESSES instead of the network specific networkObject when resolving decimals in redeem, and typescript/agentkit/src/action-providers/moonwell/constants.ts has the wrong decimals for cbBTC, no entry for MOONWELL_USDBC, and no cbBTC entry in TOKEN_DECIMALS.

Lingua principale
TypeScript
Stelle
1.3k
Fork
871
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coinbase/agentkit

Tutte le issue di coinbase/agentkit

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.