Log type with logId 'XXX' doesn't exist in the ABI

I’ve created typegen using pnpm dlx fuels build

When trying to call contract functions and await the result I get errors like:

FuelError: Log type with logId '8719680026594948895' doesn't exist in the ABI.

Any help appreciated.

Toolchain:
latest-x86_64-apple-darwin (default)

forc : 0.62.0

  • forc-client

  • forc-deploy : 0.62.0

  • forc-run : 0.62.0

  • forc-crypto : 0.62.0

  • forc-debug : 0.62.0

  • forc-doc : 0.62.0

  • forc-fmt : 0.62.0

  • forc-lsp : 0.62.0

  • forc-tx : 0.62.0

  • forc-wallet : 0.8.2

fuel-core : 0.31.0

fuel-core-keygen : 0.31.0

The rust tests and all check out perfectly. The issue seems to be solely in the types created by typegen somehow not being like by decoding it.

It’s to note that the logs are custom event types like:

pub struct ContractCreatedEvent {
    pub owner: Identity,
    pub name: String,
    pub symbol: String,
    pub price: u64,
    pub start: u64,
    pub end: u64
}

Ok, got an idea now.
It’s because the contract A is calling contract B and contract B logs an Event.

This event is not on the ABI of contract A, hence the decode error. How best would this be solved?

Hey @xpluscal :wave:

Without an example or a reproduction of the contract call, it’s difficult to pin point the exact issue issue. From what you’ve describe, it sounds like you’re using inter-contract calls and potentially missing an addContracts call.

The following documentation on inter-contract calls has an example of it’s usage.

1 Like

The issue was solved by forcing “addContract” on the TS SDK when calling the contract. That helped the logs resolve.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.