cargo-contract icon indicating copy to clipboard operation
cargo-contract copied to clipboard

fix: decode event values

Open AlexD10S opened this issue 3 months ago • 0 comments

Describe the bug For a contract event, cargo contract is not properly decoding the value

To Reproduce Steps to reproduce the behavior: Use a contract with events, or I just have added a simple event in Flipper contract:

#[ink(event)]
    pub struct Test {
        value: bool,
    }

And emit it once calling the flip message:

#[ink(message)]
        pub fn flip(&mut self) {
            self.value = !self.value;
            Self::env().emit_event(Test {
                value: self.value,
            });
        }

The output from cargo-contract is:

Event Revive ➜ ContractEmitted
         contract: 0x5801b439a678d9d3a68b8019da6a4abfa507de11
         data: 0x040004882e8db2d778ca9655ea3223def2503a484e55d21aaec3485fef87b8fbadbf29
         topics: 0x040004882e8db2d778ca9655ea3223def2503a484e55d21aaec3485fef87b8fbadbf29

AlexD10S avatar Oct 15 '25 14:10 AlexD10S