ETH Price: $3,475.46 (+0.77%)

Contract

0xA3cdD3ac793e1CdeB60b8A42f01Bf1F05c3852D1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim210476602024-10-26 5:18:3560 days ago1729919915IN
0xA3cdD3ac...05c3852D1
0 ETH0.000434163.98904983
Claim199717122024-05-28 23:41:47210 days ago1716939707IN
0xA3cdD3ac...05c3852D1
0 ETH0.001310246.76677793
Claim199594172024-05-27 6:27:59212 days ago1716791279IN
0xA3cdD3ac...05c3852D1
0 ETH0.000922248.47351854
Claim199578072024-05-27 1:04:23212 days ago1716771863IN
0xA3cdD3ac...05c3852D1
0 ETH0.000352394.32533179
Claim199490022024-05-25 19:33:11213 days ago1716665591IN
0xA3cdD3ac...05c3852D1
0 ETH0.001040074.30617665
Claim199490002024-05-25 19:32:47213 days ago1716665567IN
0xA3cdD3ac...05c3852D1
0 ETH0.001152324.77089131
Claim199489992024-05-25 19:32:35213 days ago1716665555IN
0xA3cdD3ac...05c3852D1
0 ETH0.001060044.3888263
Claim199489902024-05-25 19:30:47213 days ago1716665447IN
0xA3cdD3ac...05c3852D1
0 ETH0.000515164.73334545
Claim199489882024-05-25 19:30:23213 days ago1716665423IN
0xA3cdD3ac...05c3852D1
0 ETH0.000515484.73623466
Claim199489862024-05-25 19:29:59213 days ago1716665399IN
0xA3cdD3ac...05c3852D1
0 ETH0.000524194.81629154
Claim199489852024-05-25 19:29:47213 days ago1716665387IN
0xA3cdD3ac...05c3852D1
0 ETH0.000468694.30632904
Claim199489852024-05-25 19:29:47213 days ago1716665387IN
0xA3cdD3ac...05c3852D1
0 ETH0.000468694.30632904
Claim199489852024-05-25 19:29:47213 days ago1716665387IN
0xA3cdD3ac...05c3852D1
0 ETH0.000468694.30635814
Claim199489812024-05-25 19:28:59213 days ago1716665339IN
0xA3cdD3ac...05c3852D1
0 ETH0.000518224.76145809
Claim199489812024-05-25 19:28:59213 days ago1716665339IN
0xA3cdD3ac...05c3852D1
0 ETH0.000518234.76148719
Claim199489772024-05-25 19:28:11213 days ago1716665291IN
0xA3cdD3ac...05c3852D1
0 ETH0.000503424.62544197
Claim199489752024-05-25 19:27:47213 days ago1716665267IN
0xA3cdD3ac...05c3852D1
0 ETH0.000531744.88561734
Claim199489752024-05-25 19:27:47213 days ago1716665267IN
0xA3cdD3ac...05c3852D1
0 ETH0.000531744.88561734
Claim199489722024-05-25 19:27:11213 days ago1716665231IN
0xA3cdD3ac...05c3852D1
0 ETH0.000558315.12976571
Claim199489712024-05-25 19:26:59213 days ago1716665219IN
0xA3cdD3ac...05c3852D1
0 ETH0.000540944.97018548
Claim199489692024-05-25 19:26:35213 days ago1716665195IN
0xA3cdD3ac...05c3852D1
0 ETH0.000496634.56303342
Claim199489692024-05-25 19:26:35213 days ago1716665195IN
0xA3cdD3ac...05c3852D1
0 ETH0.000496634.56303342
Claim199489692024-05-25 19:26:35213 days ago1716665195IN
0xA3cdD3ac...05c3852D1
0 ETH0.000496634.56303342
Claim199489652024-05-25 19:25:47213 days ago1716665147IN
0xA3cdD3ac...05c3852D1
0 ETH0.000536794.93201259
Claim199489632024-05-25 19:25:23213 days ago1716665123IN
0xA3cdD3ac...05c3852D1
0 ETH0.000551085.06332034
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BeeClaimBit

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 2500 runs

Other Settings:
default evmVersion
File 1 of 6 : BeeClaim.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

interface ITheGardens {
    function hiveMint(address _to, uint256 _amount) external;

