Class EvmHook

java.lang.Object
com.hedera.hashgraph.sdk.EvmHookSpec
com.hedera.hashgraph.sdk.EvmHook

public class EvmHook extends EvmHookSpec
Definition of an EVM hook.

This class represents a hook implementation that is programmed in EVM bytecode and can access state or interact with external contracts. It includes the hook specification and any initial storage updates.

  • Constructor Details

    • EvmHook

      public EvmHook(ContractId contractId)
      Create a new EvmHook with no initial storage updates.
      Parameters:
      contractId - underlying contract of the hook
    • EvmHook

      public EvmHook(ContractId contractId, List<EvmHookStorageUpdate> storageUpdates)
      Create a new EvmHook with initial storage updates.
      Parameters:
      contractId - underlying contract of the hook
      storageUpdates - the initial storage updates for the EVM hook
  • Method Details

    • getStorageUpdates

      public List<EvmHookStorageUpdate> getStorageUpdates()
      Get the initial storage updates for this EVM hook.
      Returns:
      an immutable list of storage updates
    • toProtobuf

      EvmHook toProtobuf()
      Convert this EvmHook to a protobuf message.
      Returns:
      the protobuf EvmHook
    • fromProtobuf

      public static EvmHook fromProtobuf(EvmHook proto)
      Create an EvmHook from a protobuf message.
      Parameters:
      proto - the protobuf EvmHook
      Returns:
      a new EvmHook instance
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class EvmHookSpec
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class EvmHookSpec
    • toString

      public String toString()
      Overrides:
      toString in class EvmHookSpec