When using cross contract calling on another contract which also emits events the events of the original contract do not work anymore. I get the following error.

error[E0283]: type annotations needed
   --> lib.rs:109:24
109 |             self.env().emit_event(EventName {
    |                        ^^^^^^^^^^ cannot infer type for type parameter `C` declared on the trait `EmitEvent`
note: multiple `impl`s satisfying `ink_lang::EnvAccess<'_, ink_env::DefaultEnvironment>: ink_lang::codegen::EmitEvent<_>` found
   --> lib.rs:5:1
5   | #[ink::contract]
    | ^^^^^^^^^^^^^^^^
    = note: and another `impl` found in the `other_contract` crate: `impl<'a> ink_lang::codegen::EmitEvent<other_contract::OtherContract> for ink_lang::EnvAccess<'a, <other_contract::OtherContract as ink_lang::reflect::ContractEnv>::Env>;`

How can I cross call contracts and emit events in both of them, without them interfering with each other?

1 Answer 1


It is known issue, should be fixed with refactored events.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.