Skip to content

Shared external event definitions #809

Closed
@Robbepop

Description

@Robbepop

Due to ink!'s design it is not possible to share event definitions between multiple contracts since events can only be defined in the ink! module scope directly.
In order to more extensively use the upcoming trait features we want to make it possible for users to define events to be used in multiple contracts.

For this we will need a new attribute macro #[ink::event_definition] or just a derive macro #[derive(ink::Event)] that will setup everything required for ink! events. There will be some initial limitations. E.g. events can only be enum or struct with certain properties.
However, this will allow to define events in some library and use the same event definition in many ink! smart contract or trait definitions.

Metadata

Metadata

Assignees

Labels

A-ink_lang[ink_lang] Work itemB-designDesigning a new component, interface or functionality.B-enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions