ink icon indicating copy to clipboard operation
ink copied to clipboard

Event defintions with generics

Open ascjones opened this issue 2 years ago • 0 comments

Follow up from https://github.com/paritytech/ink/pull/1827#issuecomment-1625583771.

Currently the Event derive does not support generics. We should consider adding support for generic event definitions, that would allow the event definition to be used across contracts with different Environment types e.g.

#[ink::event]
pub struct Transfer<E: ink::env::Environment> {
    #[ink(topic)]
    from: Option<E::AccountId>,
    #[ink(topic)]
    to: Option<E::AccountId>,
    value: E::Balance,
}

ascjones avatar Jan 05 '24 12:01 ascjones