diff --git a/packages/evm/contracts/adapters/BlockHashOracleAdapter.sol b/packages/evm/contracts/adapters/BlockHashOracleAdapter.sol index c324de4e..d9bd7c3f 100644 --- a/packages/evm/contracts/adapters/BlockHashOracleAdapter.sol +++ b/packages/evm/contracts/adapters/BlockHashOracleAdapter.sol @@ -2,16 +2,13 @@ pragma solidity ^0.8.17; import { RLPReader } from "solidity-rlp/contracts/RLPReader.sol"; - import { OracleAdapter } from "./OracleAdapter.sol"; +import { IBlockHashOracleAdapter } from "../interfaces/IBlockHashOracleAdapter.sol"; -abstract contract BlockHashOracleAdapter is OracleAdapter { +abstract contract BlockHashOracleAdapter is IBlockHashOracleAdapter, OracleAdapter { using RLPReader for RLPReader.RLPItem; - /// @dev Proves and stores valid ancestral block hashes for a given chain ID. - /// @param chainId The ID of the chain to prove block hashes for. - /// @param blockHeaders The RLP encoded block headers to prove the hashes for. - /// @notice Block headers should be ordered by descending block number and should start with a known block header. + /// @inheritdoc IBlockHashOracleAdapter function proveAncestralBlockHashes(uint256 chainId, bytes[] memory blockHeaders) external { for (uint256 i = 0; i < blockHeaders.length; i++) { RLPReader.RLPItem memory blockHeaderRLP = RLPReader.toRlpItem(blockHeaders[i]); diff --git a/packages/evm/contracts/interfaces/IBlockHashOracleAdapter.sol b/packages/evm/contracts/interfaces/IBlockHashOracleAdapter.sol index 9bf8154a..7aab4116 100644 --- a/packages/evm/contracts/interfaces/IBlockHashOracleAdapter.sol +++ b/packages/evm/contracts/interfaces/IBlockHashOracleAdapter.sol @@ -4,9 +4,11 @@ pragma solidity ^0.8.17; import { IOracleAdapter } from "./IOracleAdapter.sol"; interface IBlockHashOracleAdapter is IOracleAdapter { - /// @dev Proves and stores valid ancestral block hashes for a given chain ID. - /// @param chainId The ID of the chain to prove block hashes for. - /// @param blockHeaders The RLP encoded block headers to prove the hashes for. - /// @notice Block headers should be ordered by descending block number and should start with a known block header. + /** + * @dev Proves and stores valid ancestral block hashes for a given chain ID. + * @param chainId - The ID of the chain for which the block hashes are to be proven and stored. + * @param blockHeaders - The RLP encoded block headers. These headers are used to prove and subsequently store the hashes. + * @notice The block headers should be ordered by descending block number. The sequence should start with a block header that is already known and verified. + */ function proveAncestralBlockHashes(uint256 chainId, bytes[] memory blockHeaders) external; }