ETH Price: $1,600.24 (-1.92%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Max Tokens209457312024-10-11 23:43:59186 days ago1728690239IN
0xd718EF3E...2543698db
0 ETH0.000211978.93201709
Withdraw209328902024-10-10 4:42:35187 days ago1728535355IN
0xd718EF3E...2543698db
0 ETH0.000309837.96703557
Claim209280022024-10-09 12:22:23188 days ago1728476543IN
0xd718EF3E...2543698db
0 ETH0.0185168114.9076819
Bid209240572024-10-08 23:10:23189 days ago1728429023IN
0xd718EF3E...2543698db
0.13 ETH0.0015112122.3257857
Bid209240332024-10-08 23:05:35189 days ago1728428735IN
0xd718EF3E...2543698db
0.12 ETH0.0013261119.59134901
Bid209240232024-10-08 23:03:35189 days ago1728428615IN
0xd718EF3E...2543698db
0.09 ETH0.0012131817.92290181
Bid209240052024-10-08 22:59:59189 days ago1728428399IN
0xd718EF3E...2543698db
0.08 ETH0.0012675718.72651619
Bid209237862024-10-08 22:15:59189 days ago1728425759IN
0xd718EF3E...2543698db
0.07 ETH0.002339833.06209164
Bid209237612024-10-08 22:10:59189 days ago1728425459IN
0xd718EF3E...2543698db
0.06 ETH0.0025229137.27219275
Start Auction ER...209025422024-10-05 23:11:35192 days ago1728169895IN
0xd718EF3E...2543698db
0.05 ETH0.003960134.92342209
Withdraw208262352024-09-25 7:48:47202 days ago1727250527IN
0xd718EF3E...2543698db
0 ETH0.000525513.51292226
Claim208259532024-09-25 6:52:23202 days ago1727247143IN
0xd718EF3E...2543698db
0 ETH0.0042791111.57880745
Start Auction ER...208040432024-09-22 5:32:11205 days ago1726983131IN
0xd718EF3E...2543698db
0.05 ETH0.006396986.44707929
Withdraw207366762024-09-12 19:39:47215 days ago1726169987IN
0xd718EF3E...2543698db
0 ETH0.000520816.15685762
Claim207289452024-09-11 17:45:23216 days ago1726076723IN
0xd718EF3E...2543698db
0 ETH0.00063472.15217832
Bid207281642024-09-11 15:08:11216 days ago1726067291IN
0xd718EF3E...2543698db
0.16 ETH0.000592828.75812592
Bid207281142024-09-11 14:58:11216 days ago1726066691IN
0xd718EF3E...2543698db
0.13 ETH0.000514157.59583414
Bid207281042024-09-11 14:56:11216 days ago1726066571IN
0xd718EF3E...2543698db
0.12 ETH0.000597398.44130913
Bid207275942024-09-11 13:13:47216 days ago1726060427IN
0xd718EF3E...2543698db
0.11 ETH0.000332444.69753533
Bid207275702024-09-11 13:08:59216 days ago1726060139IN
0xd718EF3E...2543698db
0.1 ETH0.000400435.91586438
Bid207275332024-09-11 13:01:35216 days ago1726059695IN
0xd718EF3E...2543698db
0.07 ETH0.000262563.87897054
Bid207274732024-09-11 12:49:35216 days ago1726058975IN
0xd718EF3E...2543698db
0.06 ETH0.000215273.18034329
Start Auction ER...207064052024-09-08 14:11:35219 days ago1725804695IN
0xd718EF3E...2543698db
0.05 ETH0.000775132.09448663
Claim206968082024-09-07 6:04:11220 days ago1725689051IN
0xd718EF3E...2543698db
0 ETH0.001525761.70375479
Claim206968002024-09-07 6:02:35220 days ago1725688955IN
0xd718EF3E...2543698db
0 ETH0.001679581.80302103
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer209328902024-10-10 4:42:35187 days ago1728535355
0xd718EF3E...2543698db
0.13 ETH
Transfer209240572024-10-08 23:10:23189 days ago1728429023
0xd718EF3E...2543698db
0.12 ETH
Transfer209240332024-10-08 23:05:35189 days ago1728428735
0xd718EF3E...2543698db
0.09 ETH
Transfer209240232024-10-08 23:03:35189 days ago1728428615
0xd718EF3E...2543698db
0.08 ETH
Transfer209240052024-10-08 22:59:59189 days ago1728428399
0xd718EF3E...2543698db
0.07 ETH
Transfer209237862024-10-08 22:15:59189 days ago1728425759
0xd718EF3E...2543698db
0.06 ETH
Transfer209237612024-10-08 22:10:59189 days ago1728425459
0xd718EF3E...2543698db
0.05 ETH
Transfer208262352024-09-25 7:48:47202 days ago1727250527
0xd718EF3E...2543698db
0.05 ETH
Transfer207366762024-09-12 19:39:47215 days ago1726169987
0xd718EF3E...2543698db
0.53 ETH
Transfer207281642024-09-11 15:08:11216 days ago1726067291
0xd718EF3E...2543698db
0.13 ETH
Transfer207281142024-09-11 14:58:11216 days ago1726066691
0xd718EF3E...2543698db
0.12 ETH
Transfer207281042024-09-11 14:56:11216 days ago1726066571
0xd718EF3E...2543698db
0.11 ETH
Transfer207275942024-09-11 13:13:47216 days ago1726060427
0xd718EF3E...2543698db
0.1 ETH
Transfer207275702024-09-11 13:08:59216 days ago1726060139
0xd718EF3E...2543698db
0.07 ETH
Transfer207275332024-09-11 13:01:35216 days ago1726059695
0xd718EF3E...2543698db
0.06 ETH
Transfer207274732024-09-11 12:49:35216 days ago1726058975
0xd718EF3E...2543698db
0.05 ETH
Transfer205820572024-08-22 5:28:23236 days ago1724304503
0xd718EF3E...2543698db
0.06 ETH
Transfer205638442024-08-19 16:23:47239 days ago1724084627
0xd718EF3E...2543698db
0.05 ETH
Transfer205398172024-08-16 7:52:11242 days ago1723794731
0xd718EF3E...2543698db
0.09 ETH
Transfer205398122024-08-16 7:51:11242 days ago1723794671
0xd718EF3E...2543698db
0.08 ETH
Transfer205396902024-08-16 7:26:47242 days ago1723793207
0xd718EF3E...2543698db
0.06 ETH
Transfer205395472024-08-16 6:58:11242 days ago1723791491
0xd718EF3E...2543698db
0.05 ETH
Transfer202664112024-07-09 3:59:47280 days ago1720497587
0xd718EF3E...2543698db
0.37 ETH
Transfer202650692024-07-08 23:30:23281 days ago1720481423
0xd718EF3E...2543698db
0.15 ETH
Transfer202645762024-07-08 21:51:11281 days ago1720475471
0xd718EF3E...2543698db
0.1 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Auctions

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 10000 runs

Other Settings:
paris EvmVersion
File 1 of 7 : Auctions.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

//                            _.-^-._    .--.
//                         .-'   _   '-. |__|
//                        /     |_|     \|  |
//                       /               \  |
//                      /|     _____     |\ |
//                       |    |==|==|    |  |
//   |---|---|---|---|---|    |--|--|    |  |
//   |---|---|---|---|---|    |==|==|    |  |
//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//  _______  Harvest.art v3 (Auctions) _________

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "solady/src/auth/Ownable.sol";
import "./IBidTicket.sol";

enum Status {
    Active,
    Claimed,
    Refunded,
    Abandoned,
    Withdrawn
}

struct Auction {
    uint8 auctionType;
    address tokenAddress;
    uint64 endTime;
    uint8 tokenCount;
    Status status;
    address highestBidder;
    uint256 highestBid;
    mapping(uint256 => uint256) tokenIds;
    mapping(uint256 => uint256) amounts;
}

contract Auctions is Ownable {
    uint8 private constant AUCTION_TYPE_ERC721 = 0;
    uint8 private constant AUCTION_TYPE_ERC1155 = 1;

    IBidTicket public bidTicket;

    address public theBarn;
    uint256 public bidTicketTokenId = 1;
    uint256 public bidTicketCostStart = 5;
    uint256 public bidTicketCostBid = 1;
    uint256 public maxTokens = 10;
    uint256 public nextAuctionId = 1;
    uint256 public minStartingBid = 0.05 ether;
    uint256 public minBidIncrement = 0.01 ether;
    uint256 public auctionDuration = 7 days;
    uint256 public settlementDuration = 7 days;

    uint256 public constant ABANDONMENT_FEE_PERCENT = 20;

    mapping(uint256 => Auction) public auctions;
    mapping(address => mapping(uint256 => bool)) public auctionTokensERC721;
    mapping(address => mapping(uint256 => uint256)) public auctionTokensERC1155;

    error AuctionAbandoned();
    error AuctionActive();
    error AuctionClaimed();
    error AuctionEnded();
    error AuctionIsApproved();
    error AuctionNotClaimed();
    error AuctionNotEnded();
    error AuctionRefunded();
    error AuctionWithdrawn();
    error BidTooLow();
    error InvalidLengthOfAmounts();
    error InvalidLengthOfTokenIds();
    error MaxTokensPerTxReached();
    error NotEnoughTokensInSupply();
    error NotHighestBidder();
    error SettlementPeriodNotExpired();
    error SettlementPeriodEnded();
    error StartPriceTooLow();
    error TokenAlreadyInAuction();
    error TokenNotOwned();
    error TransferFailed();

    event Abandoned(uint256 indexed auctionId, address indexed bidder, uint256 indexed fee);
    event AuctionStarted(address indexed bidder, address indexed tokenAddress, uint256[] indexed tokenIds);
    event Claimed(uint256 indexed auctionId, address indexed winner);
    event NewBid(uint256 indexed auctionId, address indexed bidder, uint256 indexed value);
    event Refunded(uint256 indexed auctionId, address indexed bidder, uint256 indexed value);
    event Withdrawn(uint256 indexed auctionId, address indexed bidder, uint256 indexed value);

    constructor(address theBarn_, address bidTicket_) {
        _initializeOwner(msg.sender);
        theBarn = theBarn_;
        bidTicket = IBidTicket(bidTicket_);
    }

    /**
     *
     * startAuction - Starts an auction for a given token
     *
     * @param tokenAddress - The address of the token contract
     * @param tokenIds - The token ids to auction
     *
     */

    function startAuctionERC721(address tokenAddress, uint256[] calldata tokenIds) external payable {
        if (msg.value < minStartingBid) {
            revert StartPriceTooLow();
        }

        bidTicket.burn(msg.sender, bidTicketTokenId, bidTicketCostStart);

        _validateAuctionTokensERC721(tokenAddress, tokenIds);

        Auction storage auction = auctions[nextAuctionId];

        auction.auctionType = AUCTION_TYPE_ERC721;
        auction.tokenAddress = tokenAddress;
        auction.endTime = uint64(block.timestamp + auctionDuration);
        auction.highestBidder = msg.sender;
        auction.highestBid = msg.value;
        auction.tokenCount = uint8(tokenIds.length);

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;

        for (uint256 i; i < tokenIds.length;) {
            tokenMap[i] = tokenIds[i];

            unchecked {
                ++i;
            }
        }

        unchecked {
            ++nextAuctionId;
        }

        emit AuctionStarted(msg.sender, tokenAddress, tokenIds);
    }

    /**
     *
     * startAuction - Starts an auction for a given token
     *
     * @param tokenAddress - The address of the token contract
     * @param tokenIds - The token ids to auction
     * @param amounts - The amounts of each token to auction
     *
     */

    function startAuctionERC1155(address tokenAddress, uint256[] calldata tokenIds, uint256[] calldata amounts)
        external
        payable
    {
        if (msg.value < minStartingBid) {
            revert StartPriceTooLow();
        }

        bidTicket.burn(msg.sender, bidTicketTokenId, bidTicketCostStart);

        _validateAuctionTokensERC1155(tokenAddress, tokenIds, amounts);

        Auction storage auction = auctions[nextAuctionId];

        auction.auctionType = AUCTION_TYPE_ERC1155;
        auction.tokenAddress = tokenAddress;
        auction.endTime = uint64(block.timestamp + auctionDuration);
        auction.highestBidder = msg.sender;
        auction.highestBid = msg.value;
        auction.tokenCount = uint8(tokenIds.length);

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;
        mapping(uint256 => uint256) storage amountMap = auction.amounts;

        for (uint256 i; i < tokenIds.length;) {
            tokenMap[i] = tokenIds[i];
            amountMap[i] = amounts[i];

            unchecked {
                ++i;
            }
        }

        unchecked {
            ++nextAuctionId;
        }

        emit AuctionStarted(msg.sender, tokenAddress, tokenIds);
    }

    /**
     * bid - Places a bid on an auction
     *
     * @param auctionId - The id of the auction to bid on
     *
     */

    function bid(uint256 auctionId) external payable {
        Auction storage auction = auctions[auctionId];

        if (block.timestamp > auction.endTime) {
            revert AuctionEnded();
        }

        if (block.timestamp >= auction.endTime - 1 hours) {
            auction.endTime += 1 hours;
        }

        if (msg.value < auction.highestBid + minBidIncrement) {
            revert BidTooLow();
        }

        address prevHighestBidder = auction.highestBidder;
        uint256 prevHighestBid = auction.highestBid;

        auction.highestBidder = msg.sender;
        auction.highestBid = msg.value;

        bidTicket.burn(msg.sender, bidTicketTokenId, bidTicketCostBid);

        if (prevHighestBidder != address(0)) {
            (bool success,) = payable(prevHighestBidder).call{value: prevHighestBid}("");
            if (!success) revert TransferFailed();
        }

        emit NewBid(auctionId, msg.sender, msg.value);
    }

    /**
     * claim - Claims the tokens from an auction
     *
     * @param auctionId - The id of the auction to claim
     *
     */

    function claim(uint256 auctionId) external {
        Auction storage auction = auctions[auctionId];

        if (block.timestamp < auction.endTime) {
            revert AuctionNotEnded();
        }

        if (msg.sender != auction.highestBidder) {
            revert NotHighestBidder();
        }

        if (auction.status != Status.Active) {
            if (auction.status == Status.Refunded) {
                revert AuctionRefunded();
            } else if (auction.status == Status.Claimed) {
                revert AuctionClaimed();
            } else if (auction.status == Status.Abandoned) {
                revert AuctionAbandoned();
            }
        }

        auction.status = Status.Claimed;

        if (auction.auctionType == AUCTION_TYPE_ERC721) {
            _transferERC721s(auction);
        } else {
            _transferERC1155s(auction);
        }

        emit Claimed(auctionId, msg.sender);
    }

    /**
     * refund - Refunds are available during the settlement period if The Barn has not yet approved the collection
     *
     * @param auctionId - The id of the auction to refund
     *
     */
    function refund(uint256 auctionId) external {
        Auction storage auction = auctions[auctionId];
        uint256 highestBid = auction.highestBid;
        uint256 endTime = auction.endTime;

        if (block.timestamp < endTime) {
            revert AuctionActive();
        }

        if (block.timestamp > endTime + settlementDuration) {
            revert SettlementPeriodEnded();
        }

        if (msg.sender != auction.highestBidder) {
            revert NotHighestBidder();
        }

        if (auction.status != Status.Active) {
            if (auction.status == Status.Refunded) {
                revert AuctionRefunded();
            } else if (auction.status == Status.Claimed) {
                revert AuctionClaimed();
            } else if (auction.status == Status.Withdrawn) {
                revert AuctionWithdrawn();
            }
        }

        if (auction.auctionType == AUCTION_TYPE_ERC721) {
            _checkAndResetERC721s(auction);
        } else {
            _checkAndResetERC1155s(auction);
        }

        auction.status = Status.Refunded;

        (bool success,) = payable(msg.sender).call{value: highestBid}("");
        if (!success) revert TransferFailed();

        emit Refunded(auctionId, msg.sender, highestBid);
    }

    /**
     *
     * abandon - Mark unclaimed auctions as abandoned after the settlement period
     *
     * @param auctionId - The id of the auction to abandon
     *
     */
    function abandon(uint256 auctionId) external onlyOwner {
        Auction storage auction = auctions[auctionId];
        address highestBidder = auction.highestBidder;
        uint256 highestBid = auction.highestBid;

        if (block.timestamp < auction.endTime + settlementDuration) {
            revert SettlementPeriodNotExpired();
        }

        if (auction.status != Status.Active) {
            if (auction.status == Status.Abandoned) {
                revert AuctionAbandoned();
            } else if (auction.status == Status.Refunded) {
                revert AuctionRefunded();
            } else if (auction.status == Status.Claimed) {
                revert AuctionClaimed();
            }
        }

        auction.status = Status.Abandoned;

        if (auction.auctionType == AUCTION_TYPE_ERC721) {
            _resetERC721s(auction);
        } else {
            _resetERC1155s(auction);
        }

        uint256 fee = highestBid * ABANDONMENT_FEE_PERCENT / 100;

        (bool success,) = payable(highestBidder).call{value: highestBid - fee}("");
        if (!success) revert TransferFailed();

        (success,) = payable(msg.sender).call{value: fee}("");
        if (!success) revert TransferFailed();

        emit Abandoned(auctionId, highestBidder, fee);
    }

    /**
     * withdraw - Withdraws the highest bid from claimed auctions
     *
     * @param auctionIds - The ids of the auctions to withdraw from
     *
     * @notice - Auctions can only be withdrawn after the settlement period has ended.
     *
     */

    function withdraw(uint256[] calldata auctionIds) external onlyOwner {
        uint256 totalAmount;

        for (uint256 i; i < auctionIds.length;) {
            Auction storage auction = auctions[auctionIds[i]];

            if (auction.status != Status.Claimed) {
                revert AuctionNotClaimed();
            }

            totalAmount += auction.highestBid;
            auction.status = Status.Withdrawn;

            unchecked {
                ++i;
            }
        }

        (bool success,) = payable(msg.sender).call{value: totalAmount}("");
        if (!success) revert TransferFailed();
    }

    /**
     *
     * Getters & Setters
     *
     */

    function getAuctionTokens(uint256 auctionId) external view returns (uint256[] memory, uint256[] memory) {
        Auction storage auction = auctions[auctionId];

        uint256[] memory tokenIds = new uint256[](auction.tokenCount);
        uint256[] memory amounts = new uint256[](auction.tokenCount);

        uint256 tokenCount = auction.tokenCount;

        for (uint256 i; i < tokenCount;) {
            tokenIds[i] = auction.tokenIds[i];
            if (auction.auctionType == AUCTION_TYPE_ERC721) {
                amounts[i] = 1;
            } else {
                amounts[i] = auction.amounts[i];
            }

            unchecked {
                ++i;
            }
        }

        return (tokenIds, amounts);
    }

    function setBarnAddress(address theBarn_) external onlyOwner {
        theBarn = theBarn_;
    }

    function setBidTicketAddress(address bidTicket_) external onlyOwner {
        bidTicket = IBidTicket(bidTicket_);
    }

    function setBidTicketTokenId(uint256 bidTicketTokenId_) external onlyOwner {
        bidTicketTokenId = bidTicketTokenId_;
    }

    function setMaxTokens(uint256 maxTokens_) external onlyOwner {
        maxTokens = maxTokens_;
    }

    function setMinStartingBid(uint256 minStartingBid_) external onlyOwner {
        minStartingBid = minStartingBid_;
    }

    function setMinBidIncrement(uint256 minBidIncrement_) external onlyOwner {
        minBidIncrement = minBidIncrement_;
    }

    function setAuctionDuration(uint256 auctionDuration_) external onlyOwner {
        auctionDuration = auctionDuration_;
    }

    function setSettlementDuration(uint256 settlementDuration_) external onlyOwner {
        settlementDuration = settlementDuration_;
    }

    /**
     *
     * Internal Functions
     *
     */

    function _validateAuctionTokensERC721(address tokenAddress, uint256[] calldata tokenIds) internal {
        if (tokenIds.length == 0) {
            revert InvalidLengthOfTokenIds();
        }

        IERC721 erc721Contract = IERC721(tokenAddress);

        if (tokenIds.length > maxTokens) {
            revert MaxTokensPerTxReached();
        }

        mapping(uint256 => bool) storage auctionTokens = auctionTokensERC721[tokenAddress];

        for (uint256 i; i < tokenIds.length;) {
            uint256 tokenId = tokenIds[i];

            if (auctionTokens[tokenId]) {
                revert TokenAlreadyInAuction();
            }

            auctionTokens[tokenId] = true;

            if (erc721Contract.ownerOf(tokenId) != theBarn) {
                revert TokenNotOwned();
            }

            unchecked {
                ++i;
            }
        }
    }

    function _validateAuctionTokensERC1155(
        address tokenAddress,
        uint256[] calldata tokenIds,
        uint256[] calldata amounts
    ) internal {
        if (tokenIds.length == 0) {
            revert InvalidLengthOfTokenIds();
        }

        if (tokenIds.length != amounts.length) {
            revert InvalidLengthOfAmounts();
        }

        IERC1155 erc1155Contract = IERC1155(tokenAddress);
        uint256 totalTokens;
        uint256 totalNeeded;
        uint256 balance;
        uint256 tokenId;
        uint256 amount;

        mapping(uint256 => uint256) storage auctionTokens = auctionTokensERC1155[tokenAddress];

        for (uint256 i; i < tokenIds.length;) {
            tokenId = tokenIds[i];
            amount = amounts[i];

            totalTokens += amount;
            totalNeeded = auctionTokens[tokenId] + amount;
            balance = erc1155Contract.balanceOf(theBarn, tokenId);

            if (totalNeeded > balance) {
                revert NotEnoughTokensInSupply();
            }

            unchecked {
                auctionTokens[tokenId] += amount;
                ++i;
            }
        }

        if (totalTokens > maxTokens) {
            revert MaxTokensPerTxReached();
        }
    }

    function _transferERC721s(Auction storage auction) internal {
        address tokenAddress = auction.tokenAddress;
        uint256 tokenCount = auction.tokenCount;
        address highestBidder = auction.highestBidder;
        IERC721 erc721Contract = IERC721(tokenAddress);

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;
        mapping(uint256 => bool) storage auctionTokens = auctionTokensERC721[tokenAddress];

        for (uint256 i; i < tokenCount;) {
            uint256 tokenId = tokenMap[i];
            auctionTokens[tokenId] = false;
            erc721Contract.transferFrom(theBarn, highestBidder, tokenId);

            unchecked {
                ++i;
            }
        }
    }

    function _transferERC1155s(Auction storage auction) internal {
        address tokenAddress = auction.tokenAddress;
        IERC1155 erc1155Contract = IERC1155(tokenAddress);
        uint256 tokenCount = auction.tokenCount;
        uint256[] memory tokenIds = new uint256[](tokenCount);
        uint256[] memory amounts = new uint256[](tokenCount);

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;
        mapping(uint256 => uint256) storage amountMap = auction.amounts;
        mapping(uint256 => uint256) storage auctionTokens = auctionTokensERC1155[tokenAddress];

        for (uint256 i; i < tokenCount;) {
            uint256 tokenId = tokenMap[i];
            uint256 amount = amountMap[i];

            tokenIds[i] = tokenId;
            amounts[i] = amount;
            auctionTokens[tokenId] -= amount;

            unchecked {
                ++i;
            }
        }

        erc1155Contract.safeBatchTransferFrom(theBarn, auction.highestBidder, tokenIds, amounts, "");
    }

    function _resetERC721s(Auction storage auction) internal {
        address tokenAddress = auction.tokenAddress;
        uint256 tokenCount = auction.tokenCount;

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;
        mapping(uint256 => bool) storage auctionTokens = auctionTokensERC721[tokenAddress];

        for (uint256 i; i < tokenCount;) {
            uint256 tokenId = tokenMap[i];
            auctionTokens[tokenId] = false;

            unchecked {
                ++i;
            }
        }
    }

    function _resetERC1155s(Auction storage auction) internal {
        address tokenAddress = auction.tokenAddress;
        uint256 tokenCount = auction.tokenCount;
        uint256[] memory tokenIds = new uint256[](tokenCount);
        uint256[] memory amounts = new uint256[](tokenCount);

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;
        mapping(uint256 => uint256) storage amountMap = auction.amounts;
        mapping(uint256 => uint256) storage auctionTokens = auctionTokensERC1155[tokenAddress];

        for (uint256 i; i < tokenCount;) {
            uint256 tokenId = tokenMap[i];
            uint256 amount = amountMap[i];

            tokenIds[i] = tokenId;
            amounts[i] = amount;
            auctionTokens[tokenId] -= amount;

            unchecked {
                ++i;
            }
        }
    }

    function _checkAndResetERC721s(Auction storage auction) internal {
        address tokenAddress = auction.tokenAddress;
        uint256 tokenCount = auction.tokenCount;

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;
        mapping(uint256 => bool) storage auctionTokens = auctionTokensERC721[tokenAddress];

        bool notRefundable = IERC721(tokenAddress).isApprovedForAll(theBarn, address(this));

        for (uint256 i; i < tokenCount;) {
            uint256 tokenId = tokenMap[i];
            auctionTokens[tokenId] = false;

            notRefundable = notRefundable && (IERC721(tokenAddress).ownerOf(tokenId) == theBarn);

            unchecked {
                ++i;
            }
        }

        if (notRefundable) {
            revert AuctionIsApproved();
        }
    }

    function _checkAndResetERC1155s(Auction storage auction) internal {
        address tokenAddress = auction.tokenAddress;
        uint256 tokenCount = auction.tokenCount;
        uint256[] memory tokenIds = new uint256[](tokenCount);
        uint256[] memory amounts = new uint256[](tokenCount);

        mapping(uint256 => uint256) storage tokenMap = auction.tokenIds;
        mapping(uint256 => uint256) storage amountMap = auction.amounts;
        mapping(uint256 => uint256) storage auctionTokens = auctionTokensERC1155[tokenAddress];

        bool notRefundable = IERC1155(tokenAddress).isApprovedForAll(theBarn, address(this));

        for (uint256 i; i < tokenCount;) {
            uint256 tokenId = tokenMap[i];
            uint256 amount = amountMap[i];

            tokenIds[i] = tokenId;
            amounts[i] = amount;
            auctionTokens[tokenId] -= amount;

            notRefundable = notRefundable && (IERC1155(tokenAddress).balanceOf(theBarn, tokenId) >= amount);

            unchecked {
                ++i;
            }
        }

        if (notRefundable) {
            revert AuctionIsApproved();
        }
    }
}

File 2 of 7 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 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 ERC721 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 ERC721
     * 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 caller.
     *
     * 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);
}

