Skip to main content
Contract Hash Verification for detecting changes in a contract bytecode

Functionality

  • The contract hash verification detector continuously monitors the Ethereum Virtual Machine (EVM) network for real-time contract upgrade events. It consumes transaction data, specifically looking for an UPGRADED event emitted by smart contracts. Upon detecting an upgrade event, the detector fetches the bytecode of the updated contract, calculates its hash, and compares it with a provided expected hash hash. Any discrepancies trigger a notification, which is sent to Extractor.
  • The type of hash function used to calculate the checksum of the compiled bytecode of the smart contract to be verified. Supported hash functions are Keccak and SHA256. Default value is Keccak.
  • The Kaccak checksum of the compiled bytecode of the smart contract to be verified
  • Perform an initial check to verify the contract bytecode
  • No notification is sent in this case, as the process completed successfully without any discrepancies in the contract bytecode
  • The contract bytecode mismatched the expected checksum, triggering a notification with details about the discrepancy

Configuration

  • Hash Type (hash_type, default: keccak): Hash Type
  • Contract Bytecode Checksum (checksum, default: None): Contract Bytecode Checksum
  • Initial Check (initial_check, default: True): Perform initial bytecode check
  • Severity (severity, default: -1.0): Severity See common configuration.
Supported networks: evm.