BurnVerifierL1

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "contracts/BurnVerifierL1.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

/// @title BurnVerifierL1 (Ethereum / Fault-Proofs)
/// @author Shibburn.com
/// @notice Handles verified burn reports arriving from Base (L2) through OptimismPortal2,
///         then triggers the SHIB burn on L1 once finalized.
/// @dev Uses Bedrock-era OptimismPortal2 ABI with prove/finalize functions and structs.

interface IShibburnL1 {
    function burn() external;
}

interface IOptimismPortal2 {
 
    struct WithdrawalTransaction {
        uint256 nonce;
        address sender;
        address target;
        uint256 value;
        uint256 gasLimit;
        bytes data;
    }

    struct OutputRootProof {
        bytes32 version;
        bytes32 stateRoot;
        bytes32 messagePasserStorageRoot;
        bytes32 latestBlockhash;
    }

    function proveWithdrawalTransaction(
        WithdrawalTransaction calldata _tx,
        uint256 _disputeGameIndex,
        OutputRootProof calldata _outputRootProof,
        bytes[] calldata _withdrawalProof
    ) external;

    function finalizeWithdrawalTransactionExternalProof(
        WithdrawalTransaction calldata _tx,
        address _proofSubmitter
    ) external;

    event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to);
    event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success);
}

contract BurnVerifierL1 {
   
    /// @notice Shibburn L1 burn contract
    IShibburnL1 public constant shibburn =
        IShibburnL1(0x5476E7F4d7691359504875D256B5B8533B8eE173);

    /// @notice Official Base L1 Portal (OptimismPortal2 proxy)
    address public constant BASE_PORTAL =
        0x49048044D57e1C92A77f79988d21Fa8fAF74E97e;

    mapping(bytes32 => bool) public executedReports;

    event ReportProven(bytes32 indexed reportId, uint256 amount, address reporter);
    event ReportFinalized(bytes32 indexed reportId, uint256 amount, uint256 timestamp);

    function proveWithdrawal(
        IOptimismPortal2.WithdrawalTransaction calldata _tx,
        uint256 _disputeGameIndex,
        IOptimismPortal2.OutputRootProof calldata _outputRootProof,
        bytes[] calldata _withdrawalProof
    ) external {
        IOptimismPortal2(BASE_PORTAL).proveWithdrawalTransaction(
            _tx,
            _disputeGameIndex,
            _outputRootProof,
            _withdrawalProof
        );

        bytes32 reportId = keccak256(abi.encode(_tx.sender, _tx.nonce));
        emit ReportProven(reportId, _tx.value, msg.sender);
    }

    /// @dev Calls `finalizeWithdrawalTransactionExternalProof()` which triggers the target call on L1.
    ///      Once successful, it executes the SHIB burn.
    function finalizeWithdrawal(
        IOptimismPortal2.WithdrawalTransaction calldata _tx,
        address _proofSubmitter,
        uint256 amount
    ) external {
        bytes32 reportId = keccak256(abi.encode(_tx.sender, _tx.nonce));
        require(!executedReports[reportId], "already executed");
        require(amount > 0, "amount=0");

        IOptimismPortal2(BASE_PORTAL).finalizeWithdrawalTransactionExternalProof(
            _tx,
            _proofSubmitter
        );

        executedReports[reportId] = true;
        shibburn.burn();

        emit ReportFinalized(reportId, amount, block.timestamp);
    }

    /// @notice Check if a report has already been executed
    function isExecuted(bytes32 reportId) external view returns (bool) {
        return executedReports[reportId];
    }
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": [],
    "evmVersion": "cancun"
  }
}}

Tags:
Factory|addr:0xea54a44685a027f640f72c6f5e866339206a0399|verified:true|block:23744928|tx:0xf8d6cda8cec2976bdec9a35333d2353acedd81ed9f97d3b39d4548ab7b02045a|first_check:1762514128

Submitted on: 2025-11-07 12:15:29

Comments

Log in to comment.

No comments yet.