Skip to content

Commit

Permalink
feat(protocol): make custom errors in L1 libs a part of the `TaikoL1.…
Browse files Browse the repository at this point in the history
…sol`'s ABI (#13166)
  • Loading branch information
davidtaikocha authored Feb 16, 2023
1 parent feb7b28 commit 2943e3e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
49 changes: 49 additions & 0 deletions packages/protocol/contracts/L1/TaikoCustomErrors.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// SPDX-License-Identifier: MIT
// _____ _ _ _ _
// |_ _|_ _(_) |_____ | | __ _| |__ ___
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;

/// @author david <[email protected]>
abstract contract TaikoCustomErrors {
// The following custom errors must match the definitions in other V1 libraries.
error L1_0_FEE_BASE();
error L1_ANCHOR_CALLDATA();
error L1_ANCHOR_DEST();
error L1_ANCHOR_GAS_LIMIT();
error L1_ANCHOR_RECEIPT_ADDR();
error L1_ANCHOR_RECEIPT_DATA();
error L1_ANCHOR_RECEIPT_LOGS();
error L1_ANCHOR_RECEIPT_PROOF();
error L1_ANCHOR_RECEIPT_STATUS();
error L1_ANCHOR_RECEIPT_TOPICS();
error L1_ANCHOR_SIG_R();
error L1_ANCHOR_SIG_S();
error L1_ANCHOR_TYPE();
error L1_BLOCK_NUMBER();
error L1_CANNOT_BE_FIRST_PROVER();
error L1_CIRCUIT_LENGTH();
error L1_COMMITTED();
error L1_CONFLICT_PROOF();
error L1_DUP_PROVERS();
error L1_EXTRA_DATA();
error L1_GAS_LIMIT();
error L1_HALTED();
error L1_HALT_CONDITION();
error L1_ID();
error L1_INPUT_SIZE();
error L1_METADATA_FIELD();
error L1_META_MISMATCH();
error L1_NOT_COMMITTED();
error L1_NOT_FIRST_PROVER();
error L1_PROOF_LENGTH();
error L1_PROVER();
error L1_SOLO_PROPOSER();
error L1_TOO_LATE();
error L1_TOO_MANY();
error L1_TOO_MANY_PROVERS();
error L1_TX_LIST();
error L1_ZKP();
}
8 changes: 7 additions & 1 deletion packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "../libs/LibAnchorSignature.sol";
import "../libs/LibSharedConfig.sol";
import "./TaikoData.sol";
import "./TaikoEvents.sol";
import "./TaikoCustomErrors.sol";
import "./libs/LibProposing.sol";
import "./libs/LibProving.sol";
import "./libs/LibUtils.sol";
Expand All @@ -20,7 +21,12 @@ import "./libs/LibVerifying.sol";
/**
* @author dantaik <[email protected]>
*/
contract TaikoL1 is EssentialContract, IHeaderSync, TaikoEvents {
contract TaikoL1 is
EssentialContract,
IHeaderSync,
TaikoEvents,
TaikoCustomErrors
{
using LibUtils for TaikoData.State;

TaikoData.State public state;
Expand Down

0 comments on commit 2943e3e

Please sign in to comment.