    function ownerOf(uint256 tokenId) external view returns (address);
}

contract BeeClaimBit is Ownable {
    ITheGardens public theGardens;
    address public beekeeper;
    bool claimFinished = false;

    uint256 private constant CHUNK_SIZE = 256;
    uint256 private constant OFFSET = 0;
    uint256[10] public claimedBitmap;

    event Claimed(address indexed _to, uint16 indexed _count);

    error AccessError();
    error AlreadyClaimed();
    error MinterIsContract();
    error NotOwnerOfToken();
    error OutOfRange();
    error ClaimIsDone();

    constructor(address _mintBees, address _beekeeper) {
        theGardens = ITheGardens(_mintBees);
        beekeeper = _beekeeper;
    }

    modifier onlyBeekeeper() {
        if (!(msg.sender == beekeeper || msg.sender == owner())) {
            revert AccessError();
        }
        _;
    }

    /**
     * @dev Modifier to ensure that the caller is not a contract. This is useful for
     *      preventing potential exploits or automated actions from contracts.
     *      Reverts the transaction with a `MinterNotContract` error if the caller is a contract.
     */
    modifier beeCallerOnly() {
        // Revert the transaction if the caller is a contract
        if (msg.sender != tx.origin) {
            revert MinterIsContract();
        }

        _;
    }

    modifier claimStatus() {
        if (claimFinished == true) {
            revert ClaimIsDone();
        }
        _;
    }

    function setBeekeeper(address _beekeeper) public onlyOwner {
        beekeeper = _beekeeper;
    }

    function setStatus(bool _status) public onlyBeekeeper {
        claimFinished = _status;
    }

    function checkOwner(uint256 _tokenId) internal view returns (bool) {
        return theGardens.ownerOf(_tokenId) == msg.sender;
    }

    function isClaimedLoop(
        uint256[] memory _tokenIds
    ) public view returns (bool[] memory) {
        bool[] memory _isClaimed = new bool[](_tokenIds.length);
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            _isClaimed[i] = isClaimed(_tokenIds[i]);
        }
        return _isClaimed;
    }

    function isClaimed(uint256 tokenId) public view returns (bool) {
        if (tokenId > 2499) {
            revert OutOfRange();
        }

        unchecked {
            uint256 index = tokenId / CHUNK_SIZE;
            uint256 position = tokenId % CHUNK_SIZE;
            // Bitwise AND operation to get the bit at the position.
            // If it's 1, the function will return true; if it's 0, it will return false.
            return claimedBitmap[index] & (1 << position) != 0;
        }
    }

    function claim(
        uint256[] memory _tokenIds
    ) public claimStatus beeCallerOnly {
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            uint256 _tokenId = _tokenIds[i];

            if (!checkOwner(_tokenId)) {
                revert NotOwnerOfToken();
            }

            if (isClaimed(_tokenId)) {
                revert AlreadyClaimed();
            }

            unchecked {
                uint256 adjustedTokenId = _tokenId - OFFSET;
                uint256 index = adjustedTokenId / CHUNK_SIZE;
                uint256 position = adjustedTokenId % CHUNK_SIZE;

                // Bitwise OR operation to set the bit at the position to 1.
                claimedBitmap[index] = claimedBitmap[index] | (1 << position);
            }
        }
        theGardens.hiveMint(msg.sender, _tokenIds.length);
        emit Claimed(msg.sender, uint16(_tokenIds.length));
    }
}

