Closed
Description
I find trait cannot be generic
if !item_trait.generics.params.is_empty() {
return Err(format_err_spanned!(
item_trait.generics.params,
"ink! trait definitions must not be generic"
))
}
But I want to define environment-independent traits, such as:
#[ink::trait_definition]
pub trait Ownable<E: Environment> {
/// Initializes the contract setting the deployer as the initial owner.
#[ink(constructor)]
fn new() -> Self;
/// Returns the account id of the current owner.
#[ink(message)]
fn owner(&self) -> Option<E::AccountId>;
/// Transfer ownership to new owner.
#[ink(message)]
fn transfer_ownership(&mut self, new_owner: Option<E::AccountId>);
}