Skip to content

Instantly share code, notes, and snippets.

@mattkanwisher
Created May 25, 2018 08:47
Show Gist options
  • Save mattkanwisher/f63801a8028783d54114685d2ca89b4c to your computer and use it in GitHub Desktop.
Save mattkanwisher/f63801a8028783d54114685d2ca89b4c to your computer and use it in GitHub Desktop.
Emitting events in Solidity to be Indexed
pragma solidity ^0.4.0;
contract AccountReceipt {
event AccountCreated(
address indexed _from,
bytes32 indexed _id,
uint _value
);
function AccountReceipt(bytes32 _id) public payable {
emit AccountCreated(msg.sender, _id, msg.value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment