1pub mod calls;
6pub mod deploy;
7pub mod host;
8pub mod storage;
9
10use alloy_sol_types::{abi::token::WordToken, SolEvent, TopicList};
11pub use host::*;
12pub use storage::TopLevelStorage;
13
14pub fn log<T: SolEvent>(vm: &dyn Host, event: T) {
16 let mut topics = [WordToken::default(); 4];
18 event.encode_topics_raw(&mut topics).unwrap();
19
20 let count = T::TopicList::COUNT;
21 let mut bytes = Vec::with_capacity(32 * count);
22 for topic in &topics[..count] {
23 bytes.extend_from_slice(topic.as_slice());
24 }
25 event.encode_data_to(&mut bytes);
26 vm.emit_log(&bytes, count);
27}