diff --git a/packages/contracts-bedrock/src/dispute/ZkFaultDisputeGame.sol b/packages/contracts-bedrock/src/dispute/ZkFaultDisputeGame.sol index 72664e922..c769885a8 100644 --- a/packages/contracts-bedrock/src/dispute/ZkFaultDisputeGame.sol +++ b/packages/contracts-bedrock/src/dispute/ZkFaultDisputeGame.sol @@ -289,12 +289,7 @@ contract ZkFaultDisputeGame is IZkFaultDisputeGame, Clone, ISemver { challengedClaimsTimestamp[_disputeClaimIndex] = uint64(block.timestamp); challengers[_disputeClaimIndex] = payable(msg.sender); challengedClaimIndexes.push(_disputeClaimIndex); - // todo event - // get challengedClaimIndexes length - /// @notice Returns the length of the `claimData` array. -// function claimDataLen() external view returns (uint256 len_) { -// len_ = claimData.length; -// } + emit ChallengeBySignalCreated(_disputeClaimIndex); } function submitProofForSignal(uint256 _disputeClaimIndex, Claim[] calldata _originalClaims, bytes calldata _proof) external override { @@ -345,7 +340,7 @@ contract ZkFaultDisputeGame is IZkFaultDisputeGame, Clone, ISemver { validityProofProvers[_disputeClaimIndex] = payable(msg.sender); invalidChallengeClaims[_disputeClaimIndex] = true; invalidChallengeClaimIndexes.push(_disputeClaimIndex); - // todo event + emit SubmitProofForSignalCreated(_disputeClaimIndex); } function resolveClaim() external override { @@ -609,6 +604,11 @@ contract ZkFaultDisputeGame is IZkFaultDisputeGame, Clone, ISemver { } } + /// @notice Returns the length of the `challengedClaimIndexes` array. + function challengedClaimIndexesLen() external view returns (uint256 len_) { + len_ = challengedClaimIndexes.length; + } + /// @notice Returns the parent game status /// if the parent game is 0x00...00, then the parent game is from anchor state registry /// and its status is always DEFENDER_WINS diff --git a/packages/contracts-bedrock/src/dispute/interfaces/IZkFaultDisputeGame.sol b/packages/contracts-bedrock/src/dispute/interfaces/IZkFaultDisputeGame.sol index c39b3c520..d9cbf381b 100644 --- a/packages/contracts-bedrock/src/dispute/interfaces/IZkFaultDisputeGame.sol +++ b/packages/contracts-bedrock/src/dispute/interfaces/IZkFaultDisputeGame.sol @@ -9,6 +9,14 @@ import "src/dispute/lib/Types.sol"; /// @notice The interface for a zk fault proof backed dispute game. interface IZkFaultDisputeGame is IDisputeGame { + /// @notice Emitted when a new ChallengeBySignal is created + /// @param _disputeClaimIndex The index of the dispute claim + event ChallengeBySignalCreated(uint256 indexed _disputeClaimIndex); + + // @notice Emitted when a new SubmitProofForSignal is created + /// @param _disputeClaimIndex The index of the dispute claim + event SubmitProofForSignalCreated(uint256 indexed _disputeClaimIndex); + /// @notice Parameters to initialize the contract. struct InitParams { uint256 chainId;