File 2 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 6 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 4 of 6 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 5 of 6 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 6 of 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 2500
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_mintBees","type":"address"},{"internalType":"address","name":"_beekeeper","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessError","type":"error"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ClaimIsDone","type":"error"},{"inputs":[],"name":"MinterIsContract","type":"error"},{"inputs":[],"name":"NotOwnerOfToken","type":"error"},{"inputs":[],"name":"OutOfRange","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint16","name":"_count","type":"uint16"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"beekeeper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimedBitmap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"isClaimedLoop","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beekeeper","type":"address"}],"name":"setBeekeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"theGardens","outputs":[{"internalType":"contract ITheGardens","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526002805460ff60a01b1916905534801561001d57600080fd5b50604051610c43380380610c4383398101604081905261003c916100e2565b61004533610076565b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055610115565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100dd57600080fd5b919050565b600080604083850312156100f557600080fd5b6100fe836100c6565b915061010c602084016100c6565b90509250929050565b610b1f806101246000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80636ba4c138116100815780639e34070f1161005b5780639e34070f14610197578063c5bb4c90146101ba578063f2fde38b146101cd57600080fd5b80636ba4c1381461016b578063715018a61461017e5780638da5cb5b1461018657600080fd5b806341e21a1d116100b257806341e21a1d146101225780635c40f6f41461013757806367e700fc1461014a57600080fd5b806319907e2a146100ce57806340ee1511146100f7575b600080fd5b6100e16100dc3660046108a8565b6101e0565b6040516100ee9190610984565b60405180910390f35b60015461010a906001600160a01b031681565b6040516001600160a01b0390911681526020016100ee565b6101356101303660046109df565b610293565b005b610135610145366004610a03565b6102d5565b61015d610158366004610a25565b610378565b6040519081526020016100ee565b6101356101793660046108a8565b61038f565b6101356105d4565b6000546001600160a01b031661010a565b6101aa6101a5366004610a25565b6105e8565b60405190151581526020016100ee565b60025461010a906001600160a01b031681565b6101356101db3660046109df565b610653565b60606000825167ffffffffffffffff8111156101fe576101fe610879565b604051908082528060200260200182016040528015610227578160200160208202803683370190505b50905060005b835181101561028c5761025884828151811061024b5761024b610a3e565b60200260200101516105e8565b82828151811061026a5761026a610a3e565b911515602092830291909101909101528061028481610a6d565b91505061022d565b5092915050565b61029b610702565b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6002546001600160a01b03163314806102f857506000546001600160a01b031633145b61032e576040517f4433c0ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b600381600a811061038857600080fd5b0154905081565b60025474010000000000000000000000000000000000000000900460ff1615156001036103e8576040517fa9bcdc7700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b333214610421576040517fa691e3fe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b815181101561051c57600082828151811061044157610441610a3e565b6020026020010151905061045481610776565b61048a576040517f4c084f1400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610493816105e8565b156104ca576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80610100810460ff82166001811b600383600a81106104eb576104eb610a3e565b015417600383600a811061050157610501610a3e565b0155508392506105149150829050610a6d565b915050610424565b5060015481516040517fdfc3145a00000000000000000000000000000000000000000000000000000000815233600482015260248101919091526001600160a01b039091169063dfc3145a90604401600060405180830381600087803b15801561058557600080fd5b505af1158015610599573d6000803e3d6000fd5b5050825160405161ffff90911692503391507fbe1fc2b6bb9dec786c7dd1b6d7e03889a824d1caa9a81a6e24d0dd79ad30eac190600090a350565b6105dc610702565b6105e66000610811565b565b60006109c3821115610626576040517f7db3aba700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610100820460ff83166001811b600383600a811061064657610646610a3e565b0154161515949350505050565b61065b610702565b6001600160a01b0381166106f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6106ff81610811565b50565b6000546001600160a01b031633146105e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106ed565b6001546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905260009133916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156107dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108019190610acc565b6001600160a01b03161492915050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208083850312156108bb57600080fd5b823567ffffffffffffffff808211156108d357600080fd5b818501915085601f8301126108e757600080fd5b8135818111156108f9576108f9610879565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561093c5761093c610879565b60405291825284820192508381018501918883111561095a57600080fd5b938501935b828510156109785784358452938501939285019261095f565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156109be5783511515835292840192918401916001016109a0565b50909695505050505050565b6001600160a01b03811681146106ff57600080fd5b6000602082840312156109f157600080fd5b81356109fc816109ca565b9392505050565b600060208284031215610a1557600080fd5b813580151581146109fc57600080fd5b600060208284031215610a3757600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ac5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b600060208284031215610ade57600080fd5b81516109fc816109ca56fea2646970667358221220e462738d6fc8b082a539cac813c6b8cef88d1202ca508d57c6b95931f22dbfc064736f6c634300081200330000000000000000000000001dd870fa916d2f187863f3e97da6efd3c29c417300000000000000000000000030e64b8e4bacc2baef74ac59d33ab230a2889d50

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80636ba4c138116100815780639e34070f1161005b5780639e34070f14610197578063c5bb4c90146101ba578063f2fde38b146101cd57600080fd5b80636ba4c1381461016b578063715018a61461017e5780638da5cb5b1461018657600080fd5b806341e21a1d116100b257806341e21a1d146101225780635c40f6f41461013757806367e700fc1461014a57600080fd5b806319907e2a146100ce57806340ee1511146100f7575b600080fd5b6100e16100dc3660046108a8565b6101e0565b6040516100ee9190610984565b60405180910390f35b60015461010a906001600160a01b031681565b6040516001600160a01b0390911681526020016100ee565b6101356101303660046109df565b610293565b005b610135610145366004610a03565b6102d5565b61015d610158366004610a25565b610378565b6040519081526020016100ee565b6101356101793660046108a8565b61038f565b6101356105d4565b6000546001600160a01b031661010a565b6101aa6101a5366004610a25565b6105e8565b60405190151581526020016100ee565b60025461010a906001600160a01b031681565b6101356101db3660046109df565b610653565b60606000825167ffffffffffffffff8111156101fe576101fe610879565b604051908082528060200260200182016040528015610227578160200160208202803683370190505b50905060005b835181101561028c5761025884828151811061024b5761024b610a3e565b60200260200101516105e8565b82828151811061026a5761026a610a3e565b911515602092830291909101909101528061028481610a6d565b91505061022d565b5092915050565b61029b610702565b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6002546001600160a01b03163314806102f857506000546001600160a01b031633145b61032e576040517f4433c0ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b600381600a811061038857600080fd5b0154905081565b60025474010000000000000000000000000000000000000000900460ff1615156001036103e8576040517fa9bcdc7700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b333214610421576040517fa691e3fe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b815181101561051c57600082828151811061044157610441610a3e565b6020026020010151905061045481610776565b61048a576040517f4c084f1400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610493816105e8565b156104ca576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80610100810460ff82166001811b600383600a81106104eb576104eb610a3e565b015417600383600a811061050157610501610a3e565b0155508392506105149150829050610a6d565b915050610424565b5060015481516040517fdfc3145a00000000000000000000000000000000000000000000000000000000815233600482015260248101919091526001600160a01b039091169063dfc3145a90604401600060405180830381600087803b15801561058557600080fd5b505af1158015610599573d6000803e3d6000fd5b5050825160405161ffff90911692503391507fbe1fc2b6bb9dec786c7dd1b6d7e03889a824d1caa9a81a6e24d0dd79ad30eac190600090a350565b6105dc610702565b6105e66000610811565b565b60006109c3821115610626576040517f7db3aba700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610100820460ff83166001811b600383600a811061064657610646610a3e565b0154161515949350505050565b61065b610702565b6001600160a01b0381166106f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6106ff81610811565b50565b6000546001600160a01b031633146105e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106ed565b6001546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905260009133916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156107dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108019190610acc565b6001600160a01b03161492915050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208083850312156108bb57600080fd5b823567ffffffffffffffff808211156108d357600080fd5b818501915085601f8301126108e757600080fd5b8135818111156108f9576108f9610879565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561093c5761093c610879565b60405291825284820192508381018501918883111561095a57600080fd5b938501935b828510156109785784358452938501939285019261095f565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b818110156109be5783511515835292840192918401916001016109a0565b50909695505050505050565b6001600160a01b03811681146106ff57600080fd5b6000602082840312156109f157600080fd5b81356109fc816109ca565b9392505050565b600060208284031215610a1557600080fd5b813580151581146109fc57600080fd5b600060208284031215610a3757600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ac5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b600060208284031215610ade57600080fd5b81516109fc816109ca56fea2646970667358221220e462738d6fc8b082a539cac813c6b8cef88d1202ca508d57c6b95931f22dbfc064736f6c63430008120033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000001dd870fa916d2f187863f3e97da6efd3c29c417300000000000000000000000030e64b8e4bacc2baef74ac59d33ab230a2889d50

-----Decoded View---------------
Arg [0] : _mintBees (address): 0x1Dd870fA916d2F187863F3E97DA6eFD3c29C4173
Arg [1] : _beekeeper (address): 0x30e64B8E4bacc2BAEf74AC59D33aB230A2889d50

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001dd870fa916d2f187863f3e97da6efd3c29c4173
Arg [1] : 00000000000000000000000030e64b8e4bacc2baef74ac59d33ab230a2889d50


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.