Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(protocol): make custom errors in L1 libs a part of the TaikoL1.sol's ABI #13166

Merged
merged 4 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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