Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x4542919C6dFcFf7f13F62c6e89B3384ada77816E
Balance 0 ETH
Nonce 1
Code Size 972 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

972 bytes
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063dc8e92ea1461003b578063eae596ef14610050575b600080fd5b61004e6100493660046102a0565b610093565b005b6100777f0000000000000000000000009ff1acabb7e9d4daf9f1458b9138066fa0cccd3f81565b6040516001600160a01b03909116815260200160405180910390f35b806100cf5760405162461bcd60e51b8152602060048201526007602482015266494e565f41524760c81b60448201526064015b60405180910390fd5b6000805b82811015610257578383828181106100ed576100ed610317565b905060200201359150336001600160a01b03167f0000000000000000000000009ff1acabb7e9d4daf9f1458b9138066fa0cccd3f6001600160a01b0316636352211e846040518263ffffffff1660e01b815260040161014e91815260200190565b602060405180830381865afa15801561016b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018f919061032d565b6001600160a01b0316146101d15760405162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b60448201526064016100c6565b604051630852cd8d60e31b8152600481018390527f0000000000000000000000009ff1acabb7e9d4daf9f1458b9138066fa0cccd3f6001600160a01b0316906342966c6890602401600060405180830381600087803b15801561023357600080fd5b505af1158015610247573d6000803e3d6000fd5b5050600190920191506100d39050565b50336001600160a01b03167f91e13a0d397522175bae9eedfc9a7072c49ab509b9659748cddf39c8e13dd271848460405161029392919061035d565b60405180910390a2505050565b600080602083850312156102b357600080fd5b823567ffffffffffffffff8111156102ca57600080fd5b8301601f810185136102db57600080fd5b803567ffffffffffffffff8111156102f257600080fd5b8560208260051b840101111561030757600080fd5b6020919091019590945092505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561033f57600080fd5b81516001600160a01b038116811461035657600080fd5b9392505050565b6020808252810182905260006001600160fb1b0383111561037d57600080fd5b8260051b8085604085013791909101604001939250505056fea2646970667358221220b1a7e075a376d72eceafcecf5f245971fdca67d25be06b268262719ad0344e5164736f6c634300081b0033

Verified Source Code Full Match

Compiler: v0.8.27+commit.40a35a09 EVM: paris Optimization: Yes (200 runs)
IERC721.sol 135 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC-721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC-721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
     *   {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
HGPBurn.sol 25 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import "./interfaces/IHaloWalletGenesisPass.sol";

contract HGPBurn {
    IHaloWalletGenesisPass public immutable HGP; // Address of HGP contract.

    event BatchBurn(address indexed user, uint256[] tokenIds);

    constructor(IHaloWalletGenesisPass HGP_) {
        HGP = HGP_;
    }

    // User should call `HGP.setApprovalForAll()` to approve this contract firstly
    function batchBurn(uint256[] calldata tokenIds) external {
        require(tokenIds.length > 0, "INV_ARG");
        uint256 id;
        for (uint256 i = 0; i < tokenIds.length; i++) {
            id = tokenIds[i];
            require(HGP.ownerOf(id) == msg.sender, "NOT_OWNER");
            HGP.burn(id);
        }
        emit BatchBurn(msg.sender, tokenIds);
    }
}
IHaloWalletGenesisPass.sol 7 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IHaloWalletGenesisPass is IERC721 {
    function burn(uint256 tokenId) external;
}

Read Contract

HGP 0xeae596ef → address

Write Contract 1 functions

These functions modify contract state and require a wallet transaction to execute.

batchBurn 0xdc8e92ea
uint256[] tokenIds

Recent Transactions

No transactions found for this address