Skip to content

Commit 135a5b3

Browse files
authored
added explanatory documentation for the topics function in the function builder (#731)
1 parent 82201a6 commit 135a5b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/types/log.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ impl FilterBuilder {
137137
}
138138

139139
/// Topics
140+
/// An event topic is a part of the event logging mechanism used by smart contracts
141+
/// to record information on the blockchain.
142+
/// These logs are stored in transaction receipts and can be efficiently filtered and searched.
143+
/// Each log entry has -up to- four "topics," which are 32-byte values used to index the log.
144+
/// Topic 0: The hash of the event signature.
145+
/// Topic 1: The from address (indexed).
146+
/// Topic 2: The to address (indexed).
147+
/// Data: The value (not indexed).
140148
pub fn topics(
141149
mut self,
142150
topic1: Option<Vec<H256>>,

0 commit comments

Comments
 (0)