Skip to content

Instantly share code, notes, and snippets.

@iandjx
Created July 19, 2023 05:39
Show Gist options
  • Save iandjx/8319e0dc4645427749779749a93f8792 to your computer and use it in GitHub Desktop.
Save iandjx/8319e0dc4645427749779749a93f8792 to your computer and use it in GitHub Desktop.
import { Greeting } from "../generated/schema";
import { GreetingChanged } from '../generated/Greeting/Greeting';
export function handleGreetingChanged(event: GreetingChanged): void {
let greeting = new Greeting(event.transaction.hash.toHex() + '-' + event.logIndex.toString());
greeting.newGreeting = event.params.newGreeting;
greeting.changedBy = event.params.changedBy.toHex();
greeting.timestamp = event.block.timestamp;
greeting.save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment