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

Zero CELO gas balance is reported as a contract revert: "gas required exceeds allowance (0)"

Aperta
#790 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
cli

Direzione di ricerca

Inizia con il comando celocli multisig:approve e riproduci il fallimento usando un mittente autorizzato senza CELO, quindi esamina come l'errore di stima del gas viene incapsulato prima di raggiungere la CLI. Il lavoro è completato quando la CLI identifica fondi insufficienti per il gas invece di segnalare un revert del contratto, preservando l'errore annidato per il debug quando possibile.

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

Descrizione

bug celocli
Package
  • @celo/celocli 9.0.1
  • viem 2.55.11 (dependency bundled by celocli)
Environment
  • Celo Mainnet via https://forno.celo.org
  • macOS on Apple Silicon
  • Ledger signer (the issue appears to be independent of the signer type)
Command
celocli multisig:approve \
  --for <multisig> \
  --tx <transaction-id> \
  --from <owner-with-zero-CELO-balance> \
  --useLedger \
  --node https://forno.celo.org
Describe the bug

When the sending account has a zero native CELO balance and therefore cannot pay gas, celocli reports the gas-estimation failure as a contract execution revert:

Sending Transaction: multisig: approving transaction ... failed:
Execution reverted with reason: gas required exceeds allowance (0).

ContractFunctionExecutionError: Execution reverted with reason:
gas required exceeds allowance (0).

This is misleading because the contract call itself does not revert. The account simply has no CELO with which to pay transaction fees.

In the observed case:

  • the sender's native CELO balance was exactly 0;
  • all celocli multisig checks passed;
  • confirmations(transactionId, sender) remained false, confirming that nothing was submitted;
  • a read-only trace of the same confirmTransaction call succeeded;
  • the trace estimated approximately 211,260 gas;
  • funding the sender is the required remedy.

The message led us to investigate the multisig transaction and contract logic, even though neither was the source of the failure.

Expected behavior

celocli should identify this as an insufficient gas-funds error and provide an actionable message, for example:

The sender does not have enough CELO to pay transaction fees.
Sender balance: 0 CELO.
Fund the sender or select a supported --gasCurrency with sufficient balance.

It should not describe this condition as an execution revert.

Actual behavior

The underlying RPC text:

gas required exceeds allowance (0)

is wrapped as EstimateGasExecutionError, ExecutionRevertedError, TransactionExecutionError, and finally ContractFunctionExecutionError, resulting in the incorrect user-facing statement that contract execution reverted.

Suggested fix

Before sending or estimating a transaction, celocli could:

  1. retrieve the sender's native balance (or selected gas-currency balance);
  2. compare it with the estimated/upfront fee requirement where possible; and
  3. fail with a dedicated insufficient-gas-funds message.

Alternatively, the transaction error handler could recognize node errors matching gas required exceeds allowance (<amount>) during gas estimation and translate them into an insufficient-funds error rather than an execution revert.

The exact string may originate from the RPC client and the incorrect classification may occur in viem, but celocli should still present an actionable CLI error. Preserving the original nested error for debugging would be useful.

Reproduction outline
  1. Use an account that is authorized to perform a transaction but has 0 CELO.
  2. Run a celocli write command using that account as --from.
  3. Observe Execution reverted with reason: gas required exceeds allowance (0) during gas estimation.
  4. Simulate/trace the contract call independently and observe that it succeeds.
  5. Fund the sender with enough CELO for gas and retry.
Lingua principale
TypeScript
Stelle
43
Fork
36
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 celo-org/developer-tooling

Tutte le issue di celo-org/developer-tooling

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.