1#![doc(
16 html_logo_url = "https://use.ink/img/crate-docs/logo.png",
17 html_favicon_url = "https://use.ink/crate-docs/favicon.png"
18)]
19#![cfg_attr(not(feature = "std"), no_std)]
20
21#[macro_use]
22#[doc(hidden)]
23pub mod option_info;
24
25#[macro_use]
26#[doc(hidden)]
27pub mod result_info;
28
29#[cfg_attr(not(feature = "show-codegen-docs"), doc(hidden))]
30pub mod codegen;
31
32pub use ink_env::reflect;
33
34mod contract_ref;
35mod env_access;
36mod message_builder;
37pub mod sol;
38
39pub use ink_env as env;
40#[cfg(feature = "std")]
41pub use ink_metadata as metadata;
42pub use ink_prelude as prelude;
43pub use ink_primitives as primitives;
44pub use ink_primitives::abi;
45pub use scale;
46#[cfg(feature = "std")]
47pub use scale_info;
48#[cfg(feature = "xcm")]
49pub use xcm;
50
51pub extern crate polkavm_derive;
52#[doc(hidden)]
53pub use polkavm_derive::*;
54
55pub mod storage {
56 pub mod traits {
57 pub use ink_macro::{
58 Storable,
59 StorableHint,
60 StorageKey,
61 StorageLayout,
62 };
63 pub use ink_storage::traits::*;
64 }
65 pub use ink_storage::{
66 Lazy,
67 Mapping,
68 StorageVec,
69 };
70}
71
72pub use self::{
73 contract_ref::ToAddr,
74 env_access::EnvAccess,
75 prelude::IIP2_WILDCARD_COMPLEMENT_SELECTOR,
76};
77pub use ink_macro::{
78 Event,
79 EventMetadata,
80 SolDecode,
81 SolEncode,
82 SolErrorDecode,
83 SolErrorEncode,
84 SolErrorMetadata,
85 blake2x256,
86 contract,
87 contract_ref,
88 error,
89 event,
90 scale_derive,
91 selector_bytes,
92 selector_id,
93 storage_item,
94 test,
95 trait_definition,
96};
97pub use ink_primitives::{
98 Address,
99 ConstructorResult,
100 H160,
101 H256,
102 LangError,
103 MessageResult,
104 SolDecode,
105 SolEncode,
106 U256,
107};
108
109#[cfg(feature = "std")]
110#[doc(hidden)]
111pub use linkme;
112
113#[cfg(feature = "std")]
114use ink_metadata::EventSpec;
115
116#[cfg(feature = "std")]
119#[linkme::distributed_slice]
120#[linkme(crate = linkme)]
121pub static CONTRACT_EVENTS: [fn() -> EventSpec] = [..];
122
123#[cfg(feature = "std")]
126pub fn collect_events() -> Vec<EventSpec> {
127 CONTRACT_EVENTS.iter().map(|event| event()).collect()
128}
129
130#[cfg(all(feature = "std", any(ink_abi = "sol", ink_abi = "all")))]
134#[linkme::distributed_slice]
135#[linkme(crate = linkme)]
136pub static CONTRACT_EVENTS_SOL: [fn() -> ink_metadata::sol::EventMetadata] = [..];
137
138#[cfg(all(feature = "std", any(ink_abi = "sol", ink_abi = "all")))]
141pub fn collect_events_sol() -> Vec<ink_metadata::sol::EventMetadata> {
142 crate::CONTRACT_EVENTS_SOL
143 .iter()
144 .map(|event| event())
145 .collect()
146}
147
148#[cfg(feature = "std")]
151#[linkme::distributed_slice]
152#[linkme(crate = linkme)]
153pub static CONTRACT_ERRORS_SOL: [fn() -> Vec<ink_metadata::sol::ErrorMetadata>] = [..];
154
155#[cfg(feature = "std")]
158pub fn collect_errors_sol() -> Vec<ink_metadata::sol::ErrorMetadata> {
159 crate::CONTRACT_ERRORS_SOL
160 .iter()
161 .flat_map(|event| event())
162 .collect()
163}