Trait ink_lang::reflect::ContractName
source · [−]Expand description
Stores the name of the ink! smart contract.
Note
The name is the identifier of the #[ink(storage)]
annotated struct
.
Usage
use ink_lang as ink;
#[ink::contract]
pub mod contract {
#[ink(storage)]
pub struct Contract {}
impl Contract {
#[ink(constructor)]
pub fn constructor() -> Self { Self {} }
#[ink(message)]
pub fn message(&self) {}
}
}
use contract::Contract;
assert_eq!(
<Contract as ContractName>::NAME,
"Contract",
);