File 3 of 7 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 4 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Simple single owner authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract Ownable {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The caller is not authorized to call the function.
    error Unauthorized();

    /// @dev The `newOwner` cannot be the zero address.
    error NewOwnerIsZeroAddress();

    /// @dev The `pendingOwner` does not have a valid handover request.
    error NoHandoverRequest();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                           EVENTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.
    /// This event is intentionally kept the same as OpenZeppelin's Ownable to be
    /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
    /// despite it not being as lightweight as a single argument event.
    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

    /// @dev An ownership handover to `pendingOwner` has been requested.
    event OwnershipHandoverRequested(address indexed pendingOwner);

    /// @dev The ownership handover to `pendingOwner` has been canceled.
    event OwnershipHandoverCanceled(address indexed pendingOwner);

    /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
    uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
        0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;

    /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
        0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;

    /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
        0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STORAGE                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The owner slot is given by: `not(_OWNER_SLOT_NOT)`.
    /// It is intentionally chosen to be a high value
    /// to avoid collision with lower slots.
    /// The choice of manual storage layout is to enable compatibility
    /// with both regular and upgradeable contracts.
    uint256 private constant _OWNER_SLOT_NOT = 0x8b78c6d8;

    /// The ownership handover slot of `newOwner` is given by:
    /// ```
    ///     mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
    ///     let handoverSlot := keccak256(0x00, 0x20)
    /// ```
    /// It stores the expiry timestamp of the two-step ownership handover.
    uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     INTERNAL FUNCTIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Initializes the owner directly without authorization guard.
    /// This function must be called upon initialization,
    /// regardless of whether the contract is upgradeable or not.
    /// This is to enable generalization to both regular and upgradeable contracts,
    /// and to save gas in case the initial owner is not the caller.
    /// For performance reasons, this function will not check if there
    /// is an existing owner.
    function _initializeOwner(address newOwner) internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Clean the upper 96 bits.
            newOwner := shr(96, shl(96, newOwner))
            // Store the new value.
            sstore(not(_OWNER_SLOT_NOT), newOwner)
            // Emit the {OwnershipTransferred} event.
            log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
        }
    }

    /// @dev Sets the owner directly without authorization guard.
    function _setOwner(address newOwner) internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            let ownerSlot := not(_OWNER_SLOT_NOT)
            // Clean the upper 96 bits.
            newOwner := shr(96, shl(96, newOwner))
            // Emit the {OwnershipTransferred} event.
            log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
            // Store the new value.
            sstore(ownerSlot, newOwner)
        }
    }

    /// @dev Throws if the sender is not the owner.
    function _checkOwner() internal view virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // If the caller is not the stored owner, revert.
            if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {
                mstore(0x00, 0x82b42900) // `Unauthorized()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Returns how long a two-step ownership handover is valid for in seconds.
    /// Override to return a different value if needed.
    /// Made internal to conserve bytecode. Wrap it in a public function if needed.
    function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
        return 48 * 3600;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  PUBLIC UPDATE FUNCTIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Allows the owner to transfer the ownership to `newOwner`.
    function transferOwnership(address newOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(shl(96, newOwner)) {
                mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
                revert(0x1c, 0x04)
            }
        }
        _setOwner(newOwner);
    }

    /// @dev Allows the owner to renounce their ownership.
    function renounceOwnership() public payable virtual onlyOwner {
        _setOwner(address(0));
    }

    /// @dev Request a two-step ownership handover to the caller.
    /// The request will automatically expire in 48 hours (172800 seconds) by default.
    function requestOwnershipHandover() public payable virtual {
        unchecked {
            uint256 expires = block.timestamp + _ownershipHandoverValidFor();
            /// @solidity memory-safe-assembly
            assembly {
                // Compute and set the handover slot to `expires`.
                mstore(0x0c, _HANDOVER_SLOT_SEED)
                mstore(0x00, caller())
                sstore(keccak256(0x0c, 0x20), expires)
                // Emit the {OwnershipHandoverRequested} event.
                log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
            }
        }
    }

    /// @dev Cancels the two-step ownership handover to the caller, if any.
    function cancelOwnershipHandover() public payable virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, caller())
            sstore(keccak256(0x0c, 0x20), 0)
            // Emit the {OwnershipHandoverCanceled} event.
            log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
        }
    }

    /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
    /// Reverts if there is no existing ownership handover requested by `pendingOwner`.
    function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            let handoverSlot := keccak256(0x0c, 0x20)
            // If the handover does not exist, or has expired.
            if gt(timestamp(), sload(handoverSlot)) {
                mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.
                revert(0x1c, 0x04)
            }
            // Set the handover slot to 0.
            sstore(handoverSlot, 0)
        }
        _setOwner(pendingOwner);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   PUBLIC READ FUNCTIONS                    */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the owner of the contract.
    function owner() public view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := sload(not(_OWNER_SLOT_NOT))
        }
    }

    /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
    function ownershipHandoverExpiresAt(address pendingOwner)
        public
        view
        virtual
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute the handover slot.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            // Load the handover slot.
            result := sload(keccak256(0x0c, 0x20))
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         MODIFIERS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Marks a function as only callable by the owner.
    modifier onlyOwner() virtual {
        _checkOwner();
        _;
    }
}

File 5 of 7 : IBidTicket.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "ERC1155P/contracts/IERC1155P.sol";

interface IBidTicket is IERC1155P {
    function setURI(uint256 tokenId, string calldata tokenURI) external;

    function mint(address to, uint256 id, uint256 amount) external;
    function mintBatch(address to, uint256[] calldata ids, uint256[] calldata amounts) external;

    function burn(address from, uint256 id, uint256 amount) external;
    function burnBatch(address from, uint256[] calldata ids, uint256[] calldata amounts) external;

    function setHarvestContract(address harvestContract_) external;
    function setAuctionsContract(address auctionsContract_) external;
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * 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[EIP 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);
}

File 7 of 7 : IERC1155P.sol
// SPDX-License-Identifier: MIT
// ERC721P Contracts v1.1

pragma solidity ^0.8.20;

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155P {

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Arrays cannot be different lengths.
     */
    error ArrayLengthMismatch();

    /**
     * Cannot burn from the zero address.
     */
    error BurnFromZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The quantity of tokens being burned is greater than account balance.
     */
    error BurnExceedsBalance();

    /**
     * The quantity of tokens being transferred is greater than account balance.
     */
    error TransferExceedsBalance();

    /**
     * The resulting token balance exceeds the maximum storable by ERC1155P
     */
    error ExceedsMaximumBalance();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC1155Receiver interface.
     */
    error TransferToNonERC1155ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * Exceeds max token ID
     */
    error ExceedsMaximumTokenId();
    
    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "ERC1155P/=lib/ERC1155P/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "solady/=lib/solady/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"theBarn_","type":"address"},{"internalType":"address","name":"bidTicket_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AuctionAbandoned","type":"error"},{"inputs":[],"name":"AuctionActive","type":"error"},{"inputs":[],"name":"AuctionClaimed","type":"error"},{"inputs":[],"name":"AuctionEnded","type":"error"},{"inputs":[],"name":"AuctionIsApproved","type":"error"},{"inputs":[],"name":"AuctionNotClaimed","type":"error"},{"inputs":[],"name":"AuctionNotEnded","type":"error"},{"inputs":[],"name":"AuctionRefunded","type":"error"},{"inputs":[],"name":"AuctionWithdrawn","type":"error"},{"inputs":[],"name":"BidTooLow","type":"error"},{"inputs":[],"name":"InvalidLengthOfAmounts","type":"error"},{"inputs":[],"name":"InvalidLengthOfTokenIds","type":"error"},{"inputs":[],"name":"MaxTokensPerTxReached","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"NotEnoughTokensInSupply","type":"error"},{"inputs":[],"name":"NotHighestBidder","type":"error"},{"inputs":[],"name":"SettlementPeriodEnded","type":"error"},{"inputs":[],"name":"SettlementPeriodNotExpired","type":"error"},{"inputs":[],"name":"StartPriceTooLow","type":"error"},{"inputs":[],"name":"TokenAlreadyInAuction","type":"error"},{"inputs":[],"name":"TokenNotOwned","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"Abandoned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"AuctionStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"winner","type":"address"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":true,"internalType":"uint256","name":"value","type":"uint256"}],"name":"NewBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":true,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Refunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":true,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"ABANDONMENT_FEE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"abandon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"auctionDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctionTokensERC1155","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctionTokensERC721","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctions","outputs":[{"internalType":"uint8","name":"auctionType","type":"uint8"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"uint8","name":"tokenCount","type":"uint8"},{"internalType":"enum Status","name":"status","type":"uint8"},{"internalType":"address","name":"highestBidder","type":"address"},{"internalType":"uint256","name":"highestBid","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"bid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"bidTicket","outputs":[{"internalType":"contract IBidTicket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bidTicketCostBid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bidTicketCostStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bidTicketTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"getAuctionTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBidIncrement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minStartingBid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextAuctionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionDuration_","type":"uint256"}],"name":"setAuctionDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"theBarn_","type":"address"}],"name":"setBarnAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bidTicket_","type":"address"}],"name":"setBidTicketAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bidTicketTokenId_","type":"uint256"}],"name":"setBidTicketTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxTokens_","type":"uint256"}],"name":"setMaxTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minBidIncrement_","type":"uint256"}],"name":"setMinBidIncrement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minStartingBid_","type":"uint256"}],"name":"setMinStartingBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"settlementDuration_","type":"uint256"}],"name":"setSettlementDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settlementDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"startAuctionERC1155","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"startAuctionERC721","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"theBarn","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"auctionIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608034620000ff57601f62002a1638819003918201601f19168301916001600160401b0383118484101762000104578084926040948552833981010312620000ff576200005a602062000052836200011a565b92016200011a565b600160025560056003556001600455600a600555600160065566b1a2bc2ec50000600755662386f26fc1000060085562093a8080600955600a5533638b78c6d819553360007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a3600180546001600160a01b039384166001600160a01b031991821617909155600080549290931691161790556040516128e69081620001308239f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620000ff5756fe608080604052600436101561001357600080fd5b600090813560e01c9081630b45c68b1461255a575080630cbf54c81461253c57806311e776fe146125195780631c180bfb146124fb5780632149180a1461212957806325692962146120de578063278ecde114611aa2578063335b115e14611a84578063379607f51461159f5780633e77db961461157c578063454a2ab3146112cb578063481eb12b146112a857806350f45c5f1461128557806354d1f13d1461123f57806355ee09d71461121c578063571a26a01461115357806357692213146111355780635b32bc2b14611117578063605fd47e146110c8578063715018a61461106757806377f0b7631461104b5780638001227814610f7b5780638da5cb5b14610f2857806395723b9914610f0a578063983d95ce14610dae578063a497e67414610d8b578063b18786f114610d57578063b321c5f614610cf3578063b674610b14610c9f578063e0d217f214610902578063e5f96b74146108a0578063e831574214610882578063ee65e41614610371578063f04e283e146102c9578063f2fde38b14610234578063fc52848214610216578063fcc8da55146101f85763fee81cf4146101c357600080fd5b346101f55760206003193601126101f5576101dc61258a565b9063389a75e1600c5252602080600c2054604051908152f35b80fd5b50346101f557806003193601126101f5576020600354604051908152f35b50346101f557806003193601126101f5576020600654604051908152f35b5060206003193601126101f55761024961258a565b610251612612565b8060601b156102bc5773ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08580a35580f35b637448fbae82526004601cfd5b5060206003193601126101f5576102de61258a565b6102e6612612565b63389a75e1600c528082526020600c208054421161036457908273ffffffffffffffffffffffffffffffffffffffff9255167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08580a35580f35b636f5e881883526004601cfd5b5060606003193601126101f55761038661258a565b60243567ffffffffffffffff811161087e576103a69036906004016125ad565b9060443567ffffffffffffffff811161087a576103c79036906004016125ad565b906007543410610850578573ffffffffffffffffffffffffffffffffffffffff815416600254600354823b1561084c576040517ff5298aca000000000000000000000000000000000000000000000000000000008152336004820152602481019290925260448201529082908290606490829084905af1801561084157610829575b505083156107ff578184036107d5578573ffffffffffffffffffffffffffffffffffffffff86168752600d6020528660408120815b8781106106935750505060055410610669576006548652600b6020526040862080547fffffffffffffffffffffff00000000000000000000000000000000000000000016600887901b74ffffffffffffffffffffffffffffffffffffffff001617600190811782559290919061054f67ffffffffffffffff610502600954426126ce565b85547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff16911660a81b7cffffffffffffffff00000000000000000000000000000000000000000016178455565b82840180547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905534600284015582547fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e887901b7dff000000000000000000000000000000000000000000000000000000000016178355600460038401930191885b87811061063157898973ffffffffffffffffffffffffffffffffffffffff6106078b8b8b60065401600655612749565b9116337f363c8081f838f6a42f2a07fdc246a0cedf39b0603fecc455911735617bf1efb58480a480f35b8061063e87928a8a61270a565b35818c528660205260408c205561065681858561270a565b35818c528560205260408c2055016105d7565b60046040517fbb8eb9c4000000000000000000000000000000000000000000000000000000008152fd5b6106c46107326106d36106ab848c8c9997989961270a565b359460406106ba868c8c61270a565b35948580936126ce565b988781528860205220546126ce565b6001546040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018790529260209184918f91839182906044820190565b0392165afa9182156107ca578d92610791575b5011610767576001928b528360205260408b209081540190550190889161047e565b60046040517f6fd9bc11000000000000000000000000000000000000000000000000000000008152fd5b9091506020813d6020116107c2575b816107ad6020938361268d565b810103126107bd57519038610745565b600080fd5b3d91506107a0565b6040513d8f823e3d90fd5b60046040517fc1829e1d000000000000000000000000000000000000000000000000000000008152fd5b60046040517f89d2fa40000000000000000000000000000000000000000000000000000000008152fd5b6108329061264a565b61083d578538610449565b8580fd5b6040513d84823e3d90fd5b8380fd5b60046040517f994a3f1e000000000000000000000000000000000000000000000000000000008152fd5b8480fd5b8280fd5b50346101f557806003193601126101f5576020600554604051908152f35b50346101f55760206003193601126101f55773ffffffffffffffffffffffffffffffffffffffff6108cf61258a565b6108d7612612565b167fffffffffffffffffffffffff000000000000000000000000000000000000000082541617815580f35b50346101f557602080600319360112610c9b57600435610920612612565b808352600b8252604083209073ffffffffffffffffffffffffffffffffffffffff9160019083828201541693600282015495825461096d600a5467ffffffffffffffff8360a81c166126ce565b4210610c715760ff8160f01c166005811015610c445780610baa575b507fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81167e03000000000000000000000000000000000000000000000000000000000000178085559060ff16610b115750825491600360ff8460e81c1694019260081c168852600c81526040882091885b848110610ad1575050505050505b6014830283810460141484151715610aa457848080610a2c606482950480986127e4565b865af1610a37612786565b5015610a7a578380808086335af1610a4d612786565b5015610a7a577f08b1a23ceef87b88b472ae4e56e7b9d38dd1a9a368488b2b21fd4bec4ecd34798480a480f35b60046040517f90b8ec18000000000000000000000000000000000000000000000000000000008152fd5b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b808a528183526040808b20548b528484528a2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905585016109fa565b60e881901c60ff169392610b2485612809565b90610b2e86612809565b9060046003870196019360081c168b52600d845260408b20948b805b888110610b605750505050505050505050610a08565b808a92528287528d610ba060408083205492898b52818120549380610b85878c612858565b5284610b91878b612858565b5281528b8b52209182546127e4565b9055018c90610b4a565b60038103610bdc5760046040517fd2f096fc000000000000000000000000000000000000000000000000000000008152fd5b60028103610c0e5760046040517fac03bac4000000000000000000000000000000000000000000000000000000008152fd5b8514610c1a5738610989565b60046040517ffd3566e1000000000000000000000000000000000000000000000000000000008152fd5b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b60046040517febbfde8f000000000000000000000000000000000000000000000000000000008152fd5b5080fd5b50346101f55760406003193601126101f55760ff604060209273ffffffffffffffffffffffffffffffffffffffff610cd561258a565b168152600c8452818120602435825284522054166040519015158152f35b50346101f55760206003193601126101f55773ffffffffffffffffffffffffffffffffffffffff610d2261258a565b610d2a612612565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600154161760015580f35b50346101f557806003193601126101f557602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b50346101f55760206003193601126101f557610da5612612565b60043560095580f35b50346101f55780602080600319360112610f075760043567ffffffffffffffff8111610f0357610de3839136906004016125ad565b90610dec612612565b829383925b808410610e125784808080808a335af1610e09612786565b5015610a7a5780f35b9091929350610e2284828561270a565b358652600b82526040862080549460ff8660f01c16916005831015610ed6576001809303610eac577e040000000000000000000000000000000000000000000000000000000000007fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610e9b8b9a6002850154906126ce565b981617905501929190949394610df1565b60046040517fda178436000000000000000000000000000000000000000000000000000000008152fd5b6024897f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b5050fd5b50fd5b50346101f557806003193601126101f5576020600254604051908152f35b50346101f557806003193601126101f55760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275473ffffffffffffffffffffffffffffffffffffffff60405191168152f35b50346101f557602090816003193601126101f5576004358152600b8252604081209081549060ff8260e81c1690610fb182612809565b93610fbb83612809565b9360ff161560038201835b858110610ffb57610fea88610ff78b8a6040519485946040865260408601906125de565b91848303908501526125de565b0390f35b806001918652828a526040862054611013828b612858565b52831561102d5781611025828a612858565b525b01610fc6565b808652600485018a526040862054611045828a612858565b52611027565b50346101f557806003193601126101f557602060405160148152f35b50806003193601126101f55761107b612612565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a35580f35b50346101f55760406003193601126101f557604060209173ffffffffffffffffffffffffffffffffffffffff6110fc61258a565b168152600d8352818120602435825283522054604051908152f35b50346101f557806003193601126101f5576020600454604051908152f35b50346101f557806003193601126101f5576020600a54604051908152f35b50346101f55760206003193601126101f5576004358152600b60205260408120805460ff8160f01c169173ffffffffffffffffffffffffffffffffffffffff9260ff600285600185015416930154936040519582821687528160081c16602087015267ffffffffffffffff8160a81c16604087015260e81c16606085015260058110156111ef5760e09450608084015260a083015260c0820152f35b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b50346101f55760206003193601126101f557611236612612565b60043560085580f35b50806003193601126101f55763389a75e1600c52338152806020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c928280a280f35b50346101f55760206003193601126101f55761129f612612565b600435600a5580f35b50346101f55760206003193601126101f5576112c2612612565b60043560025580f35b5060206003193601126101f557600435808252600b6020526040822067ffffffffffffffff80825460a81c16804211611552577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1f0810182811161152557821642101561149a575b5050600281018054611346600854826126ce565b341061147057600185930180549273ffffffffffffffffffffffffffffffffffffffff91828516947fffffffffffffffffffffffff0000000000000000000000000000000000000000339116179055349055835416600254600454823b1561083d576040517ff5298aca000000000000000000000000000000000000000000000000000000008152336004820152602481019290925260448201529084908290606490829084905af1908115611465578491611451575b505081611433575b505050349033907f558a0d5d5468d74b0db24c74eb348b42271c2ebb4c9e953ced38aaed95fa43618480a480f35b8280929181925af1611443612786565b5015610a7a57813880611405565b61145a9061264a565b61087e5782386113fd565b6040513d86823e3d90fd5b60046040517fa0d26eb6000000000000000000000000000000000000000000000000000000008152fd5b610e10019081116114f85781547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff1660a89190911b7cffffffffffffffff000000000000000000000000000000000000000000161781553880611332565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b60046040517fa0e92984000000000000000000000000000000000000000000000000000000008152fd5b50346101f55760206003193601126101f557611596612612565b60043560075580f35b50346101f55760206003193601126101f5576004358152600b60205260408120805467ffffffffffffffff8160a81c164210611a5a5773ffffffffffffffffffffffffffffffffffffffff6001830154163303611a305760ff8160f01c166005811015611a035780611968575b507fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81167e01000000000000000000000000000000000000000000000000000000000000178083559060ff166117c4575080548260ff73ffffffffffffffffffffffffffffffffffffffff8360081c169260e81c1692600373ffffffffffffffffffffffffffffffffffffffff600183015416910192808352600c6020526040832093835b8681106116eb57505050505050505b336004357f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a212128380a380f35b80855281602052604085205480865286602052604086207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905573ffffffffffffffffffffffffffffffffffffffff6001541690843b156117c057604051917f23b872dd00000000000000000000000000000000000000000000000000000000835260048301528560248301526044820152858160648183885af19081156117b55786916117a1575b50506001016116b1565b6117aa9061264a565b61087a578438611797565b6040513d88823e3d90fd5b8680fd5b91906117d560ff8460e81c16612809565b906117e560ff8560e81c16612809565b9073ffffffffffffffffffffffffffffffffffffffff8560081c168452600d60205260408420845b60ff8760e81c168110611914575050839473ffffffffffffffffffffffffffffffffffffffff600181815416930154169173ffffffffffffffffffffffffffffffffffffffff8260081c163b1561083d578573ffffffffffffffffffffffffffffffffffffffff60206118d683976118c46040519a8b998a987f2eb2c2d6000000000000000000000000000000000000000000000000000000008a5260048a0152602489015260a0604489015260a48801906125de565b906003198783030160648801526125de565b83858203916003198301608488015252019360081c165af1801561084157611900575b50506116c0565b6119099061264a565b6101f55780386118f9565b806001918752600384016020526040872054600485016020526040882054908061193e848a612858565b528161194a8489612858565b52885283602052611960604089209182546127e4565b90550161180d565b6002810361199a5760046040517fac03bac4000000000000000000000000000000000000000000000000000000008152fd5b600181036119cc5760046040517ffd3566e1000000000000000000000000000000000000000000000000000000008152fd5b6003146119d9573861160c565b60046040517fd2f096fc000000000000000000000000000000000000000000000000000000008152fd5b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b60046040517fb3a846f2000000000000000000000000000000000000000000000000000000008152fd5b60046040517f64637389000000000000000000000000000000000000000000000000000000008152fd5b50346101f557806003193601126101f5576020600854604051908152f35b50346101f55760206003193601126101f5576004358152600b60205260408120600281015490805467ffffffffffffffff8160a81c168042106120b457600a54611aeb916126ce565b421161208a5773ffffffffffffffffffffffffffffffffffffffff6001830154163303611a305760ff8160f01c1660058110156111ef5780611fef575b5060ff8116611db857508054600881901c73ffffffffffffffffffffffffffffffffffffffff908116808652600c6020908152604080882060015491517fe985e9c5000000000000000000000000000000000000000000000000000000008152919094166004820152306024820152600386019460e81c60ff16939181604481865afa908115611dad578891611d7e575b509392919087935b838510611c84575050505050611c5a575b7e020000000000000000000000000000000000000000000000000000000000007fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8254161790558180808084335af1611c29612786565b5015610a7a57336004357f7ca5472b7ea78c2c0141c5a12ee6d170cf4ce8ed06be3d22c8252ddfc7a6a2c48480a480f35b60046040517f47cc5d51000000000000000000000000000000000000000000000000000000008152fd5b909192939485895281602052604089205490818a528360205260408a207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905580611cdc575b60019150950193929190611bc1565b50604051907f6352211e0000000000000000000000000000000000000000000000000000000082526004820152602081602481875afa8015611d73576001918a91611d44575b5073ffffffffffffffffffffffffffffffffffffffff80835416911614611ccd565b611d66915060203d602011611d6c575b611d5e818361268d565b81019061286c565b38611d22565b503d611d54565b6040513d8b823e3d90fd5b611da0915060203d602011611da6575b611d98818361268d565b810190612898565b38611bb9565b503d611d8e565b6040513d8a823e3d90fd5b611dc760ff8260e81c16612809565b90611dd760ff8260e81c16612809565b73ffffffffffffffffffffffffffffffffffffffff600883901c8116808852600d60209081526040808a2060015491517fe985e9c500000000000000000000000000000000000000000000000000000000815291909416600482015230602482015293949391829060449082905afa908115611dad578891611fd0575b509392919087935b60ff8360e81c168510611e9d57505050505015611bd25760046040517f47cc5d51000000000000000000000000000000000000000000000000000000008152fd5b90919293948589526003870160205260408920546004880160205260408a20549080611ec98986612858565b5281611ed58989612858565b52808b528460205260408b20611eec8382546127e4565b905582611f04575b5050600190950193929190611e5c565b6001546040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481019190915291506020828060448101038173ffffffffffffffffffffffffffffffffffffffff8960081c165afa8015611fc5578a90611f92575b10159050600138611ef4565b506020823d602011611fbd575b81611fac6020938361268d565b810103126107bd5760019151611f86565b3d9150611f9f565b6040513d8c823e3d90fd5b611fe9915060203d602011611da657611d98818361268d565b38611e54565b600281036120215760046040517fac03bac4000000000000000000000000000000000000000000000000000000008152fd5b600181036120535760046040517ffd3566e1000000000000000000000000000000000000000000000000000000008152fd5b6004146120605738611b28565b60046040517fda1253c9000000000000000000000000000000000000000000000000000000008152fd5b60046040517fd7332936000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb37f7006000000000000000000000000000000000000000000000000000000008152fd5b50806003193601126101f55763389a75e1600c523381526202a30042016020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d8280a280f35b5060406003193601126101f55761213e61258a565b90602467ffffffffffffffff813581811161084c576121619036906004016125ad565b9160075434106108505773ffffffffffffffffffffffffffffffffffffffff90818654166002549060035491813b156124f7576040517ff5298aca0000000000000000000000000000000000000000000000000000000081523360048201526024810191909152604481019290925287908290606490829084905af180156124ec576124d9575b5083156107ff5781871694600554851161066957858752602092600c84526040882090885b8781106123b357505060065488525050600b82526040862080547fffffffffffffffffffffff0000000000000000000000000000000000000000001660089890981b74ffffffffffffffffffffffffffffffffffffffff00169790971787556122c99061227c600954426126ce565b88547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff16911660a81b7cffffffffffffffff00000000000000000000000000000000000000000016178755565b600186810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905534600288015586547fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e885901b7dff0000000000000000000000000000000000000000000000000000000000161787559560030190855b8481106123945750505061236b92939460065401600655612749565b90337f363c8081f838f6a42f2a07fdc246a0cedf39b0603fecc455911735617bf1efb58480a480f35b806123a18992878761270a565b3581895284845260408920550161234f565b6123be81898961270a565b3590818b5283875260ff60408c2054166124af57818b52838752898760408d2093600194857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905587604051809481937f6352211e00000000000000000000000000000000000000000000000000000000835260048301525afa9081156124a4578c91612487575b50838084541691160361245d570161220d565b60046040517f7acc9463000000000000000000000000000000000000000000000000000000008152fd5b61249e9150883d8a11611d6c57611d5e818361268d565b3861244a565b6040513d8e823e3d90fd5b60046040517f6d5b0c07000000000000000000000000000000000000000000000000000000008152fd5b6124e59096919661264a565b94386121e8565b6040513d89823e3d90fd5b8880fd5b50346101f557806003193601126101f5576020600754604051908152f35b50346101f55760206003193601126101f557612533612612565b60043560055580f35b50346101f557806003193601126101f5576020600954604051908152f35b905034610c9b5781600319360112610c9b5773ffffffffffffffffffffffffffffffffffffffff60209254168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff821682036107bd57565b9181601f840112156107bd5782359167ffffffffffffffff83116107bd576020808501948460051b0101116107bd57565b90815180825260208080930193019160005b8281106125fe575050505090565b8351855293810193928101926001016125f0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754330361263c57565b6382b429006000526004601cfd5b67ffffffffffffffff811161265e57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761265e57604052565b919082018092116126db57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919081101561271a5760051b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90604051917f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82116107bd57829160051b80918337810103902090565b3d156127df573d9067ffffffffffffffff821161265e57604051916127d360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018461268d565b82523d6000602084013e565b606090565b919082039182116126db57565b67ffffffffffffffff811161265e5760051b60200190565b90612813826127f1565b612820604051918261268d565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061284e82946127f1565b0190602036910137565b805182101561271a5760209160051b010190565b908160209103126107bd575173ffffffffffffffffffffffffffffffffffffffff811681036107bd5790565b908160209103126107bd575180151581036107bd579056fea2646970667358221220606aade7e6320fba34e2c20dc468578f16cff8df654ee1670b5cb5aabc5867e964736f6c63430008140033000000000000000000000000996e1d4ce3e1e558889832832004b2466153adbe00000000000000000000000062613aa9594d0116b5ca23acd37dddac90c67e5c

Deployed Bytecode

0x608080604052600436101561001357600080fd5b600090813560e01c9081630b45c68b1461255a575080630cbf54c81461253c57806311e776fe146125195780631c180bfb146124fb5780632149180a1461212957806325692962146120de578063278ecde114611aa2578063335b115e14611a84578063379607f51461159f5780633e77db961461157c578063454a2ab3146112cb578063481eb12b146112a857806350f45c5f1461128557806354d1f13d1461123f57806355ee09d71461121c578063571a26a01461115357806357692213146111355780635b32bc2b14611117578063605fd47e146110c8578063715018a61461106757806377f0b7631461104b5780638001227814610f7b5780638da5cb5b14610f2857806395723b9914610f0a578063983d95ce14610dae578063a497e67414610d8b578063b18786f114610d57578063b321c5f614610cf3578063b674610b14610c9f578063e0d217f214610902578063e5f96b74146108a0578063e831574214610882578063ee65e41614610371578063f04e283e146102c9578063f2fde38b14610234578063fc52848214610216578063fcc8da55146101f85763fee81cf4146101c357600080fd5b346101f55760206003193601126101f5576101dc61258a565b9063389a75e1600c5252602080600c2054604051908152f35b80fd5b50346101f557806003193601126101f5576020600354604051908152f35b50346101f557806003193601126101f5576020600654604051908152f35b5060206003193601126101f55761024961258a565b610251612612565b8060601b156102bc5773ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08580a35580f35b637448fbae82526004601cfd5b5060206003193601126101f5576102de61258a565b6102e6612612565b63389a75e1600c528082526020600c208054421161036457908273ffffffffffffffffffffffffffffffffffffffff9255167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08580a35580f35b636f5e881883526004601cfd5b5060606003193601126101f55761038661258a565b60243567ffffffffffffffff811161087e576103a69036906004016125ad565b9060443567ffffffffffffffff811161087a576103c79036906004016125ad565b906007543410610850578573ffffffffffffffffffffffffffffffffffffffff815416600254600354823b1561084c576040517ff5298aca000000000000000000000000000000000000000000000000000000008152336004820152602481019290925260448201529082908290606490829084905af1801561084157610829575b505083156107ff578184036107d5578573ffffffffffffffffffffffffffffffffffffffff86168752600d6020528660408120815b8781106106935750505060055410610669576006548652600b6020526040862080547fffffffffffffffffffffff00000000000000000000000000000000000000000016600887901b74ffffffffffffffffffffffffffffffffffffffff001617600190811782559290919061054f67ffffffffffffffff610502600954426126ce565b85547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff16911660a81b7cffffffffffffffff00000000000000000000000000000000000000000016178455565b82840180547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905534600284015582547fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e887901b7dff000000000000000000000000000000000000000000000000000000000016178355600460038401930191885b87811061063157898973ffffffffffffffffffffffffffffffffffffffff6106078b8b8b60065401600655612749565b9116337f363c8081f838f6a42f2a07fdc246a0cedf39b0603fecc455911735617bf1efb58480a480f35b8061063e87928a8a61270a565b35818c528660205260408c205561065681858561270a565b35818c528560205260408c2055016105d7565b60046040517fbb8eb9c4000000000000000000000000000000000000000000000000000000008152fd5b6106c46107326106d36106ab848c8c9997989961270a565b359460406106ba868c8c61270a565b35948580936126ce565b988781528860205220546126ce565b6001546040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018790529260209184918f91839182906044820190565b0392165afa9182156107ca578d92610791575b5011610767576001928b528360205260408b209081540190550190889161047e565b60046040517f6fd9bc11000000000000000000000000000000000000000000000000000000008152fd5b9091506020813d6020116107c2575b816107ad6020938361268d565b810103126107bd57519038610745565b600080fd5b3d91506107a0565b6040513d8f823e3d90fd5b60046040517fc1829e1d000000000000000000000000000000000000000000000000000000008152fd5b60046040517f89d2fa40000000000000000000000000000000000000000000000000000000008152fd5b6108329061264a565b61083d578538610449565b8580fd5b6040513d84823e3d90fd5b8380fd5b60046040517f994a3f1e000000000000000000000000000000000000000000000000000000008152fd5b8480fd5b8280fd5b50346101f557806003193601126101f5576020600554604051908152f35b50346101f55760206003193601126101f55773ffffffffffffffffffffffffffffffffffffffff6108cf61258a565b6108d7612612565b167fffffffffffffffffffffffff000000000000000000000000000000000000000082541617815580f35b50346101f557602080600319360112610c9b57600435610920612612565b808352600b8252604083209073ffffffffffffffffffffffffffffffffffffffff9160019083828201541693600282015495825461096d600a5467ffffffffffffffff8360a81c166126ce565b4210610c715760ff8160f01c166005811015610c445780610baa575b507fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81167e03000000000000000000000000000000000000000000000000000000000000178085559060ff16610b115750825491600360ff8460e81c1694019260081c168852600c81526040882091885b848110610ad1575050505050505b6014830283810460141484151715610aa457848080610a2c606482950480986127e4565b865af1610a37612786565b5015610a7a578380808086335af1610a4d612786565b5015610a7a577f08b1a23ceef87b88b472ae4e56e7b9d38dd1a9a368488b2b21fd4bec4ecd34798480a480f35b60046040517f90b8ec18000000000000000000000000000000000000000000000000000000008152fd5b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b808a528183526040808b20548b528484528a2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905585016109fa565b60e881901c60ff169392610b2485612809565b90610b2e86612809565b9060046003870196019360081c168b52600d845260408b20948b805b888110610b605750505050505050505050610a08565b808a92528287528d610ba060408083205492898b52818120549380610b85878c612858565b5284610b91878b612858565b5281528b8b52209182546127e4565b9055018c90610b4a565b60038103610bdc5760046040517fd2f096fc000000000000000000000000000000000000000000000000000000008152fd5b60028103610c0e5760046040517fac03bac4000000000000000000000000000000000000000000000000000000008152fd5b8514610c1a5738610989565b60046040517ffd3566e1000000000000000000000000000000000000000000000000000000008152fd5b60248a7f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b60046040517febbfde8f000000000000000000000000000000000000000000000000000000008152fd5b5080fd5b50346101f55760406003193601126101f55760ff604060209273ffffffffffffffffffffffffffffffffffffffff610cd561258a565b168152600c8452818120602435825284522054166040519015158152f35b50346101f55760206003193601126101f55773ffffffffffffffffffffffffffffffffffffffff610d2261258a565b610d2a612612565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600154161760015580f35b50346101f557806003193601126101f557602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b50346101f55760206003193601126101f557610da5612612565b60043560095580f35b50346101f55780602080600319360112610f075760043567ffffffffffffffff8111610f0357610de3839136906004016125ad565b90610dec612612565b829383925b808410610e125784808080808a335af1610e09612786565b5015610a7a5780f35b9091929350610e2284828561270a565b358652600b82526040862080549460ff8660f01c16916005831015610ed6576001809303610eac577e040000000000000000000000000000000000000000000000000000000000007fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610e9b8b9a6002850154906126ce565b981617905501929190949394610df1565b60046040517fda178436000000000000000000000000000000000000000000000000000000008152fd5b6024897f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b5050fd5b50fd5b50346101f557806003193601126101f5576020600254604051908152f35b50346101f557806003193601126101f55760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275473ffffffffffffffffffffffffffffffffffffffff60405191168152f35b50346101f557602090816003193601126101f5576004358152600b8252604081209081549060ff8260e81c1690610fb182612809565b93610fbb83612809565b9360ff161560038201835b858110610ffb57610fea88610ff78b8a6040519485946040865260408601906125de565b91848303908501526125de565b0390f35b806001918652828a526040862054611013828b612858565b52831561102d5781611025828a612858565b525b01610fc6565b808652600485018a526040862054611045828a612858565b52611027565b50346101f557806003193601126101f557602060405160148152f35b50806003193601126101f55761107b612612565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a35580f35b50346101f55760406003193601126101f557604060209173ffffffffffffffffffffffffffffffffffffffff6110fc61258a565b168152600d8352818120602435825283522054604051908152f35b50346101f557806003193601126101f5576020600454604051908152f35b50346101f557806003193601126101f5576020600a54604051908152f35b50346101f55760206003193601126101f5576004358152600b60205260408120805460ff8160f01c169173ffffffffffffffffffffffffffffffffffffffff9260ff600285600185015416930154936040519582821687528160081c16602087015267ffffffffffffffff8160a81c16604087015260e81c16606085015260058110156111ef5760e09450608084015260a083015260c0820152f35b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b50346101f55760206003193601126101f557611236612612565b60043560085580f35b50806003193601126101f55763389a75e1600c52338152806020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c928280a280f35b50346101f55760206003193601126101f55761129f612612565b600435600a5580f35b50346101f55760206003193601126101f5576112c2612612565b60043560025580f35b5060206003193601126101f557600435808252600b6020526040822067ffffffffffffffff80825460a81c16804211611552577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1f0810182811161152557821642101561149a575b5050600281018054611346600854826126ce565b341061147057600185930180549273ffffffffffffffffffffffffffffffffffffffff91828516947fffffffffffffffffffffffff0000000000000000000000000000000000000000339116179055349055835416600254600454823b1561083d576040517ff5298aca000000000000000000000000000000000000000000000000000000008152336004820152602481019290925260448201529084908290606490829084905af1908115611465578491611451575b505081611433575b505050349033907f558a0d5d5468d74b0db24c74eb348b42271c2ebb4c9e953ced38aaed95fa43618480a480f35b8280929181925af1611443612786565b5015610a7a57813880611405565b61145a9061264a565b61087e5782386113fd565b6040513d86823e3d90fd5b60046040517fa0d26eb6000000000000000000000000000000000000000000000000000000008152fd5b610e10019081116114f85781547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff1660a89190911b7cffffffffffffffff000000000000000000000000000000000000000000161781553880611332565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b60046040517fa0e92984000000000000000000000000000000000000000000000000000000008152fd5b50346101f55760206003193601126101f557611596612612565b60043560075580f35b50346101f55760206003193601126101f5576004358152600b60205260408120805467ffffffffffffffff8160a81c164210611a5a5773ffffffffffffffffffffffffffffffffffffffff6001830154163303611a305760ff8160f01c166005811015611a035780611968575b507fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81167e01000000000000000000000000000000000000000000000000000000000000178083559060ff166117c4575080548260ff73ffffffffffffffffffffffffffffffffffffffff8360081c169260e81c1692600373ffffffffffffffffffffffffffffffffffffffff600183015416910192808352600c6020526040832093835b8681106116eb57505050505050505b336004357f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a212128380a380f35b80855281602052604085205480865286602052604086207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905573ffffffffffffffffffffffffffffffffffffffff6001541690843b156117c057604051917f23b872dd00000000000000000000000000000000000000000000000000000000835260048301528560248301526044820152858160648183885af19081156117b55786916117a1575b50506001016116b1565b6117aa9061264a565b61087a578438611797565b6040513d88823e3d90fd5b8680fd5b91906117d560ff8460e81c16612809565b906117e560ff8560e81c16612809565b9073ffffffffffffffffffffffffffffffffffffffff8560081c168452600d60205260408420845b60ff8760e81c168110611914575050839473ffffffffffffffffffffffffffffffffffffffff600181815416930154169173ffffffffffffffffffffffffffffffffffffffff8260081c163b1561083d578573ffffffffffffffffffffffffffffffffffffffff60206118d683976118c46040519a8b998a987f2eb2c2d6000000000000000000000000000000000000000000000000000000008a5260048a0152602489015260a0604489015260a48801906125de565b906003198783030160648801526125de565b83858203916003198301608488015252019360081c165af1801561084157611900575b50506116c0565b6119099061264a565b6101f55780386118f9565b806001918752600384016020526040872054600485016020526040882054908061193e848a612858565b528161194a8489612858565b52885283602052611960604089209182546127e4565b90550161180d565b6002810361199a5760046040517fac03bac4000000000000000000000000000000000000000000000000000000008152fd5b600181036119cc5760046040517ffd3566e1000000000000000000000000000000000000000000000000000000008152fd5b6003146119d9573861160c565b60046040517fd2f096fc000000000000000000000000000000000000000000000000000000008152fd5b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b60046040517fb3a846f2000000000000000000000000000000000000000000000000000000008152fd5b60046040517f64637389000000000000000000000000000000000000000000000000000000008152fd5b50346101f557806003193601126101f5576020600854604051908152f35b50346101f55760206003193601126101f5576004358152600b60205260408120600281015490805467ffffffffffffffff8160a81c168042106120b457600a54611aeb916126ce565b421161208a5773ffffffffffffffffffffffffffffffffffffffff6001830154163303611a305760ff8160f01c1660058110156111ef5780611fef575b5060ff8116611db857508054600881901c73ffffffffffffffffffffffffffffffffffffffff908116808652600c6020908152604080882060015491517fe985e9c5000000000000000000000000000000000000000000000000000000008152919094166004820152306024820152600386019460e81c60ff16939181604481865afa908115611dad578891611d7e575b509392919087935b838510611c84575050505050611c5a575b7e020000000000000000000000000000000000000000000000000000000000007fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8254161790558180808084335af1611c29612786565b5015610a7a57336004357f7ca5472b7ea78c2c0141c5a12ee6d170cf4ce8ed06be3d22c8252ddfc7a6a2c48480a480f35b60046040517f47cc5d51000000000000000000000000000000000000000000000000000000008152fd5b909192939485895281602052604089205490818a528360205260408a207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905580611cdc575b60019150950193929190611bc1565b50604051907f6352211e0000000000000000000000000000000000000000000000000000000082526004820152602081602481875afa8015611d73576001918a91611d44575b5073ffffffffffffffffffffffffffffffffffffffff80835416911614611ccd565b611d66915060203d602011611d6c575b611d5e818361268d565b81019061286c565b38611d22565b503d611d54565b6040513d8b823e3d90fd5b611da0915060203d602011611da6575b611d98818361268d565b810190612898565b38611bb9565b503d611d8e565b6040513d8a823e3d90fd5b611dc760ff8260e81c16612809565b90611dd760ff8260e81c16612809565b73ffffffffffffffffffffffffffffffffffffffff600883901c8116808852600d60209081526040808a2060015491517fe985e9c500000000000000000000000000000000000000000000000000000000815291909416600482015230602482015293949391829060449082905afa908115611dad578891611fd0575b509392919087935b60ff8360e81c168510611e9d57505050505015611bd25760046040517f47cc5d51000000000000000000000000000000000000000000000000000000008152fd5b90919293948589526003870160205260408920546004880160205260408a20549080611ec98986612858565b5281611ed58989612858565b52808b528460205260408b20611eec8382546127e4565b905582611f04575b5050600190950193929190611e5c565b6001546040517efdd58e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481019190915291506020828060448101038173ffffffffffffffffffffffffffffffffffffffff8960081c165afa8015611fc5578a90611f92575b10159050600138611ef4565b506020823d602011611fbd575b81611fac6020938361268d565b810103126107bd5760019151611f86565b3d9150611f9f565b6040513d8c823e3d90fd5b611fe9915060203d602011611da657611d98818361268d565b38611e54565b600281036120215760046040517fac03bac4000000000000000000000000000000000000000000000000000000008152fd5b600181036120535760046040517ffd3566e1000000000000000000000000000000000000000000000000000000008152fd5b6004146120605738611b28565b60046040517fda1253c9000000000000000000000000000000000000000000000000000000008152fd5b60046040517fd7332936000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb37f7006000000000000000000000000000000000000000000000000000000008152fd5b50806003193601126101f55763389a75e1600c523381526202a30042016020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d8280a280f35b5060406003193601126101f55761213e61258a565b90602467ffffffffffffffff813581811161084c576121619036906004016125ad565b9160075434106108505773ffffffffffffffffffffffffffffffffffffffff90818654166002549060035491813b156124f7576040517ff5298aca0000000000000000000000000000000000000000000000000000000081523360048201526024810191909152604481019290925287908290606490829084905af180156124ec576124d9575b5083156107ff5781871694600554851161066957858752602092600c84526040882090885b8781106123b357505060065488525050600b82526040862080547fffffffffffffffffffffff0000000000000000000000000000000000000000001660089890981b74ffffffffffffffffffffffffffffffffffffffff00169790971787556122c99061227c600954426126ce565b88547fffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffff16911660a81b7cffffffffffffffff00000000000000000000000000000000000000000016178755565b600186810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905534600288015586547fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e885901b7dff0000000000000000000000000000000000000000000000000000000000161787559560030190855b8481106123945750505061236b92939460065401600655612749565b90337f363c8081f838f6a42f2a07fdc246a0cedf39b0603fecc455911735617bf1efb58480a480f35b806123a18992878761270a565b3581895284845260408920550161234f565b6123be81898961270a565b3590818b5283875260ff60408c2054166124af57818b52838752898760408d2093600194857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905587604051809481937f6352211e00000000000000000000000000000000000000000000000000000000835260048301525afa9081156124a4578c91612487575b50838084541691160361245d570161220d565b60046040517f7acc9463000000000000000000000000000000000000000000000000000000008152fd5b61249e9150883d8a11611d6c57611d5e818361268d565b3861244a565b6040513d8e823e3d90fd5b60046040517f6d5b0c07000000000000000000000000000000000000000000000000000000008152fd5b6124e59096919661264a565b94386121e8565b6040513d89823e3d90fd5b8880fd5b50346101f557806003193601126101f5576020600754604051908152f35b50346101f55760206003193601126101f557612533612612565b60043560055580f35b50346101f557806003193601126101f5576020600954604051908152f35b905034610c9b5781600319360112610c9b5773ffffffffffffffffffffffffffffffffffffffff60209254168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff821682036107bd57565b9181601f840112156107bd5782359167ffffffffffffffff83116107bd576020808501948460051b0101116107bd57565b90815180825260208080930193019160005b8281106125fe575050505090565b8351855293810193928101926001016125f0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754330361263c57565b6382b429006000526004601cfd5b67ffffffffffffffff811161265e57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761265e57604052565b919082018092116126db57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919081101561271a5760051b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90604051917f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82116107bd57829160051b80918337810103902090565b3d156127df573d9067ffffffffffffffff821161265e57604051916127d360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018461268d565b82523d6000602084013e565b606090565b919082039182116126db57565b67ffffffffffffffff811161265e5760051b60200190565b90612813826127f1565b612820604051918261268d565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061284e82946127f1565b0190602036910137565b805182101561271a5760209160051b010190565b908160209103126107bd575173ffffffffffffffffffffffffffffffffffffffff811681036107bd5790565b908160209103126107bd575180151581036107bd579056fea2646970667358221220606aade7e6320fba34e2c20dc468578f16cff8df654ee1670b5cb5aabc5867e964736f6c63430008140033

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

000000000000000000000000996e1d4ce3e1e558889832832004b2466153adbe00000000000000000000000062613aa9594d0116b5ca23acd37dddac90c67e5c

-----Decoded View---------------
Arg [0] : theBarn_ (address): 0x996e1d4ce3e1e558889832832004B2466153adbe
Arg [1] : bidTicket_ (address): 0x62613AA9594D0116b5CA23aCd37dDDAc90c67E5c

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000996e1d4ce3e1e558889832832004b2466153adbe
Arg [1] : 00000000000000000000000062613aa9594d0116b5ca23acd37dddac90c67e5c


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  ]
[ 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.