From 5658cf56abc142a4e7dc45c2a66b49726d0911ec Mon Sep 17 00:00:00 2001 From: Kelvin Fichter <kelvinfichter@gmail.com> Date: Wed, 13 Jan 2021 12:14:48 -0500 Subject: [PATCH] Added events to the fraud verifier (#188) --- .../OVM/verification/OVM_FraudVerifier.sol | 14 ++++++++++++++ .../iOVM/verification/iOVM_FraudVerifier.sol | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol b/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol index 823e3212e..566d1b296 100644 --- a/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol +++ b/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol @@ -125,6 +125,13 @@ contract OVM_FraudVerifier is Lib_AddressResolver, OVM_FraudContributor, iOVM_Fr ); _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index); + + emit FraudProofInitialized( + _preStateRoot, + _preStateRootProof.index, + _txHash, + msg.sender + ); } /** @@ -192,6 +199,13 @@ contract OVM_FraudVerifier is Lib_AddressResolver, OVM_FraudContributor, iOVM_Fr // TEMPORARY: Remove the transitioner; for minnet. transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000); + + emit FraudProofFinalized( + _preStateRoot, + _preStateRootProof.index, + _txHash, + msg.sender + ); } diff --git a/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol b/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol index c560720c5..171a9e49b 100644 --- a/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol +++ b/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol @@ -13,6 +13,25 @@ import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol"; */ interface iOVM_FraudVerifier { + /********** + * Events * + **********/ + + event FraudProofInitialized( + bytes32 _preStateRoot, + uint256 _preStateRootIndex, + bytes32 _transactionHash, + address _who + ); + + event FraudProofFinalized( + bytes32 _preStateRoot, + uint256 _preStateRootIndex, + bytes32 _transactionHash, + address _who + ); + + /*************************************** * Public Functions: Transition Status * ***************************************/