2.10. Events#
Syntax#
Event Definitions#
Events are convenient interfaces with the EVM logging facilities. They have to be defined inside a contract:
contract MyContract {
// Defining an event
event BidPlacedEvent(address bidder, uint amount);
function bid() public payable {
// Triggering an event
emit BidPlacedEvent(msg.sender, msg.value);
}
}
Note
This section is under construction. You are more than welcome to contribute suggestions to our GitHub repository.