Skip to content

solver occasionally reverts with transfer amount exceeds allowance #176

@CluEleSsUK

Description

@CluEleSsUK

When making a mainnet USDT swap between AVAX and Base, my transaction got stuck and I saw the following in the solver logs:

{"timestamp":"2025-10-20T04:12:55.355638Z","level":"ERROR","fields":{"message":"error trading","amount":"9860649","src_chain_id":"43114","dest_chain_id":"8453","request_id":"0x813812856abd6307cf7575ed8b9e31333e1d6d508feb19bae9efaa6ce528d922","error":"server returned an error response: error code 3: execution reverted: ERC20: transfer amount exceeds allowance, data: \"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002845524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365000000000000000000000000000000000000000000000000\""},"target":"onlyswaps_solver::executor"}

Restarting the solver caused a nonce too low error which then resolved itself after a few blocks.

I think this is because the solver watches without waiting for confirmations:

let receipt = tx.watch().await?;

Quoting the comment for watch:

    /// Waits for the transaction to confirm with the given number of confirmations.
    ///
    /// See:
    /// - [`register`](Self::register): for registering the transaction without waiting for it to be
    ///   confirmed.
    /// - [`get_receipt`](Self::get_receipt) for fetching the receipt after the transaction has been
    ///   confirmed.
    pub async fn watch(self) -> Result<TxHash, PendingTransactionError> {
        self.register().await?.await
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions