Skip to content

unable to decode contract events #5583

Open
@boyswan

Description

@boyswan
  • I'm submitting a ...
  • Bug report
  • Feature request
  • Support request
  • Other
  • What is the current behavior and expected behavior?

Errors are being thrown when trying to decode contract events (either automatically via contractEvents or manually via abi.decode

CONTRACT: Unable to decode contract event: Unable to find event with index 0

The event I'm calling is from the openbrush PSP34 example

#[ink(event)]
pub struct Transfer {
    from: Option<AccountId>,
    to: Option<AccountId>,
    id: Id,
}

Which is called:

fn _emit_transfer_event(&self, from: Option<AccountId>, to: Option<AccountId>, id: Id) {
    self.env().emit_event(Transfer { from, to, id });
}

I have tried both with and without topics. I am however able to decode them using @subsquid/ink-abi instead of polkadot.js abi.

  • Please tell us about your environment:
  • Version: 10.2.2

  • Environment:

    • Node.js
    • Browser
    • Other (limited support for other environments)
  • Language:

    • JavaScript
    • TypeScript (include tsc --version)
    • Other

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugTracks issues causing errors or unintended behavior, critical to fix for reliability.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions