Futures
Access hundreds of perpetual contracts
TradFi
Gold
One platform for global traditional assets
Options
Hot
Trade European-style vanilla options
Unified Account
Maximize your capital efficiency
Demo Trading
Introduction to Futures Trading
Learn the basics of futures trading
Futures Events
Join events to earn rewards
Demo Trading
Use virtual funds to practice risk-free trading
Launch
CandyDrop
Collect candies to earn airdrops
Launchpool
Quick staking, earn potential new tokens
HODLer Airdrop
Hold GT and get massive airdrops for free
Pre-IPOs
Unlock full access to global stock IPOs
Alpha Points
Trade on-chain assets and earn airdrops
Futures Points
Earn futures points and claim airdrop rewards
Ever wondered how smart contracts actually talk to the outside world? On BSC and other EVM chains, the answer is Events. Think of them as your contract's megaphone—broadcasting important activities back to the blockchain.
Let's break down how they work. Take the ERC-20 standard Transfer event: when tokens move from one address to another, the contract emits this event with three key pieces of info—the sender, recipient, and amount. Notice those "indexed" keywords? They're crucial. Indexed parameters get stored in a special log structure that makes them searchable and filterable, which is exactly what external applications need to listen for these transactions.
Following best practices means carefully choosing which parameters to index (typically addresses and important identifiers) while keeping non-indexed data for values that don't need querying. This balance keeps your contracts efficient while maintaining full transparency. Events are free to emit but cost gas to store on-chain, so they're the perfect bridge between what happens inside your smart contract and what the world outside needs to know.
The indexed parameter is indeed easy to trip over; choosing the wrong one can make a bunch of queries painfully slow.
The indexed parameter is indeed key; otherwise, how would you filter transactions?
But the gas issue is still a bit annoying; storing on-chain definitely costs money.
Thinking about these things every day is enough to blow your mind, brother.
Choosing the right indexed parameters can boost efficiency directly; choosing poorly is just a waste of gas—it's tough.
Free emit, but storing on-chain costs money—that's life, brother.
The indexed parameter section is indeed clever; it saves gas and can be listened to, quite a little trick.