Skip to content

Instantly share code, notes, and snippets.

@ItayPodhajcer
Last active January 16, 2020 08:39
Show Gist options
  • Save ItayPodhajcer/2c624fd23f71a7b35a83629e06eae96c to your computer and use it in GitHub Desktop.
Save ItayPodhajcer/2c624fd23f71a7b35a83629e06eae96c to your computer and use it in GitHub Desktop.
ethereum-event-azure-function-trigger/EthereumEventTriggeredFunction
public static class EthereumEventTriggeredFunction
{
private const string Abi = "";
private const string ContractAddress = "";
private const string EventName = "";
[FunctionName(nameof(EthereumEventTriggeredFunction))]
public static void Run([EthereumEventTrigger(abi: Abi, contractAddress: ContractAddress, eventName: EventName)]EthereumEventData eventData, ILogger logger)
{
string logMessage = $"Event data:\nBlock number: {eventData.BlockNumber}\n{string.Join('\n', eventData.Values.Select(value => $"{value.Key}: {value.Value}"))}";
logger.LogInformation(logMessage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment