ETH Price: $2,515.14 (+0.31%)

Token

LooksRare INFILTRATION (LRAGENT)
 

Overview

Max Total Supply

10,000 LRAGENT

Holders

898

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
16 LRAGENT
0xe8c747737ce5a0051868c15daad5bfe24141b524
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Trade on LooksRare with Zero Marketplace Fees and Zero Royalties.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Infiltration

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 888888 runs

Other Settings:
london EvmVersion
File 1 of 20 : Infiltration.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import {IInfiltration} from "./interfaces/IInfiltration.sol";

import {OwnableTwoSteps} from "@looksrare/contracts-libs/contracts/OwnableTwoSteps.sol";
import {IERC20} from "@looksrare/contracts-libs/contracts/interfaces/generic/IERC20.sol";

import {ProtocolFee} from "@looksrare/contracts-libs/contracts/ProtocolFee.sol";
import {PackableReentrancyGuard} from "@looksrare/contracts-libs/contracts/PackableReentrancyGuard.sol";
import {LowLevelERC20Transfer} from "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelERC20Transfer.sol";
import {LowLevelWETH} from "@looksrare/contracts-libs/contracts/lowLevelCallers/LowLevelWETH.sol";
import {ITransferManager} from "@looksrare/contracts-transfer-manager/contracts/interfaces/ITransferManager.sol";

import {VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import {VRFConsumerBaseV2} from "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "erc721a/contracts/ERC721A.sol";

import {UnsafeMathUint256} from "./libraries/UnsafeMathUint256.sol";

//                                            .:^^^^^^:::::::::::::::::::::::::::::::::::::::::::::.
//                                          :~7777!!!77?JJ??????!?YYYYYYYYJ?7~~!!!!!!!!!7???7~~~!~~^:.
//                                        :~!!!~~77JYYYJJYJJJJJ7J5PPPPP55?!!!!!!!7!!~~~~~~!77??7?!7!!~^.
//                                      .^~!!!7JYYYYYYJJJJJJJJJ7Y5PPPY?!!!!!!~~~~~~!7!!~~~~~~!????J??7!!^.
//                                   .:^!!?JYYYYYYYYJJJJJJJYJJ!J55YJ?!!!!!~~~~~~~~~~~!!7!!!!!7!!!!!77?JJ?!~:.
//                                 .:^~?YYYYYYYYYJJJJJJJJJJJJ??YYJ?!!!77!!!!!!!!!!!!!!~~!!!77!!!!!!!!!!!7?J7~:.
//                               .^~~!~JYYYYYYYYYJJJJJJJJ???~^??7^.........:::::::^^^^!!!!!77!!!!!!!!!!~~!!7?7!^.
//                             :^!!!!!~~JYYYYYYJJJJJJJ7!~^:::!????~....    ...:::::::::::^^~77!!!!!!!!!~~~!!!77!!^.
//                           :~77~!7!!~!JYJJJJJJJJJ!^^^^^^^:^JJ???7!^^::::::::..::::::::::::.:~!!!!!~7?!~~~~!!!!~~!^.
//                         :!?7!!!77!~~JJJJJJJJ?!^^^^^^^^^::J???5PPG##GPPP5555?77!::::::::.....::^!!!J5Y?!~~~~!77~~~!~:
//                      .:7J?!~!77!~~~!JJJJJ?~^^^^^^^^^^^::~?5##&@@@@@&BGBGPPPP555YJ!^::......:::...^?55YJ?!~~!!!!~~!!!~:
//                    .^7J?7!!!!!!~~~~JJJJ7~^^^^^^^^^^^^:^J##@@@@@@@@@@@&#GGPPP555PPP55?:...::::::.. :!?JJJJ7!~~!77!~!!~!~:.
//                  .:!?77!!!!!!~~~~~7JJ7~^^^^^^^^^^^^::~J#@@@@@@@@@@@@@@@#BGP55PPPPPGGGJ^......:::. ^~:^7???7!!!!!!~~!!!~!~:.
//                .:!7!~~!!!!!!!~~~~!J7~^^^^^^^^^^^^^::7PB&@@@@@@@@&&B55555YGGPPPPPPGGBBBG7......:::..:^::^!7777!!!!!~~!!!!~!~^.
//              .:^~!?J!~!7!!!!!~~~!~~^^~^^^^^:::::::.7PGB&&&&@@@&G?~~~!!!!~~~75GBBBBBBBB#B?  ......   .... :~!7!!!!~~!!!!!7!~7?~.
//            .:^~!?5PPJ!~!!!!!~!!^::!~!!!^:....... .^JPB&&&&&&&G?~~!!7?JJ7!~^:^!5###&#####P~       :^^:      .^!!~~!7777!!!!~7Y5J!.
//          .:^~!JY5PPPPY!~~~~!!^.   .:^!!^.       ::YBB####&&&P~^~!~~~^^^^:::::.^P&&&&&#&&&5    .:!????7!^::.  .^!!77777777!~!J5PPY!:
//        .:~~~?Y5555PP5Y?~~!!^.        .^:..^^^!77?!5BB######B~:^^^::::::::......^#&&&&&&&&5  .:!???????????7!!^::~7?7?77777777?Y555J~.
//       .:^~!!7?J??????7!!!7~.       .......:^77?JJ!5BBBBBBB#B^:::::....::::::::.~&@@@@&&&&5...^^^^^^^^^^^~^^^^^^:.~7!!~~~~~!!!!!77?7~:.
//         .:^~!~!77!!!!!~~~!!!^:..... .::~~:....:^^:?GBBBGPPP5~.....:::::::::::.:7&&&&&&&&&P:::^:^^^^^:. .:.    .^~~~~~~~~~~~~~!77!~:.
//           .:^~!!!77!!!~~~~~~!!^.   .::!77~^:......!Y555555555!:..::::::::::..:?#&&&&&&@@&5!7???????!. :~:.. .^!!~~~~~~~~~~~!!7!~:.
//            ..:^~!!7?!!~~~~~~~~!!~:.:^!7!^.:^: .....755PPPPPPGG57:..::::::..:7P#&&&&&&@@@P!7????JJJ!. :^::.:~!!~~~~~~~~!!!!!7!~:..
//           .....:^~!!77!~~~~~~~!!!!!^!7!:....^^  .. :?PPGGGGGBBBBPYJ^^^^^^JYG####&&&#&@@G?7????JJJ~. :^:.:!777!!!!!!!!!!!!7!~:.....
//         .........:^~!!77!~~~~~~!??JY?!:...  .^^  .. :?PGBBBB####&@&######&&&#######&&#P?7????JJ7~. :^:^!?77777777777!!!7!^:.........
//        ..........:::^~!!77!!~~~~!JJ5J7!:.    .^^. ....~PBB#####&&@@@@@@@@&&########&#J77????J?7:  :^^!?77777777??7!!!7!^:::...........
//      ..........:::::::^~~!7?7~~~~~7JY7!~~^.   .^^. .   ^7?G###&&&@@@@@@@@&&######GJY?77????J?7:  :!!!J?777777??7!!!!~^:::::::..........
//    ..........::::::::^^^^~~?J7!~~~~~??7^757^^. .^^.       :7?PBB#&&&&&&&&&&#BBP?7^!777????J?7..~~?5?!????????7!!!!~^^^^::::::::..........
//   ..........:::::::^^^^^^^^^!???!~~~~!?77J?:~~^^:^:  .       .::!JJJJJJJJJJ!^^^:..777??????!~^7J!JY77JJJJ??7!!!!~^^^^^^^^:::::::..........
//  .........:::::::^^^^^^~~~~^^^!7J?!!~~~77!^:~~!~~~~:...    .  .. .::::::::::::::.^777?77??7~~7J5!!7?JJJJ?7!!!!~^^~~~~^^^^^^:::::::.........
// .........:::::::^^^^^~~~~~~!~~^^!JJ?7!~!!!~^^^~~~~!??!^~^.... .. .:::::::::::::::77???Y5Y7~~?Y5YJJJJJJ??7~!!~~~!!~~~~~~^^^^^:::::::.........
// ........::::::^^^^^^~~~~~!!!!!!!~~!??77!!!~~~~:^~~~!?J???7777~^~^~~~~!!~~~~~~~!7JYYP5PG57^!?Y55YYYJJJJ7!!!~~!!!!!!!~~~~~^^^^^^::::::........
// ......:::::::^^^^^~~~~~~!!!!!7777!~~!??7777!~!~^^~!^!??J??????????555PP5555555J?55P5PP57^!?Y55P5YYYJ?!!!~~!7777!!!!!~~~~~~^^^^^:::::::......
// .....:::::::^^^^^~~~~~!!!!!!77777??7~~!???7?777!^~!!7???77???????JY55GG555555Y??5555PY?77JY55PPP5Y?!!!~!7??777777!!!!!~~~~~^^^^^^::::::.....
// ....::::::^^^^^^~~~~~!!!!!77777??????!^^!?YY??!!!^~!777!^!??7!!!!!7Y5PP5YYYYJ7~Y5P55?7?JJY5555PPY7!!^^!??????77777!!!!!~~~~~^^^^^^::::::....
// ...::::::^^^^^~~~~~!!!!!!77777??77!~~~~^:~7JP5J7^~~!!!7!7??!7777?JJ5YYYYPPP5J77555PJ77?JY555PP5J?7~^^~~~~!77??77777!!!!!!~~~~~^^^^^::::::...
// ..::::::^^^^^~~~~~!!!!!777777!!~~~~~!!!!!~^~?5PY7~~!77!!?7!!7????JJ55555555Y?7JP5YJ?7JJY55555Y?7~^~!!!!!~~~~~!!777777!!!!!~~~~~^^^^^::::::..
// ..::::::^^^^~~~~~!!!!!77!!~~~~~~~~7?JJJ?77!^:~?Y5Y!~!7!^7J7~~!7777?YYYYYYYYJ7?55J7JJ7J55555Y?!^:^!77?JJJ?7~~~~~~~~!!77!!!!!~~~~~^^^^^:::::..
// .::::::^^^^^~~~~!!!!!!!^^^^^^~!!7777JJY?77!!~^.^7YY?~^!!^?J7~^^!77?YYYYYYYY7~75Y7JJ?JY555Y?!^:^~!!77?YJJ7777!!~^^^^^^!!!!!!!~~~~^^^^^::::::.
// ::::::^^^^^~~~~~!!!!7!:!!^:^~~!!!7!777?JJ?77!~.::^7JJ7^^~~~????77?Y5PP5P55Y7?5Y?J???Y55Y?!^:::~!77?JJ?777!7!!!~~^:^!!^!7!!!!~~~~~^^^^^::::::
// :::::^^^^^~~~~~!!!!77!:J?!^^^~~~!!!!!777??777~.^^::^7YJ!^^!!77!!7JJY555555J7!!77J??JYY?!^::^^:!777??777!!!!!~~~^^^!?J^!77!!!!~~~~~^^^^^:::::
// :::::^^^^^~~~~!!!!!777~^!???7~^~~~!!!!!777777!.^~~~^^~?J!~^~~~!7??JJ55555Y?77!!???J?~^^:^~~~^:!777777!!!!!~~~^~7???!^~777!!!!!~~~~^^^^^:::::
// ::::^^^^^~~~~~!!!!77777~^^~!??7~^~~~~~!!!!!777!.^!!~!!^^!?7!77!~!?JJ5555YJ7~^7JJJ!~:.:!!~!!^:!777!!!!!~~~~~^~7??!~^^~77777!!!!~~~~~^^^^^::::
// ::::^^^^^~~~~!!!!!7777??7!^^^!??7~^~~~~~~!!!!!!.^~!!7??^.^!????????YPPPPJ~^~7JJ?!^:.^??7!!~^:!!!!!!~~~~~~^~7??!^^^!7??7777!!!!!~~~~^^^^^::::
// ::::^^^^~~~~~!!!!77777777??~^^^~7?7~^~^~~~~!~!~.:!!7!75J::::!7????7?PPP5!^~7777~::::J57!7!!^:!!~!~~~~^~^~7?7~^^^~??77777777!!!!~~~~~^^^^::::
// :::^^^^^~~~~!!!!!~~~^:::^^~7^:^^^~7?7!^^^^~~~~~..!!!77?5J:^^::~7?J?7JPPJ:~77!^::^^:J5?77!!!..~~~~~^^^^!7?7~^^^^~7~^^:::^~~~!!!!!~~~~^^^^^:::
// ::::^^^^~~~~!!!~^^^^~^^^^:.::::^~^:~7??!^::^^^: :~!!!77?5J:^~~::~?JJ?P5~!??~::~~^:J5?77!!!~: :^^^::^!??7~:^~^::::.:^^^^~^^^^~!!!~~~~^^^^::::
// ::::::^^~~~~!!~^^^~~~~^^^^:.::::^~^::~7??!^::::.::!7!!!7?5J^^~!!~^~?YPP?7~^~!!~^^J5?7!!!7!::.::::^!??7~::^~^::::.:^^^^~~~~^^^~!!~~~~^^::::::
// ^^^^~~^^^^~~!~:^^~~!~~~^^^^:.::^~~^^:::^!??!:~!~::^!!!!!7?5J^^~!77~^~??~^~77!~^^J5?7!!!!!^::~!~:!??!^:::^^~~^::.:^^^^~~~!~~^^:~!~~^^^^~~^^^^
// ^^^~~^:^^^^^~:^^~~!!!!!!!~~~^::~^^^^^^:::!J?!^!7!^::~!!!!7?5Y!^~!!7!~^^~!7!!~^!Y5?7!!!!~::^!7!^!?J!:::^^^^^^~::^~~~!!!!!!!~~^^:~^^^^::^~~^^^
// !!~!7^.::^^::.^~~!!!!!77?JJJJ?!~^::^^^^^^~7?~:!!77!^^~~!!!7?J5Y7~^^~!~~!~^^~7Y5J?7!!!~~^^!77!!:~?7~^^^^^^::^~!?JJJJ?77!!!!!~~^.::^^::.^7!~!!
// 777J?:.:^^^...:^~!!!7Y??7?777???!.:^~^^^~!~~!!!!!!7?7~^^^~~!77?JJ??~~~~~~??JJ?77!~~^^^~7?7!!!!!!~~!~^^^~^:.!??7777?7??Y7!!!~^:...^^^:.:?J777
// !!7Y?::!77~:^^:.:^~7J??!!!7^~!!77~.:~7~~~~^^?J?!^^~~!7??!~^^^~~!!7????????7!!~~^^^~!??7!~~^^!?J?^^~~~~7~:.~777~^~~7!!??J7~^:.:^^:~77!::?Y7!!
// !!7Y?::!!~:~?7~^:::^~~7!!7!^~~~7!!~.:~!!~~~^^^~: .:^^^^~~!7!~~~^:^^^^^^^^^^:^~~~!7!~~^^^^:. :~^^^~~~!!~:.~!!7!^~!~~7!7~~^:::^~7?~:~!!::?Y7!!
// ?77?Y7^:^:~!??J?7!^::^~!!!~~~~!!!!~^.:^7?!~~^^^^::.:^^~!!~~~~~~^^^^^^^^^^^^^^~~~~~~!!~^^:.::^^^^~~!?7^:.^~!!!!~~~~!!!~^::^!7?J??!~:^:^7Y?77?
// ??!7YJ^.:^!7???YYJ?7~~^^~~7!!!~~~~~~^::^~7??777!~!^^^^:::^~~~!!!!!!!!!!!!!!!!!!~~~^:::^^^^!~!777??7~^::^~~~~~~!!!7~~^^~~7?JYY???7!^:.^JY7!??
// ??77YJ~.^~!77?JJJYYYYJ7!^^^~!777!!~~~~^::^^~!77????77?7!!~~~~^::::::::::::::::^~~~~!!7?77????77!~^^::^~~~~!!777!~^^^!7JYYYYJJJ?77!~^.~JY77??
// J??77YJ~.^!!!JJ??777??YYJJ7!~^^~!77!~~~~~~~^^^^^~~!7777??????777777777777777777??????7777!~~^^^^^~~~~~~~!77!~^^~!7JJYY??777??JJ!!!^.~JY77??J
// YY?77JY!:^!!!YJ?7!!!~~!!??JYJJ7!~^~~!!!~!!!!7777~~~~^^^~~~~~!777777777777777777!~~~~~^^^~~~~7777!!!!~!!!~~^~!7JJYJ??!!~~!!!7?JY!!!^:!YJ77?YY
// YYJ?77JY!:~!!?Y?7!!!~~~~~~!!7?JYJ?7~^^~~!!!!7????????777777~~~~~~~~~~~~~~~~~~~~~~777777????????7!!!!~~^^~7?JYJ?7!!~~~~~~!!!7?Y?!!~:!YJ77?JYY
// YJYJJ?7?J?^:!!?J?!!!~~~~~~~~~~~!7JJYY?~^^~!!77!7777?????????JJJJJJJJJJJJJJJJJJJJ?????????7777!77!!~^^~?YYJJ7!~~~~~~~~~~~!!!?J?!!:^?J?7?JJYJY
contract Infiltration is
    IInfiltration,
    OwnableTwoSteps,
    ERC721A,
    VRFConsumerBaseV2,
    LowLevelERC20Transfer,
    LowLevelWETH,
    ProtocolFee,
    PackableReentrancyGuard
{
    using UnsafeMathUint256 for uint256;

    /**
     * @notice When the frontrun lock is unlocked, agents can escape or heal.
     */
    uint8 private constant FRONTRUN_LOCK__UNLOCKED = 1;

    /**
     * @notice When the frontrun lock is locked, agents cannot escape or heal.
     */
    uint8 private constant FRONTRUN_LOCK__LOCKED = 2;

    /**
     * @notice When VRF is being requested, agents cannot escape or heal. It unlocks when the randomness is fulfilled.
     * @dev frontrunLock is initially set as locked so that agents cannot escape or heal before the game starts.
     *      It is unlocked when the first round's randomness is fulfilled.
     */
    uint8 private frontrunLock = FRONTRUN_LOCK__LOCKED;

    /**
     * @notice 100% in basis points.
     */
    uint256 private constant ONE_HUNDRED_PERCENT_IN_BASIS_POINTS = 10_000;

    /**
     * @notice 100% in basis points squared.
     */
    uint256 private constant ONE_HUNDRED_PERCENT_IN_BASIS_POINTS_SQUARED = 10_000 ** 2;

    /**
     * @notice The number of secondary prize pool winners. Their entitled shares are based on their placements.
     *         When the number of active agents is less than or equal to this number, 1 agent is instantly killed
     *         in each round.
     */
    uint256 private constant NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS = 50;

    uint256 private constant PROBABILITY_PRECISION = 100_000_000;

    /**
     * @notice Max agent supply.
     */
    uint256 public immutable MAX_SUPPLY;

    /**
     * @notice Max mint per address.
     */
    uint256 public immutable MAX_MINT_PER_ADDRESS;

    /**
     * @notice The price of minting 1 agent.
     */
    uint256 public immutable PRICE;

    /**
     * @notice The number of blocks per round.
     */
    uint256 public immutable BLOCKS_PER_ROUND;

    /**
     * @notice The percentage of agents to wound per round in basis points.
     */
    uint256 public immutable AGENTS_TO_WOUND_PER_ROUND_IN_BASIS_POINTS;

    /**
     * @notice The number of rounds for agents to be wounded before getting killed.
     */
    uint256 public immutable ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD;

    /**
     * @notice This value is used as the denominator in healProbability.
     */
    uint256 private immutable ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD_MINUS_ONE;

    /**
     * @notice This value is used as the minuend in healProbability.
     */
    uint256 private immutable HEAL_PROBABILITY_MINUEND;

    /**
     * @notice The base cost of healing an agent. The cost increases for each successful heal.
     */
    uint256 public immutable HEAL_BASE_COST;

    /**
     * @notice WETH address.
     */
    address private immutable WETH;

    /**
     * @notice LOOKS address.
     */
    address private immutable LOOKS;

    /**
     * @notice Chainlink VRF key hash.
     */

    bytes32 private immutable KEY_HASH;

    /**
     * @notice Chainlink VRF coordinator.
     */
    VRFCoordinatorV2Interface private immutable VRF_COORDINATOR;

    /**
     * @notice Chainlink VRF subscription ID.
     */
    uint64 private immutable SUBSCRIPTION_ID;

    /**
     * @notice The transfer manager contract that manages LOOKS approvals.
     */
    ITransferManager private immutable TRANSFER_MANAGER;

    /**
     * @notice The timestamp at which the mint period starts.
     */
    uint40 public mintStart;

    /**
     * @notice The timestamp at which the mint period ends.
     */
    uint40 public mintEnd;

    /**
     * @notice The bitmap of the placements of the secondary prize pool winners.
     * @dev Only bit 1 to 50 are used. Bit 0 is not used.
     */
    uint56 private prizesClaimedBitmap;

    /**
     * @notice The base URI of the collection.
     */
    string private baseURI;

    /**
     * @notice Amount of agents minted per address.
     */
    mapping(address minter => uint256 amount) public amountMintedPerAddress;

    /**
     * @notice Chainlink randomness requests.
     */
    mapping(uint256 requestId => RandomnessRequest) public randomnessRequests;

    /**
     * @notice The mapping agents acts as an "array". In the beginning of the game, the "length" of the "array"
     *         is the total supply. As the game progresses, the "length" of the "array" decreases
     *         as agents are killed. The function agentsAlive() returns the "length" of the "array".
     *
     *         When an Agent struct has 0 value for every field with its index within the total supply,
     *         it means that the agent is active.
     *
     *         Index 0 is not used as agent ID starts from 1.
     */
    mapping(uint256 index => Agent) private agents;

    /**
     * @notice It is used to find the index of an agent in the agents mapping given its agent ID.
     *         If the index is 0, it means the agent's index is the same as its agent ID as no swaps
     *         have been made.
     */
    mapping(uint256 agentId => uint256 index) private agentIdToIndex;

    /**
     * @notice The maximum healing or wounded agents allowed per round.
     */
    uint256 private constant MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND = 30;

    /**
     * @notice The maximum healing or wounded agents allowed per round + 1 for storing the array length.
     */
    uint256 private constant MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH = 31;

    /**
     * @notice The first element of the array is the length of the array.
     */
    mapping(uint256 roundId => uint16[MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH] agentIds)
        private woundedAgentIdsPerRound;

    /**
     * @notice The first element of the array is the length of the array.
     */
    mapping(uint256 roundId => uint16[MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH] agentIds)
        private healingAgentIdsPerRound;

    /**
     * @notice Game information.
     */
    GameInfo public gameInfo;

    /**
     * @dev Agent struct status offset for bitwise operations.
     */
    uint256 private constant AGENT__STATUS_OFFSET = 16;

    /**
     * @dev Agent struct wounded at offset for bitwise operations.
     */
    uint256 private constant AGENT__WOUNDED_AT_OFFSET = 24;

    /**
     * @dev Agent struct heal count offset for bitwise operations.
     */
    uint256 private constant AGENT__HEAL_COUNT_OFFSET = 64;

    /**
     * @dev GameInfo struct wounded agents offset for bitwise operations.
     */
    uint256 private constant GAME_INFO__WOUNDED_AGENTS_OFFSET = 16;

    /**
     * @dev GameInfo struct healing agents offset for bitwise operations.
     */
    uint256 private constant GAME_INFO__HEALING_AGENTS_OFFSET = 32;

    /**
     * @dev GameInfo struct dead agents offset for bitwise operations.
     */
    uint256 private constant GAME_INFO__DEAD_AGENTS_OFFSET = 48;

    /**
     * @dev GameInfo struct escaped agents offset for bitwise operations.
     */
    uint256 private constant GAME_INFO__ESCAPED_AGENTS_OFFSET = 64;

    /**
     * @dev GameInfo struct current round ID offset for bitwise operations.
     */
    uint256 private constant GAME_INFO__CURRENT_ROUND_ID_OFFSET = 80;

    /**
     * @dev GameInfo struct current round block number offset for bitwise operations.
     */
    uint256 private constant GAME_INFO__CURRENT_ROUND_BLOCK_NUMBER_OFFSET = 120;

    /**
     * @dev RandomnessRequest struct exists offset for bitwise operations.
     */
    uint256 private constant RANDOMNESS_REQUESTS__EXISTS_OFFSET = 8;

    /**
     * @dev 2 bytes bitmask.
     */
    uint256 private constant TWO_BYTES_BITMASK = 0xffff;

    /**
     * @dev 5 bytes bitmask.
     */
    uint256 private constant FIVE_BYTES_BITMASK = 0xffffffffff;

    /**
     * @param constructorCalldata Constructor calldata. See IInfiltration.ConstructorCalldata for its key values.
     */
    constructor(
        ConstructorCalldata memory constructorCalldata
    )
        OwnableTwoSteps(constructorCalldata.owner)
        ERC721A(constructorCalldata.name, constructorCalldata.symbol)
        VRFConsumerBaseV2(constructorCalldata.vrfCoordinator)
    {
        if (
            constructorCalldata.maxSupply <= NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS ||
            constructorCalldata.maxSupply > type(uint16).max
        ) {
            revert InvalidMaxSupply();
        }

        if (
            (constructorCalldata.maxSupply * constructorCalldata.agentsToWoundPerRoundInBasisPoints) >
            MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND * ONE_HUNDRED_PERCENT_IN_BASIS_POINTS
        ) {
            revert WoundedAgentIdsPerRoundExceeded();
        }

        if (constructorCalldata.roundsToBeWoundedBeforeDead < 3) {
            revert RoundsToBeWoundedBeforeDeadTooLow();
        }

        PRICE = constructorCalldata.price;
        MAX_SUPPLY = constructorCalldata.maxSupply;
        MAX_MINT_PER_ADDRESS = constructorCalldata.maxMintPerAddress;
        BLOCKS_PER_ROUND = constructorCalldata.blocksPerRound;
        AGENTS_TO_WOUND_PER_ROUND_IN_BASIS_POINTS = constructorCalldata.agentsToWoundPerRoundInBasisPoints;
        ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD = constructorCalldata.roundsToBeWoundedBeforeDead;

        // The next 2 values are used in healProbability
        ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD_MINUS_ONE = ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD.unsafeSubtract(1);
        HEAL_PROBABILITY_MINUEND =
            ((ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD * 99 - 80) * PROBABILITY_PRECISION) /
            ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD_MINUS_ONE;

        LOOKS = constructorCalldata.looks;
        HEAL_BASE_COST = constructorCalldata.healBaseCost;

        KEY_HASH = constructorCalldata.keyHash;
        VRF_COORDINATOR = VRFCoordinatorV2Interface(constructorCalldata.vrfCoordinator);
        SUBSCRIPTION_ID = constructorCalldata.subscriptionId;

        TRANSFER_MANAGER = ITransferManager(constructorCalldata.transferManager);
        WETH = constructorCalldata.weth;

        baseURI = constructorCalldata.baseURI;

        _updateProtocolFeeRecipient(constructorCalldata.protocolFeeRecipient);
        _updateProtocolFeeBp(constructorCalldata.protocolFeeBp);
    }

    /**
     * @dev updateProtocolFeeBp is not implemented in this contract.
     */
    function updateProtocolFeeBp(uint16) external pure override {
        revert Immutable();
    }

    /**
     * @dev updateProtocolFeeRecipient is not implemented in this contract.
     */
    function updateProtocolFeeRecipient(address) external pure override {
        revert Immutable();
    }

    /**
     * @inheritdoc IInfiltration
     */
    function setMintPeriod(uint40 newMintStart, uint40 newMintEnd) external onlyOwner {
        if (newMintStart >= newMintEnd) {
            revert InvalidMintPeriod();
        }

        if (newMintStart != 0) {
            if (block.timestamp > newMintStart) {
                revert MintStartIsInThePast();
            }

            uint256 currentMintStart = mintStart;
            if (currentMintStart != 0) {
                if (block.timestamp >= currentMintStart) {
                    revert MintAlreadyStarted();
                }
            }

            mintStart = newMintStart;
        }

        if (block.timestamp > newMintEnd || newMintEnd < mintEnd) {
            revert MintCanOnlyBeExtended();
        }

        mintEnd = newMintEnd;

        emit MintPeriodUpdated(newMintStart == 0 ? mintStart : newMintStart, newMintEnd);
    }

    /**
     * @inheritdoc IInfiltration
     * @notice As long as the game has not started (after mint end), the owner can still mint.
     */
    function premint(address to, uint256 quantity) external payable onlyOwner {
        _assertExactNativeTokensSupplied(quantity);
        _assertTotalSupplyNotBreached(quantity);
        _assertGameNotYetBegun();
        _mintERC2309(to, quantity);
    }

    /**
     * @inheritdoc IInfiltration
     */
    function mint(uint256 quantity) external payable nonReentrant {
        if (block.timestamp < mintStart || block.timestamp > mintEnd) {
            revert NotInMintPeriod();
        }

        _assertGameNotYetBegun();

        uint256 amountMinted = amountMintedPerAddress[msg.sender] + quantity;
        if (amountMinted > MAX_MINT_PER_ADDRESS) {
            revert TooManyMinted();
        }

        _assertExactNativeTokensSupplied(quantity);
        _assertTotalSupplyNotBreached(quantity);

        amountMintedPerAddress[msg.sender] = amountMinted;
        _mintERC2309(msg.sender, quantity);
    }

    /**
     * @inheritdoc IInfiltration
     * @dev If Chainlink randomness callback does not come back after 1 day, we can call
     *      startNewRound to trigger a new randomness request.
     */
    function startGame() external onlyOwner {
        uint256 numberOfAgents = totalSupply();
        if (numberOfAgents < MAX_SUPPLY) {
            if (block.timestamp < mintEnd) {
                revert StillMinting();
            }
        }
        if (numberOfAgents < NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {
            revert NotEnoughMinted();
        }

        _assertGameNotYetBegun();

        gameInfo.currentRoundId = 1;
        gameInfo.activeAgents = uint16(numberOfAgents);
        uint256 balance = address(this).balance;
        uint256 protocolFee = balance.unsafeMultiply(protocolFeeBp).unsafeDivide(ONE_HUNDRED_PERCENT_IN_BASIS_POINTS);
        unchecked {
            gameInfo.prizePool = balance - protocolFee;
        }

        emit RoundStarted(1);

        _transferETHAndWrapIfFailWithGasLimit(WETH, protocolFeeRecipient, protocolFee, gasleft());
        _requestForRandomness();
    }

    /**
     * @inheritdoc IInfiltration
     */
    function emergencyWithdraw() external onlyOwner {
        uint256 activeAgents;
        uint256 woundedAgents;
        uint256 healingAgents;
        uint256 escapedAgents;
        uint256 deadAgents;
        uint256 currentRoundId;
        uint256 currentRoundBlockNumber;

        assembly {
            let gameInfoSlot0Value := sload(gameInfo.slot)
            activeAgents := and(gameInfoSlot0Value, TWO_BYTES_BITMASK)
            woundedAgents := and(shr(GAME_INFO__WOUNDED_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK)
            healingAgents := and(shr(GAME_INFO__HEALING_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK)
            escapedAgents := and(shr(GAME_INFO__ESCAPED_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK)
            deadAgents := and(shr(GAME_INFO__DEAD_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK)
            currentRoundId := and(shr(GAME_INFO__CURRENT_ROUND_ID_OFFSET, gameInfoSlot0Value), FIVE_BYTES_BITMASK)
            currentRoundBlockNumber := and(
                shr(GAME_INFO__CURRENT_ROUND_BLOCK_NUMBER_OFFSET, gameInfoSlot0Value),
                FIVE_BYTES_BITMASK
            )
        }

        bool conditionOne = currentRoundId != 0 &&
            activeAgents + woundedAgents + healingAgents + escapedAgents + deadAgents != totalSupply();

        // 50 blocks per round * 216 = 10,800 blocks which is roughly 36 hours
        // Prefer not to hard code this number as BLOCKS_PER_ROUND is not always 50
        bool conditionTwo = currentRoundId != 0 &&
            activeAgents > 1 &&
            block.number > currentRoundBlockNumber + BLOCKS_PER_ROUND * 216;

        // Just in case startGame reverts, we can withdraw the ETH balance and redistribute to addresses that participated in the mint.
        bool conditionThree = currentRoundId == 0 && block.timestamp > uint256(mintEnd).unsafeAdd(36 hours);

        if (conditionOne || conditionTwo || conditionThree) {
            uint256 ethBalance = address(this).balance;
            _transferETHAndWrapIfFailWithGasLimit(WETH, msg.sender, ethBalance, gasleft());

            uint256 looksBalance = IERC20(LOOKS).balanceOf(address(this));
            _executeERC20DirectTransfer(LOOKS, msg.sender, looksBalance);

            emit EmergencyWithdrawal(ethBalance, looksBalance);
        }
    }

    /**
     * @inheritdoc IInfiltration
     * @dev If Chainlink randomness callback does not come back after 1 day, we can try by calling
     *      startNewRound again.
     */
    function startNewRound() external nonReentrant {
        uint256 currentRoundId = gameInfo.currentRoundId;
        if (currentRoundId == 0) {
            revert GameNotYetBegun();
        }

        if (block.number < uint256(gameInfo.currentRoundBlockNumber).unsafeAdd(BLOCKS_PER_ROUND)) {
            revert TooEarlyToStartNewRound();
        }

        if (block.timestamp < uint256(gameInfo.randomnessLastRequestedAt).unsafeAdd(1 days)) {
            revert TooEarlyToRetryRandomnessRequest();
        }

        uint256 agentsRemaining = agentsAlive();
        uint256 activeAgents = gameInfo.activeAgents;
        if (agentsRemaining == 1) {
            if (activeAgents == 1) {
                revert GameOver();
            }
        }

        if (activeAgents <= NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {
            uint256 woundedAgents = gameInfo.woundedAgents;

            if (woundedAgents != 0) {
                uint256 killRoundId = currentRoundId > ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD
                    ? currentRoundId.unsafeSubtract(ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD)
                    : 1;
                uint256 totalDeadAgentsFromKilling;
                while (woundedAgentIdsPerRound[killRoundId][0] != 0) {
                    uint256 deadAgentsFromKilling = _killWoundedAgents({
                        currentRoundId: currentRoundId,
                        roundId: killRoundId,
                        currentRoundAgentsAlive: agentsRemaining
                    });
                    unchecked {
                        totalDeadAgentsFromKilling += deadAgentsFromKilling;
                        agentsRemaining -= deadAgentsFromKilling;
                        ++killRoundId;
                    }
                }

                // This is equivalent to
                // unchecked {
                //     gameInfo.deadAgents += uint16(totalDeadAgentsFromKilling);
                // }
                // gameInfo.woundedAgents = 0;
                assembly {
                    let gameInfoSlot0Value := sload(gameInfo.slot)
                    let deadAgents := and(shr(GAME_INFO__DEAD_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK)

                    gameInfoSlot0Value := and(
                        gameInfoSlot0Value,
                        // This is equivalent to
                        // not(
                        //     or(
                        //         shl(GAME_INFO__WOUNDED_AGENTS_OFFSET, TWO_BYTES_BITMASK),
                        //         shl(GAME_INFO__DEAD_AGENTS_OFFSET, TWO_BYTES_BITMASK)
                        //     )
                        // )
                        0xffffffffffffffffffffffffffffffffffffffffffffffff0000ffff0000ffff
                    )

                    gameInfoSlot0Value := or(
                        gameInfoSlot0Value,
                        shl(GAME_INFO__DEAD_AGENTS_OFFSET, add(deadAgents, totalDeadAgentsFromKilling))
                    )

                    sstore(gameInfo.slot, gameInfoSlot0Value)
                }
            }

            if (agentsRemaining > 1) {
                _requestForRandomness();
            } else {
                _emitWonEventIfOnlyOneAgentRemaining(agentsRemaining, activeAgents);
            }
        } else {
            _requestForRandomness();
        }
    }

    /**
     * @inheritdoc IInfiltration
     */
    function claimGrandPrize() external nonReentrant {
        _assertGameOver();
        uint256 agentId = _agentIndexToId(agents[1], 1);
        _assertAgentOwnership(agentId);

        uint256 prizePool = gameInfo.prizePool;

        if (prizePool == 0) {
            revert NothingToClaim();
        }

        gameInfo.prizePool = 0;

        _transferETHAndWrapIfFailWithGasLimit(WETH, msg.sender, prizePool, gasleft());

        emit PrizeClaimed(agentId, address(0), prizePool);
    }

    /**
     * @inheritdoc IInfiltration
     */
    function claimSecondaryPrizes(uint256 agentId) external nonReentrant {
        _assertGameOver();
        _assertAgentOwnership(agentId);

        uint256 placement = agentIndex(agentId);
        _assertValidPlacement(placement);

        uint56 _prizesClaimedBitmap = prizesClaimedBitmap;
        if ((_prizesClaimedBitmap >> placement) & 1 != 0) {
            revert NothingToClaim();
        }

        prizesClaimedBitmap = _prizesClaimedBitmap | uint56(1 << placement);

        uint256 ethAmount = secondaryPrizePoolShareAmount(gameInfo.secondaryPrizePool, placement);
        if (ethAmount != 0) {
            _transferETHAndWrapIfFailWithGasLimit(WETH, msg.sender, ethAmount, gasleft());
            emit PrizeClaimed(agentId, address(0), ethAmount);
        }

        uint256 secondaryLooksPrizePool = gameInfo.secondaryLooksPrizePool;
        if (secondaryLooksPrizePool == 0) {
            secondaryLooksPrizePool = IERC20(LOOKS).balanceOf(address(this));
            if (secondaryLooksPrizePool == 0) {
                return;
            }
            gameInfo.secondaryLooksPrizePool = secondaryLooksPrizePool;
        }

        uint256 looksAmount = secondaryPrizePoolShareAmount(secondaryLooksPrizePool, placement);
        if (looksAmount != 0) {
            _executeERC20DirectTransfer(LOOKS, msg.sender, looksAmount);
            emit PrizeClaimed(agentId, LOOKS, looksAmount);
        }
    }

    /**
     * @inheritdoc IInfiltration
     */
    function escape(uint256[] calldata agentIds) external nonReentrant {
        _assertFrontrunLockIsOff();

        uint256 agentIdsCount = agentIds.length;
        _assertNotEmptyAgentIdsArrayProvided(agentIdsCount);

        uint256 activeAgents = gameInfo.activeAgents;
        uint256 activeAgentsAfterEscape = activeAgents - agentIdsCount;
        _assertGameIsNotOverAfterEscape(activeAgentsAfterEscape);

        uint256 currentRoundAgentsAlive = agentsAlive();

        uint256 prizePool = gameInfo.prizePool;
        uint256 secondaryPrizePool = gameInfo.secondaryPrizePool;
        uint256 reward;
        uint256[] memory rewards = new uint256[](agentIdsCount);

        for (uint256 i; i < agentIdsCount; ) {
            uint256 agentId = agentIds[i];
            _assertAgentOwnership(agentId);

            uint256 index = agentIndex(agentId);
            _assertAgentStatus(agents[index], agentId, AgentStatus.Active);

            uint256 totalEscapeValue = prizePool / currentRoundAgentsAlive;
            uint256 rewardForPlayer = (totalEscapeValue * _escapeMultiplier(currentRoundAgentsAlive)) /
                ONE_HUNDRED_PERCENT_IN_BASIS_POINTS;
            rewards[i] = rewardForPlayer;
            reward += rewardForPlayer;

            uint256 rewardToSecondaryPrizePool = (totalEscapeValue.unsafeSubtract(rewardForPlayer) *
                _escapeRewardSplitForSecondaryPrizePool(currentRoundAgentsAlive)) / ONE_HUNDRED_PERCENT_IN_BASIS_POINTS;

            unchecked {
                prizePool = prizePool - rewardForPlayer - rewardToSecondaryPrizePool;
            }
            secondaryPrizePool += rewardToSecondaryPrizePool;

            _swap({
                currentAgentIndex: index,
                lastAgentIndex: currentRoundAgentsAlive,
                agentId: agentId,
                newStatus: AgentStatus.Escaped
            });

            unchecked {
                --currentRoundAgentsAlive;
                ++i;
            }
        }

        // This is equivalent to
        // unchecked {
        //     gameInfo.activeAgents = uint16(activeAgentsAfterEscape);
        //     gameInfo.escapedAgents += uint16(agentIdsCount);
        // }
        assembly {
            let gameInfoSlot0Value := sload(gameInfo.slot)
            let escapedAgents := add(
                and(shr(GAME_INFO__ESCAPED_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK),
                agentIdsCount
            )

            gameInfoSlot0Value := and(
                gameInfoSlot0Value,
                // This is the equivalent of not(or(TWO_BYTES_BITMASK, shl(GAME_INFO__ESCAPED_AGENTS_OFFSET, TWO_BYTES_BITMASK)))
                0xffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff0000
            )
            gameInfoSlot0Value := or(gameInfoSlot0Value, activeAgentsAfterEscape)
            gameInfoSlot0Value := or(gameInfoSlot0Value, shl(GAME_INFO__ESCAPED_AGENTS_OFFSET, escapedAgents))
            sstore(gameInfo.slot, gameInfoSlot0Value)
        }

        gameInfo.prizePool = prizePool;
        gameInfo.secondaryPrizePool = secondaryPrizePool;

        _transferETHAndWrapIfFailWithGasLimit(WETH, msg.sender, reward, gasleft());
        emit Escaped(gameInfo.currentRoundId, agentIds, rewards);

        _emitWonEventIfOnlyOneAgentRemaining(currentRoundAgentsAlive, activeAgentsAfterEscape);
    }

    /**
     * @inheritdoc IInfiltration
     */
    function heal(uint256[] calldata agentIds) external nonReentrant {
        _assertFrontrunLockIsOff();

        if (gameInfo.activeAgents <= NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {
            revert HealingDisabled();
        }

        uint256 agentIdsCount = agentIds.length;
        _assertNotEmptyAgentIdsArrayProvided(agentIdsCount);

        uint256 currentRoundId = gameInfo.currentRoundId;
        uint16[MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH]
            storage healingAgentIds = healingAgentIdsPerRound[currentRoundId];
        uint256 currentHealingAgentIdsCount = healingAgentIds[0];

        uint256 newHealingAgentIdsCount = currentHealingAgentIdsCount.unsafeAdd(agentIdsCount);

        if (newHealingAgentIdsCount > MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND) {
            revert MaximumHealingRequestPerRoundExceeded();
        }

        uint256 cost;
        uint256[] memory costs = new uint256[](agentIdsCount);

        for (uint256 i; i < agentIdsCount; ) {
            uint256 agentId = agentIds[i];

            uint256 index = agentIndex(agentId);
            _assertAgentStatus(agents[index], agentId, AgentStatus.Wounded);

            bytes32 agentSlot = _getAgentStorageSlot(index);
            uint256 agentSlotValue;
            uint256 woundedAt;

            // This is equivalent to
            // uint256 woundedAt = agent.woundedAt;
            assembly {
                agentSlotValue := sload(agentSlot)
                woundedAt := and(shr(AGENT__WOUNDED_AT_OFFSET, agentSlotValue), FIVE_BYTES_BITMASK)
            }

            // This is equivalent to
            // healCount = agent.healCount;
            // agent.status = AgentStatus.Healing;
            uint256 healCount;
            assembly {
                healCount := and(shr(AGENT__HEAL_COUNT_OFFSET, agentSlotValue), TWO_BYTES_BITMASK)

                agentSlotValue := and(
                    agentSlotValue,
                    // This is the equivalent of not(shl(AGENT__STATUS_OFFSET, 0xff))
                    0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff
                )
                agentSlotValue := or(
                    agentSlotValue,
                    // AgentStatus.Healing is 2
                    // This is equivalent to shl(AGENT__STATUS_OFFSET, 2)
                    0x20000
                )
                sstore(agentSlot, agentSlotValue)
            }

            costs[i] = _costToHeal(healCount);
            cost += costs[i];

            unchecked {
                ++i;
                healingAgentIds[currentHealingAgentIdsCount + i] = uint16(agentId);
            }
        }

        healingAgentIds[0] = uint16(newHealingAgentIdsCount);

        // This is equivalent to
        // unchecked {
        //     gameInfo.healingAgents += uint16(agentIdsCount);
        //     gameInfo.woundedAgents -= uint16(agentIdsCount);
        // }
        assembly {
            let gameInfoSlot0Value := sload(gameInfo.slot)
            let healingAgents := add(
                and(shr(GAME_INFO__HEALING_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK),
                agentIdsCount
            )
            let woundedAgents := sub(
                and(shr(GAME_INFO__WOUNDED_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK),
                agentIdsCount
            )

            gameInfoSlot0Value := and(
                gameInfoSlot0Value,
                // This is equivalent to
                // not(
                //     or(
                //         shl(GAME_INFO__HEALING_AGENTS_OFFSET, TWO_BYTES_BITMASK),
                //         shl(GAME_INFO__WOUNDED_AGENTS_OFFSET, TWO_BYTES_BITMASK)
                //     )
                // )
                0xffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff
            )
            gameInfoSlot0Value := or(gameInfoSlot0Value, shl(GAME_INFO__HEALING_AGENTS_OFFSET, healingAgents))
            gameInfoSlot0Value := or(gameInfoSlot0Value, shl(GAME_INFO__WOUNDED_AGENTS_OFFSET, woundedAgents))
            sstore(gameInfo.slot, gameInfoSlot0Value)
        }

        TRANSFER_MANAGER.transferERC20(LOOKS, msg.sender, address(this), cost);
        _executeERC20DirectTransfer(LOOKS, 0x000000000000000000000000000000000000dEaD, cost / 4);

        emit HealRequestSubmitted(currentRoundId, agentIds, costs);
    }

    /**
     * @notice Only active and wounded agents are allowed to be transferred or traded.
     * @param from The current owner of the token.
     * @param to The new owner of the token.
     * @param tokenId The token ID.
     */
    function transferFrom(address from, address to, uint256 tokenId) public payable override {
        AgentStatus status = agents[agentIndex(tokenId)].status;
        if (status > AgentStatus.Wounded) {
            revert InvalidAgentStatus(tokenId, status);
        }
        super.transferFrom(from, to, tokenId);
    }

    /**
     * @inheritdoc IInfiltration
     */
    function getAgent(uint256 index) external view returns (Agent memory agent) {
        agent = agents[index];
        agent.agentId = uint16(_agentIndexToId(agents[index], index));
    }

    /**
     * @inheritdoc IInfiltration
     * @dev Unlike the actual heal function, this function does not revert if duplicated agent IDs are provided.
     */
    function costToHeal(uint256[] calldata agentIds) external view returns (uint256 cost) {
        uint256 agentIdsCount = agentIds.length;

        for (uint256 i; i < agentIdsCount; ) {
            uint256 agentId = agentIds[i];
            Agent storage agent = agents[agentIndex(agentId)];
            _assertAgentStatus(agent, agentId, AgentStatus.Wounded);

            cost += _costToHeal(agent.healCount);

            unchecked {
                ++i;
            }
        }
    }

    /**
     * @inheritdoc IInfiltration
     * @dev Unlike the actual escape function, this function does not revert if duplicated agent IDs are provided.
     */
    function escapeReward(uint256[] calldata agentIds) external view returns (uint256 reward) {
        uint256 agentIdsCount = agentIds.length;
        _assertGameIsNotOverAfterEscape(gameInfo.activeAgents - agentIdsCount);

        uint256 currentRoundAgentsAlive = agentsAlive();

        uint256 prizePool = gameInfo.prizePool;
        uint256 secondaryPrizePool = gameInfo.secondaryPrizePool;

        for (uint256 i; i < agentIdsCount; ) {
            uint256 agentId = agentIds[i];

            uint256 index = agentIndex(agentId);
            _assertAgentStatus(agents[index], agentId, AgentStatus.Active);

            uint256 totalEscapeValue = prizePool / currentRoundAgentsAlive;
            uint256 rewardForPlayer = (totalEscapeValue * _escapeMultiplier(currentRoundAgentsAlive)) /
                ONE_HUNDRED_PERCENT_IN_BASIS_POINTS;
            reward += rewardForPlayer;

            uint256 rewardToSecondaryPrizePool = (totalEscapeValue.unsafeSubtract(rewardForPlayer) *
                _escapeRewardSplitForSecondaryPrizePool(currentRoundAgentsAlive)) / ONE_HUNDRED_PERCENT_IN_BASIS_POINTS;

            secondaryPrizePool += rewardToSecondaryPrizePool;

            unchecked {
                prizePool = prizePool - rewardForPlayer - rewardToSecondaryPrizePool;
                --currentRoundAgentsAlive;
                ++i;
            }
        }
    }

    /**
     * @notice
     *
     * Variables:
     * Attempted_Heal_Round - the round at which a user attempts to heal - this is x
     * Heal_Rounds_Maximum - the maximum number of rounds after a user is wounded in which they can heal (ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD) - this is x2
     * Heal_Rounds_Minimum - the minimum number of rounds after a user is wounded until they can heal (a user cannot heal the same round as wound, so we select one round after wound hence 1) - this is x1
     * Maximum_Heal_Percentage - the maximum % chance a user can heal for, this will be if they heal in Heal_Rounds_Minimum (we have set this to 99% of a successful healing) - this is y1
     * Minimum_Heal_Percentage - the minimum % chance a user can heal for, this will be if they heal in Heal_Rounds_Maximum (we have set this to 80% of a successful healing) - this is y2
     *
     * Equation:

     * If you substitute all of these into the following equation:
     * y = (( x * (y2-y1)) / (x2-x1)) + ((x2 * y1 - x1 * y2) / (x2 - x1))

     * You will get an equation for y which is the PercentageChanceToHealSuccessfully given an Attempted_Heal_Round number.

     * Explanation:
     * i.e if a user is wounded in round 2, and they try to heal in round 4, their Attempted_Heal_Round relative to themselves is 2, hence by subsituting 2 into the place of x in the above equation, their PercentageChanceToHealSuccessfully will be 98.59574468%.
     *
     * @param healingRoundsDelay The number of rounds elapsed since the agent was wounded.
     */
    function healProbability(uint256 healingRoundsDelay) public view returns (uint256 y) {
        if (healingRoundsDelay == 0 || healingRoundsDelay > ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD) {
            revert InvalidHealingRoundsDelay();
        }

        y =
            HEAL_PROBABILITY_MINUEND -
            ((healingRoundsDelay * 19) * PROBABILITY_PRECISION) /
            ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD_MINUS_ONE;
    }

    /**
     * @notice The formula is 80 - 50 * PercentageOfAgentsRemaining ** 2.
     */
    function escapeMultiplier() public view returns (uint256 multiplier) {
        multiplier = _escapeMultiplier(agentsAlive());
    }

    /**
     * @notice The formula is the lesser of (9,980 / 99) - (UsersRemaining / TotalUsers) * (8,000 / 99) and 100.
     */
    function escapeRewardSplitForSecondaryPrizePool() public view returns (uint256 split) {
        split = _escapeRewardSplitForSecondaryPrizePool(agentsAlive());
    }

    /**
     * @notice An agent's secondary prize pool share amount. The formula is 1.31487 * 995 / (placement * 49) - 15 / 49.
     * @param secondaryPrizePoolAmount The secondary prize pool amount.
     * @param placement The agent's rank in the leaderboard. This is not meant to be called with placement that is not between 1 and NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS.
     */
    function secondaryPrizePoolShareAmount(
        uint256 secondaryPrizePoolAmount,
        uint256 placement
    ) public pure returns (uint256 shareAmount) {
        shareAmount =
            (secondaryPrizePoolAmount * secondaryPrizePoolShareBp(placement)) /
            ONE_HUNDRED_PERCENT_IN_BASIS_POINTS;
    }

    /**
     * @notice An agent's secondary prize pool share in basis points. The formula is 1.31817 * 995 / (placement * 49) - 15 / 49.
     * @param placement The agent's rank in the leaderboard. This is not meant to be called with placement that is not between 1 and NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS.
     */
    function secondaryPrizePoolShareBp(uint256 placement) public pure returns (uint256 share) {
        share = (1_31817 * (995_000_000 / (placement * 49) - uint256(15_000_000) / 49)) / 1_000_000_000;
    }

    /**
     * @inheritdoc IInfiltration
     */
    function agentsAlive() public view returns (uint256) {
        return totalSupply() - gameInfo.deadAgents - gameInfo.escapedAgents;
    }

    /**
     * @inheritdoc IInfiltration
     */
    function agentIndex(uint256 agentId) public view returns (uint256 index) {
        index = agentIdToIndex[agentId];
        if (index == 0) {
            index = agentId;
        }
    }

    /**
     * @inheritdoc IInfiltration
     */
    function getRoundInfo(
        uint256 roundId
    ) external view returns (uint256[] memory woundedAgentIds, uint256[] memory healingAgentIds) {
        woundedAgentIds = _buildAgentIdsPerRoundArray(woundedAgentIdsPerRound[roundId]);
        healingAgentIds = _buildAgentIdsPerRoundArray(healingAgentIdsPerRound[roundId]);
    }

    /**
     * @param requestId The VRF request ID.
     * @param randomWords The random words returned from Chainlink. We only request 1 random word.
     */
    function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
        RandomnessRequest storage randomnessRequest = randomnessRequests[requestId];

        uint256 currentRoundId = gameInfo.currentRoundId;
        uint256 randomnessRequestRoundId = randomnessRequest.roundId;
        if (
            randomnessRequestRoundId != currentRoundId || randomnessRequest.status != RandomnessRequestStatus.Requested
        ) {
            emit InvalidRandomnessFulfillment(requestId, randomnessRequestRoundId, currentRoundId);
            return;
        }

        randomnessRequest.randomWord = randomWords[0];
        randomnessRequest.status = RandomnessRequestStatus.Fulfilled;

        emit RandomnessFulfilled(randomnessRequest.roundId, requestId);
    }

    /**
     * @inheritdoc IInfiltration
     */
    function closeRound(uint256 requestId) external {
        uint256 currentRoundId = gameInfo.currentRoundId;
        RandomnessRequest storage randomnessRequest = randomnessRequests[requestId];
        if (
            randomnessRequest.roundId != currentRoundId || randomnessRequest.status != RandomnessRequestStatus.Fulfilled
        ) {
            revert InvalidRandomnessRequestId();
        }

        uint256 currentRandomWord = randomnessRequest.randomWord;

        uint256 currentRoundAgentsAlive = agentsAlive();
        uint256 activeAgents = gameInfo.activeAgents;
        uint256 healingAgents = gameInfo.healingAgents;

        uint256 deadAgentsFromHealing;

        if (healingAgents != 0) {
            uint256 healedAgents;
            (healedAgents, deadAgentsFromHealing, currentRandomWord) = _healRequestFulfilled(
                currentRoundId,
                currentRoundAgentsAlive,
                currentRandomWord
            );
            unchecked {
                currentRoundAgentsAlive -= deadAgentsFromHealing;
                activeAgents += healedAgents;
                gameInfo.healingAgents = uint16(healingAgents - healedAgents - deadAgentsFromHealing);
            }
        }

        if (activeAgents > NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {
            uint256 woundedAgents = _woundRequestFulfilled(
                currentRoundId,
                currentRoundAgentsAlive,
                activeAgents,
                currentRandomWord
            );

            uint256 deadAgentsFromKilling;
            if (currentRoundId > ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD) {
                deadAgentsFromKilling = _killWoundedAgents({
                    currentRoundId: currentRoundId,
                    roundId: currentRoundId.unsafeSubtract(ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD),
                    currentRoundAgentsAlive: currentRoundAgentsAlive
                });
            }

            // We only need to deduct wounded agents from active agents, dead agents from killing are already inactive.

            // This is equivalent to
            // unchecked {
            //     gameInfo.activeAgents = activeAgents - woundedAgents;
            //     gameInfo.woundedAgents = gameInfo.woundedAgents + woundedAgents - deadAgentsFromKilling;
            //     gameInfo.deadAgents += (deadAgentsFromHealing + deadAgentsFromKilling);
            // }
            // SSTORE is called in _incrementRound
            uint256 gameInfoSlot0Value;
            assembly {
                gameInfoSlot0Value := sload(gameInfo.slot)

                let currentWoundedAgents := and(
                    shr(GAME_INFO__WOUNDED_AGENTS_OFFSET, gameInfoSlot0Value),
                    TWO_BYTES_BITMASK
                )
                let currentDeadAgents := and(shr(GAME_INFO__DEAD_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK)

                gameInfoSlot0Value := and(
                    gameInfoSlot0Value,
                    // This is equivalent to
                    // not(
                    //     or(
                    //         TWO_BYTES_BITMASK,
                    //         or(
                    //             shl(GAME_INFO__WOUNDED_AGENTS_OFFSET, TWO_BYTES_BITMASK),
                    //             shl(GAME_INFO__DEAD_AGENTS_OFFSET, TWO_BYTES_BITMASK)
                    //         )
                    //     )
                    // )
                    0xffffffffffffffffffffffffffffffffffffffffffffffff0000ffff00000000
                )
                gameInfoSlot0Value := or(gameInfoSlot0Value, sub(activeAgents, woundedAgents))

                gameInfoSlot0Value := or(
                    gameInfoSlot0Value,
                    shl(
                        GAME_INFO__WOUNDED_AGENTS_OFFSET,
                        sub(add(currentWoundedAgents, woundedAgents), deadAgentsFromKilling)
                    )
                )

                gameInfoSlot0Value := or(
                    gameInfoSlot0Value,
                    shl(
                        GAME_INFO__DEAD_AGENTS_OFFSET,
                        add(currentDeadAgents, add(deadAgentsFromHealing, deadAgentsFromKilling))
                    )
                )
            }
            _incrementRound(currentRoundId, gameInfoSlot0Value);
        } else {
            bool shouldKillOneAgent = activeAgents > 1;
            if (shouldKillOneAgent) {
                uint256 killedAgentIndex = (currentRandomWord % activeAgents).unsafeAdd(1);
                Agent storage agentToKill = agents[killedAgentIndex];
                uint256 agentId = _agentIndexToId(agentToKill, killedAgentIndex);
                _swap({
                    currentAgentIndex: killedAgentIndex,
                    lastAgentIndex: currentRoundAgentsAlive,
                    agentId: agentId,
                    newStatus: AgentStatus.Dead
                });

                uint256[] memory killedAgentId = new uint256[](1);
                killedAgentId[0] = agentId;
                emit Killed(currentRoundId, killedAgentId);

                unchecked {
                    --activeAgents;
                    --currentRoundAgentsAlive;
                }
            }

            // This is equivalent to
            // unchecked {
            //     gameInfo.activeAgents = activeAgents;
            //     gameInfo.deadAgents = gameInfo.deadAgents + deadAgentsFromHealing + 1;
            // }
            // SSTORE is called in _incrementRound
            uint256 gameInfoSlot0Value;
            assembly {
                gameInfoSlot0Value := sload(gameInfo.slot)
                let deadAgents := and(shr(GAME_INFO__DEAD_AGENTS_OFFSET, gameInfoSlot0Value), TWO_BYTES_BITMASK)

                gameInfoSlot0Value := and(
                    gameInfoSlot0Value,
                    // This is equivalent to not(or(TWO_BYTES_BITMASK, shl(GAME_INFO__DEAD_AGENTS_OFFSET, TWO_BYTES_BITMASK)))
                    0xffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff0000
                )
                gameInfoSlot0Value := or(gameInfoSlot0Value, activeAgents)
                // If shouldKillOneAgent is true, then add 1. If false, then add 0.
                gameInfoSlot0Value := or(
                    gameInfoSlot0Value,
                    shl(GAME_INFO__DEAD_AGENTS_OFFSET, add(add(deadAgents, deadAgentsFromHealing), shouldKillOneAgent))
                )
            }

            _emitWonEventIfOnlyOneAgentRemaining(currentRoundAgentsAlive, activeAgents);
            _incrementRound(currentRoundId, gameInfoSlot0Value);
        }

        frontrunLock = FRONTRUN_LOCK__UNLOCKED;

        unchecked {
            emit RoundStarted(currentRoundId + 1);
        }
    }

    /**
     * @dev This function doesn't check currentRoundId to be <= type(uint40).max but it's fine as
     *      it's practically impossible to reach this number of rounds.
     * @param currentRoundId The current round ID.
     * @param gameInfoSlot0Value The value of gameInfo.slot.
     */
    function _incrementRound(uint256 currentRoundId, uint256 gameInfoSlot0Value) private {
        // This is equivalent to
        // unchecked {
        //     uint256 newRoundId = currentRoundId + 1;
        //     gameInfo.currentRoundId = newRoundId;
        //     gameInfo.currentRoundBlockNumber = uint40(block.number);
        //     gameInfo.randomnessLastRequestedAt = 0;
        // }
        assembly {
            gameInfoSlot0Value := and(
                gameInfoSlot0Value,
                // This is equivalent to
                // let gameInfoRandomnessLastRequestedAtOffset := 160
                // not(
                //     or(
                //         or(
                //             shl(GAME_INFO__CURRENT_ROUND_ID_OFFSET, FIVE_BYTES_BITMASK),
                //             shl(GAME_INFO__CURRENT_ROUND_BLOCK_NUMBER_OFFSET, FIVE_BYTES_BITMASK)
                //         ),
                //         shl(gameInfoRandomnessLastRequestedAtOffset, FIVE_BYTES_BITMASK)
                //     )
                // )
                0xffffffffffffff000000000000000000000000000000ffffffffffffffffffff
            )
            gameInfoSlot0Value := or(
                gameInfoSlot0Value,
                shl(GAME_INFO__CURRENT_ROUND_ID_OFFSET, add(currentRoundId, 1))
            )
            gameInfoSlot0Value := or(gameInfoSlot0Value, shl(GAME_INFO__CURRENT_ROUND_BLOCK_NUMBER_OFFSET, number()))
            sstore(gameInfo.slot, gameInfoSlot0Value)
        }
    }

    /**
     * @dev This function requests for a random word from Chainlink VRF for wounding and healing.
     */
    function _requestForRandomness() private {
        uint256 requestId = VRF_COORDINATOR.requestRandomWords({
            keyHash: KEY_HASH,
            subId: SUBSCRIPTION_ID,
            minimumRequestConfirmations: uint16(3),
            callbackGasLimit: uint32(2_500_000),
            numWords: uint32(1)
        });

        if (randomnessRequests[requestId].status != RandomnessRequestStatus.None) {
            revert RandomnessRequestAlreadyExists();
        }

        uint40 currentRoundId = gameInfo.currentRoundId;

        gameInfo.randomnessLastRequestedAt = uint40(block.timestamp);

        // This is equivalent to
        // randomnessRequests[requestId].status = RandomnessRequestStatus.Requested;
        // randomnessRequests[requestId].roundId = currentRoundId;
        assembly {
            // 1 is RandomnessRequestStatus.Requested
            let randomnessRequest := or(1, shl(RANDOMNESS_REQUESTS__EXISTS_OFFSET, currentRoundId))
            mstore(0x00, requestId)
            mstore(0x20, randomnessRequests.slot)
            let randomnessRequestStoragSlot := keccak256(0x00, 0x40)
            sstore(randomnessRequestStoragSlot, randomnessRequest)
        }

        frontrunLock = FRONTRUN_LOCK__LOCKED;

        emit RandomnessRequested(currentRoundId, requestId);
    }

    /**
     * @param roundId The current round ID.
     * @param currentRoundAgentsAlive The number of agents alive currently.
     * @param randomWord The random word returned from Chainlink.
     * @return healedAgentsCount The number of agents that were healed.
     * @return deadAgentsCount The number of agents that were killed.
     * @return currentRandomWord The current random word after running the function.
     */
    function _healRequestFulfilled(
        uint256 roundId,
        uint256 currentRoundAgentsAlive,
        uint256 randomWord
    ) private returns (uint256 healedAgentsCount, uint256 deadAgentsCount, uint256 currentRandomWord) {
        uint16[MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH]
            storage healingAgentIds = healingAgentIdsPerRound[roundId];
        uint256 healingAgentIdsCount = healingAgentIds[0];

        if (healingAgentIdsCount != 0) {
            HealResult[] memory healResults = new HealResult[](healingAgentIdsCount);

            for (uint256 i; i < healingAgentIdsCount; ) {
                uint256 healingAgentId = healingAgentIds[i.unsafeAdd(1)];
                uint256 index = agentIndex(healingAgentId);
                Agent storage agent = agents[index];

                healResults[i].agentId = healingAgentId;

                // 1. An agent's "healing at" round ID is always equal to the current round ID
                //    as it immediately settles upon randomness fulfillment.
                //
                // 2. 10_000_000_000 == 100 * PROBABILITY_PRECISION
                if (randomWord % 10_000_000_000 <= healProbability(roundId.unsafeSubtract(agent.woundedAt))) {
                    // This line is not needed as HealOutcome.Healed is 0. It is here for clarity.
                    // healResults[i].outcome = HealOutcome.Healed;
                    _healAgent(agent);
                } else {
                    healResults[i].outcome = HealOutcome.Killed;
                    _swap({
                        currentAgentIndex: index,
                        lastAgentIndex: currentRoundAgentsAlive - deadAgentsCount,
                        agentId: healingAgentId,
                        newStatus: AgentStatus.Dead
                    });
                    unchecked {
                        ++deadAgentsCount;
                    }
                }

                randomWord = _nextRandomWord(randomWord);

                unchecked {
                    ++i;
                }
            }

            unchecked {
                healedAgentsCount = healingAgentIdsCount - deadAgentsCount;
            }

            emit HealRequestFulfilled(roundId, healResults);
        }

        currentRandomWord = randomWord;
    }

    /**
     * @param roundId The current round ID.
     * @param currentRoundAgentsAlive The number of agents alive currently.
     * @param activeAgents The number of currently active agents.
     * @param randomWord The random word returned from Chainlink.
     * @return woundedAgentsCount The number of agents that were wounded.
     */
    function _woundRequestFulfilled(
        uint256 roundId,
        uint256 currentRoundAgentsAlive,
        uint256 activeAgents,
        uint256 randomWord
    ) private returns (uint256 woundedAgentsCount) {
        woundedAgentsCount =
            (activeAgents * AGENTS_TO_WOUND_PER_ROUND_IN_BASIS_POINTS) /
            ONE_HUNDRED_PERCENT_IN_BASIS_POINTS;
        // At some point the number of agents to wound will be 0 due to round down, so we set it to 1.
        if (woundedAgentsCount == 0) {
            woundedAgentsCount = 1;
        }

        uint256[] memory woundedAgentIds = new uint256[](woundedAgentsCount);
        uint16[MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH]
            storage currentRoundWoundedAgentIds = woundedAgentIdsPerRound[roundId];

        for (uint256 i; i < woundedAgentsCount; ) {
            uint256 woundedAgentIndex = (randomWord % currentRoundAgentsAlive).unsafeAdd(1);
            Agent storage agentToWound = agents[woundedAgentIndex];

            if (agentToWound.status == AgentStatus.Active) {
                // This is equivalent to
                // agentToWound.status = AgentStatus.Wounded;
                // agentToWound.woundedAt = roundId;
                assembly {
                    let agentSlotValue := sload(agentToWound.slot)
                    agentSlotValue := and(
                        agentSlotValue,
                        // This is equivalent to
                        // or(
                        //     TWO_BYTES_BITMASK,
                        //     shl(64, TWO_BYTES_BITMASK)
                        // )
                        0x00000000000000000000000000000000000000000000ffff000000000000ffff
                    )
                    // AgentStatus.Wounded is 1
                    agentSlotValue := or(agentSlotValue, shl(AGENT__STATUS_OFFSET, 1))
                    agentSlotValue := or(agentSlotValue, shl(AGENT__WOUNDED_AT_OFFSET, roundId))
                    sstore(agentToWound.slot, agentSlotValue)
                }

                uint256 woundedAgentId = _agentIndexToId(agentToWound, woundedAgentIndex);
                woundedAgentIds[i] = woundedAgentId;

                unchecked {
                    ++i;
                    currentRoundWoundedAgentIds[i] = uint16(woundedAgentId);
                }
            }

            randomWord = _nextRandomWord(randomWord);
        }

        currentRoundWoundedAgentIds[0] = uint16(woundedAgentsCount);

        emit Wounded(roundId, woundedAgentIds);
    }

    /**
     * @dev This function emits the Killed event but some agent IDs in the array can be 0 because
     *      they might have been healed or are dead already.
     * @param currentRoundId The current round ID.
     * @param roundId The round ID in which the wounded agents should be killed.
     * @param currentRoundAgentsAlive The number of agents alive currently.
     * @return deadAgentsCount The number of agents that were killed.
     */
    function _killWoundedAgents(
        uint256 currentRoundId,
        uint256 roundId,
        uint256 currentRoundAgentsAlive
    ) private returns (uint256 deadAgentsCount) {
        uint16[MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH]
            storage woundedAgentIdsInRound = woundedAgentIdsPerRound[roundId];
        uint256 woundedAgentIdsCount = woundedAgentIdsInRound[0];
        uint256[] memory woundedAgentIds = new uint256[](woundedAgentIdsCount);
        for (uint256 i; i < woundedAgentIdsCount; ) {
            uint256 woundedAgentId = woundedAgentIdsInRound[i.unsafeAdd(1)];
            uint256 index = agentIndex(woundedAgentId);
            Agent storage agent = agents[index];
            if (agent.status == AgentStatus.Wounded) {
                if (agent.woundedAt == roundId) {
                    woundedAgentIds[i] = woundedAgentId;
                    _swap({
                        currentAgentIndex: index,
                        lastAgentIndex: currentRoundAgentsAlive - deadAgentsCount,
                        agentId: woundedAgentId,
                        newStatus: AgentStatus.Dead
                    });
                    unchecked {
                        ++deadAgentsCount;
                    }
                }
            }

            unchecked {
                ++i;
            }
        }

        emit Killed(currentRoundId, woundedAgentIds);
    }

    /**
     * @param agent The agent to check.
     * @param index The agent's index in the agents mapping.
     * @return agentId The agent's ID.
     */
    function _agentIndexToId(Agent storage agent, uint256 index) private view returns (uint256 agentId) {
        agentId = agent.agentId;
        agentId = agentId == 0 ? index : agentId;
    }

    /**
     * @param healCount The number of times the agent has been successfully healed.
     * @return cost The cost to heal the agent based on the agent's successful heal count.
     */
    function _costToHeal(uint256 healCount) private view returns (uint256 cost) {
        cost = HEAL_BASE_COST * (2 ** healCount);
    }

    /**
     * @param agent The agent to heal.
     */
    function _healAgent(Agent storage agent) private {
        // This is equivalent to
        // agent.status = AgentStatus.Active;
        // agent.woundedAt = 0;
        // lastHealCount = agent.healCount;
        // ++agent.healCount;
        assembly {
            let agentSlotValue := sload(agent.slot)
            let lastHealCount := and(shr(AGENT__HEAL_COUNT_OFFSET, agentSlotValue), TWO_BYTES_BITMASK)
            agentSlotValue := and(agentSlotValue, TWO_BYTES_BITMASK)
            agentSlotValue := or(agentSlotValue, shl(AGENT__HEAL_COUNT_OFFSET, add(lastHealCount, 1)))
            sstore(agent.slot, agentSlotValue)
        }
    }

    /**
     * @notice An agent is killed by swapping it with the last agent in the agents mapping and decrementing `agentsAlive`
     *         by adding 1 to `gameInfo.deadAgents`.
     * @notice An agent escapes by swapping it with the last agent in the agents mapping and decrementing `agentsAlive`
     *         by adding 1 to `gameInfo.escapedAgents`.
     * @param currentAgentIndex The agent (whose status is being updated)'s index in the agents mapping.
     * @param lastAgentIndex Last agent's index in the agents mapping.
     * @param agentId The agent (whose status is being updated) 's ID.
     * @param newStatus The new status of the agent.
     */
    function _swap(uint256 currentAgentIndex, uint256 lastAgentIndex, uint256 agentId, AgentStatus newStatus) private {
        Agent storage lastAgent = agents[lastAgentIndex];
        uint256 lastAgentId = _agentIndexToId(lastAgent, lastAgentIndex);

        agentIdToIndex[agentId] = lastAgentIndex;
        agentIdToIndex[lastAgentId] = currentAgentIndex;

        /**
         * If last agent's agent ID is 0 that means it was never touched and is active.
         *
         * This is equivalent to
         *
         * agent.agentId = uint16(lastAgentId);
         * agent.status = lastAgent.status;
         * agent.woundedAt = lastAgent.woundedAt;
         * agent.healCount = lastAgent.healCount;

         * lastAgent.agentId = uint16(agentId);
         * lastAgent.status = newStatus;
         * lastAgent.woundedAt = 0;
         * lastAgent.healCount = 0;
         */
        bytes32 currentAgentSlot = _getAgentStorageSlot(currentAgentIndex);
        bytes32 lastAgentSlot = _getAgentStorageSlot(lastAgentIndex);

        assembly {
            let lastAgentCurrentValue := sload(lastAgentSlot)
            // The last agent's ID is either 0 or lastAgentId, so we do not need to clear the last 16 bits
            // as it can only be or(0, lastAgentId) or or(lastAgentId, lastAgentId) which both ends up being lastAgentId.
            lastAgentCurrentValue := or(lastAgentCurrentValue, lastAgentId)
            sstore(currentAgentSlot, lastAgentCurrentValue)

            let lastAgentNewValue := agentId
            lastAgentNewValue := or(lastAgentNewValue, shl(AGENT__STATUS_OFFSET, newStatus))
            sstore(lastAgentSlot, lastAgentNewValue)
        }
    }

    /**
     * @notice Returns the next random word by hashing.
     * @param randomWord The current random word.
     * @return nextRandomWord The next random word.
     */
    function _nextRandomWord(uint256 randomWord) private pure returns (uint256 nextRandomWord) {
        // This is equivalent to
        // randomWord = uint256(keccak256(abi.encode(randomWord)));
        assembly {
            mstore(0x00, randomWord)
            nextRandomWord := keccak256(0x00, 0x20)
        }
    }

    /**
     * @param index The agent's index in the agents mapping.
     * @return agentStorageSlot The agent's storage slot.
     */
    function _getAgentStorageSlot(uint256 index) private pure returns (bytes32 agentStorageSlot) {
        assembly {
            mstore(0x00, index)
            mstore(0x20, agents.slot)
            agentStorageSlot := keccak256(0x00, 0x40)
        }
    }

    /**
     * @dev ONE_HUNDRED_PERCENT_IN_BASIS_POINTS is used as an amplifier to prevent a loss of precision.
     * @param agentsRemaining The number of agents remaining including wounded and healing agents.
     * @return multiplier The escape multiplier in basis points. This portion of the reward goes to the owner of the escaping agent.
     */
    function _escapeMultiplier(uint256 agentsRemaining) private view returns (uint256 multiplier) {
        multiplier =
            ((80 *
                ONE_HUNDRED_PERCENT_IN_BASIS_POINTS_SQUARED -
                50 *
                (((agentsRemaining * ONE_HUNDRED_PERCENT_IN_BASIS_POINTS) / totalSupply()) ** 2)) * 100) /
            ONE_HUNDRED_PERCENT_IN_BASIS_POINTS_SQUARED;
    }

    /**
     * @dev ONE_HUNDRED_PERCENT_IN_BASIS_POINTS is used as an amplifier to prevent a loss of precision.
     * @param agentsRemaining The number of agents remaining including wounded and healing agents.
     * @return split The split of the remaining escape reward between the the secondary prize pool and the main prize pool in basis points.
     */
    function _escapeRewardSplitForSecondaryPrizePool(uint256 agentsRemaining) private view returns (uint256 split) {
        split =
            ((9_980 * ONE_HUNDRED_PERCENT_IN_BASIS_POINTS) /
                99 -
                (((agentsRemaining * ONE_HUNDRED_PERCENT_IN_BASIS_POINTS) / totalSupply()) * uint256(8_000)) /
                99) /
            100;
        if (split > ONE_HUNDRED_PERCENT_IN_BASIS_POINTS) {
            split = ONE_HUNDRED_PERCENT_IN_BASIS_POINTS;
        }
    }

    /**
     * @dev Emit the Won event if there is only 1 active agent remaining in the game.
     * @param agentsRemaining The number of alive agents.
     * @param activeAgentsRemaining The number of active agents remaining.
     */
    function _emitWonEventIfOnlyOneAgentRemaining(uint256 agentsRemaining, uint256 activeAgentsRemaining) private {
        if (agentsRemaining == 1) {
            if (activeAgentsRemaining == 1) {
                emit Won(gameInfo.currentRoundId, _agentIndexToId(agents[1], 1));
            }
        }
    }

    /**
     * @notice Validate max supply is not breached after minting "quantity" amount of agents
     * @param quantity The quantity of agents to mint.
     */
    function _assertTotalSupplyNotBreached(uint256 quantity) private view {
        if (totalSupply() + quantity > MAX_SUPPLY) {
            revert ExceededTotalSupply();
        }
    }

    /**
     * @notice Validate the game has not begun.
     */
    function _assertGameNotYetBegun() private view {
        if (gameInfo.currentRoundId != 0) {
            revert GameAlreadyBegun();
        }
    }

    /**
     * @notice Validate exact ETH amount has been paid for the mint.
     * @param quantity The quantity of agents to mint.
     */
    function _assertExactNativeTokensSupplied(uint256 quantity) private view {
        if (quantity * PRICE != msg.value) {
            revert InexactNativeTokensSupplied();
        }
    }

    /**
     * @notice Validate the msg.sender is the owner of the agent ID.
     * @param agentId The agent ID to validate.
     */
    function _assertAgentOwnership(uint256 agentId) private view {
        if (ownerOf(agentId) != msg.sender) {
            revert NotAgentOwner();
        }
    }

    /**
     * @notice Validate the agent's status is the expected status.
     * @param agent The agent to validate.
     * @param agentId The agent's ID.
     * @param status The expected status.
     */
    function _assertAgentStatus(Agent storage agent, uint256 agentId, AgentStatus status) private view {
        if (agent.status != status) {
            revert InvalidAgentStatus(agentId, status);
        }
    }

    /**
     * @notice Validate the placement is between 1 and 50.
     * @param placement The placement to validate.
     */
    function _assertValidPlacement(uint256 placement) private pure {
        if (placement == 0 || placement > NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {
            revert InvalidPlacement();
        }
    }

    /**
     * @notice Validate the game is over by checking there is only 1 active agent and 0 wounded/healing agents.
     */
    function _assertGameOver() private view {
        if (gameInfo.activeAgents != 1 || gameInfo.woundedAgents != 0 || gameInfo.healingAgents != 0) {
            revert GameIsStillRunning();
        }
    }

    /**
     * @notice Validate the frontrun lock is off.
     */
    function _assertFrontrunLockIsOff() private view {
        if (frontrunLock == FRONTRUN_LOCK__LOCKED) {
            revert FrontrunLockIsOn();
        }
    }

    /**
     * @notice Validate the agent IDs array is not empty.
     */
    function _assertNotEmptyAgentIdsArrayProvided(uint256 agentIdsCount) private pure {
        if (agentIdsCount == 0) {
            revert NoAgentsProvided();
        }
    }

    /**
     * @notice Validate the game's active agents to be greater than 0 after escape.
     */
    function _assertGameIsNotOverAfterEscape(uint256 activeAgentsAfterEscape) private pure {
        if (activeAgentsAfterEscape < 1) {
            revert NoAgentsLeft();
        }
    }

    /**
     * @notice The starting token ID is 1.
     */
    function _startTokenId() internal pure override returns (uint256) {
        return 1;
    }

    /**
     * @notice The base URI of the collection.
     */
    function _baseURI() internal view override returns (string memory) {
        return baseURI;
    }

    /**
     * @param agentIdsPerRound The storage pointer to either a round's woundedAgentIdsPerRound or healingAgentIdsPerRound.
     * @return agentIds The agent IDs (now dynamically sized) in the round with the length removed.
     */
    function _buildAgentIdsPerRoundArray(
        uint16[MAXIMUM_HEALING_OR_WOUNDED_AGENTS_PER_ROUND_AND_LENGTH] storage agentIdsPerRound
    ) private view returns (uint256[] memory agentIds) {
        uint256 count = agentIdsPerRound[0];
        agentIds = new uint256[](count);
        for (uint256 i; i < count; ) {
            unchecked {
                agentIds[i] = agentIdsPerRound[i + 1];
                ++i;
            }
        }
    }
}

File 2 of 20 : IInfiltration.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IInfiltration {
    /**
     * @notice Agent statuses.
     *         1. Active: The agent is active.
     *         2. Wounded: The agent is wounded. The agent can be healed for a number of blocks.
     *         3. Healing: The agent is healing. The outcome of the healing is not yet known.
     *         4. Escaped: The agent escaped from the game and took some rewards with him.
     *         5. Dead: The agent is dead. It can be due to the agent being wounded for too long or a failed healing.
     */
    enum AgentStatus {
        Active,
        Wounded,
        Healing,
        Escaped,
        Dead
    }

    /**
     * @notice Heal outcomes. The agent can either be healed or killed.
     */
    enum HealOutcome {
        Healed,
        Killed
    }

    /**
     * @notice Randomness request statuses.
     */
    enum RandomnessRequestStatus {
        None,
        Requested,
        Fulfilled
    }

    /**
     * @notice An agent.
     * @dev The storage layout of an agent is as follows:
     * |---------------------------------------------------------------------------------------------------|
     * | empty (176 bits) | healCount (16 bits) | woundedAt (40 bits) | status (8 bits) | agentId (16 bits)|
     * |---------------------------------------------------------------------------------------------------|
     * @param agentId The ID of the agent.
     * @param status The status of the agent.
     * @param woundedAt The round number when the agent was wounded.
     * @param healCount The number of times the agent has been successfully healed.
     */
    struct Agent {
        uint16 agentId;
        AgentStatus status;
        uint40 woundedAt;
        uint16 healCount;
    }

    /**
     * @notice The constructor calldata.
     * @param owner The owner of the contract.
     * @param name The name of the collection.
     * @param symbol The symbol of the collection.
     * @param price The mint price.
     * @param maxSupply The maximum supply of the collection.
     * @param maxMintPerAddress The maximum number of agents that can be minted per address.
     * @param blocksPerRound The number of blocks per round.
     * @param agentsToWoundPerRoundInBasisPoints The number of agents to wound per round in basis points.
     * @param roundsToBeWoundedBeforeDead The number of rounds for an agent to be wounded before getting killed.
     * @param looks The LOOKS token address.
     * @param vrfCoordinator The VRF coordinator address.
     * @param keyHash The VRF key hash.
     * @param subscriptionId The VRF subscription ID.
     * @param transferManager The transfer manager address.
     * @param healBaseCost The base cost to heal an agent.
     * @param protocolFeeRecipient The protocol fee recipient.
     * @param protocolFeeBp The protocol fee basis points.
     * @param weth The WETH address.
     * @param baseURI The base URI of the collection.
     */
    struct ConstructorCalldata {
        address owner;
        string name;
        string symbol;
        uint256 price;
        uint256 maxSupply;
        uint256 maxMintPerAddress;
        uint256 blocksPerRound;
        uint256 agentsToWoundPerRoundInBasisPoints;
        uint256 roundsToBeWoundedBeforeDead;
        address looks;
        address vrfCoordinator;
        bytes32 keyHash;
        uint64 subscriptionId;
        address transferManager;
        uint256 healBaseCost;
        address protocolFeeRecipient;
        uint16 protocolFeeBp;
        address weth;
        string baseURI;
    }

    /**
     * @notice Game info.
     * @dev The storage layout of game info is as follows:
     * |-------------------------------------------------------------------------------------------------------------------------------|
     * | empty (56 bits) | randomnessLastRequestedAt (40 bits) | currentRoundBlockNumber (40 bits) | currentRoundId (40 bits)          |
     * | escapedAgents (16 bits) | deadAgents (16 bits) | healingAgents (16 bits) | woundedAgents (16 bits) | activeAgents (16 bits)   |
     * |-------------------------------------------------------------------------------------------------------------------------------|
     * | prizePool (256 bits)                                                                                                          |
     * |-------------------------------------------------------------------------------------------------------------------------------|
     * | secondaryPrizePool (256 bits)                                                                                                 |
     * |-------------------------------------------------------------------------------------------------------------------------------|
     * | secondaryLooksPrizePool (256 bits)                                                                                            |
     * |-------------------------------------------------------------------------------------------------------------------------------|
     * @param activeAgents The number of active agents.
     * @param woundedAgents The number of wounded agents.
     * @param healingAgents The number of healing agents.
     * @param deadAgents The number of dead agents.
     * @param escapedAgents The number of escaped agents.
     * @param currentRoundId The current round ID.
     * @param currentRoundBlockNumber The current round block number.
     * @param randomnessLastRequestedAt The timestamp when the randomness was last requested.
     * @param prizePool The ETH prize pool for the final winner.
     * @param secondaryPrizePool The secondary ETH prize pool for the top X winners.
     * @param secondaryLooksPrizePool The secondary LOOKS prize pool for the top X winners.
     */
    struct GameInfo {
        uint16 activeAgents;
        uint16 woundedAgents;
        uint16 healingAgents;
        uint16 deadAgents;
        uint16 escapedAgents;
        uint40 currentRoundId;
        uint40 currentRoundBlockNumber;
        uint40 randomnessLastRequestedAt;
        uint256 prizePool;
        uint256 secondaryPrizePool;
        uint256 secondaryLooksPrizePool;
    }

    /**
     * @notice A Chainlink randomness request.
     * @param status The status of the randomness request.
     * @param roundId The round ID when the randomness request occurred.
     * @param randomWord The returned random word.
     */
    struct RandomnessRequest {
        RandomnessRequestStatus status;
        uint40 roundId;
        uint256 randomWord;
    }

    /**
     * @notice A heal result that is used to emit events.
     * @param agentId The agent ID.
     * @param outcome The outcome of the healing.
     */
    struct HealResult {
        uint256 agentId;
        HealOutcome outcome;
    }

    event EmergencyWithdrawal(uint256 ethAmount, uint256 looksAmount);
    event MintPeriodUpdated(uint256 mintStart, uint256 mintEnd);
    event HealRequestSubmitted(uint256 roundId, uint256[] agentIds, uint256[] costs);
    event HealRequestFulfilled(uint256 roundId, HealResult[] healResults);
    event RandomnessRequested(uint256 roundId, uint256 requestId);
    event RandomnessFulfilled(uint256 roundId, uint256 requestId);
    event InvalidRandomnessFulfillment(uint256 requestId, uint256 randomnessRequestRoundId, uint256 currentRoundId);
    event RoundStarted(uint256 roundId);
    event Escaped(uint256 roundId, uint256[] agentIds, uint256[] rewards);
    event PrizeClaimed(uint256 agentId, address currency, uint256 amount);
    event Wounded(uint256 roundId, uint256[] agentIds);
    event Killed(uint256 roundId, uint256[] agentIds);
    event Won(uint256 roundId, uint256 agentId);

    error ExceededTotalSupply();
    error FrontrunLockIsOn();
    error GameAlreadyBegun();
    error GameNotYetBegun();
    error GameIsStillRunning();
    error GameOver();
    error HealingDisabled();
    error InexactNativeTokensSupplied();
    error InvalidAgentStatus(uint256 agentId, AgentStatus expectedStatus);
    error InvalidHealingRoundsDelay();
    error InvalidMaxSupply();
    error InvalidMintPeriod();
    error InvalidPlacement();
    error MaximumHealingRequestPerRoundExceeded();
    error MintAlreadyStarted();
    error MintCanOnlyBeExtended();
    error MintStartIsInThePast();
    error NoAgentsLeft();
    error NoAgentsProvided();
    error NotEnoughMinted();
    error NothingToClaim();
    error NotInMintPeriod();
    error NotAgentOwner();
    error Immutable();
    error RandomnessRequestAlreadyExists();
    error InvalidRandomnessRequestId();
    error RoundsToBeWoundedBeforeDeadTooLow();
    error StillMinting();
    error TooEarlyToStartNewRound();
    error TooEarlyToRetryRandomnessRequest();
    error TooManyMinted();
    error WoundedAgentIdsPerRoundExceeded();

    /**
     * @notice Sets the mint period.
     * @dev If _mintStart is 0, the function call is just a mint end extension.
     * @param _mintStart The starting timestamp of the mint period.
     * @param _mintEnd The ending timestamp of the mint period.
     */
    function setMintPeriod(uint40 _mintStart, uint40 _mintEnd) external;

    /**
     * @notice Mints a number of agents.
     * @param to The recipient
     * @param quantity The number of agents to mint.
     */
    function premint(address to, uint256 quantity) external payable;

    /**
     * @notice Mints a number of agents.
     * @param quantity The number of agents to mint.
     */
    function mint(uint256 quantity) external payable;

    /**
     * @notice This function is here in case the game's invariant condition does not hold or the game is stuck.
     *         Only callable by the contract owner.
     */
    function emergencyWithdraw() external;

    /**
     * @notice Starts the game.
     * @dev Starting the game sets the current round ID to 1.
     */
    function startGame() external;

    /**
     * @notice Starts a new round.
     */
    function startNewRound() external;

    /**
     * @notice Close a round after randomness is fullfilled by Chainlink.
     * @param requestId The Chainlink request ID.
     */
    function closeRound(uint256 requestId) external;

    /**
     * @notice Claims the grand prize. Only callable by the winner.
     */
    function claimGrandPrize() external;

    /**
     * @notice Claims the secondary prizes. Only callable by top 50 agents.
     * @param agentId The agent ID.
     */
    function claimSecondaryPrizes(uint256 agentId) external;

    /**
     * @notice Escape from the game and take some rewards. 80% of the prize pool is distributed to
     *         the escaped agents and the rest to the secondary prize pool.
     * @param agentIds The agent IDs to escape.
     */
    function escape(uint256[] calldata agentIds) external;

    /**
     * @notice Submits a heal request for the specified agent IDs.
     * @param agentIds The agent IDs to heal.
     */
    function heal(uint256[] calldata agentIds) external;

    /**
     * @notice Get the agent at the specified index.
     * @return agent The agent at the specified index.
     */
    function getAgent(uint256 index) external view returns (Agent memory agent);

    /**
     * @notice Returns the cost to heal the specified agents
     * @dev The cost doubles for each time the agent is healed.
     * @param agentIds The agent IDs to heal.
     * @return cost The cost to heal the specified agents.
     */
    function costToHeal(uint256[] calldata agentIds) external view returns (uint256 cost);

    /**
     * @notice Returns the reward for escaping the game.
     * @param agentIds The agent IDs to escape.
     * @return reward The reward for escaping the game.
     */
    function escapeReward(uint256[] calldata agentIds) external view returns (uint256 reward);

    /**
     * @notice Returns the total number of agents alive.
     */
    function agentsAlive() external view returns (uint256);

    /**
     * @notice Returns the index of a specific agent ID inside the agents mapping.
     * @param agentId The agent ID.
     * @return index The index of the agent ID.
     */
    function agentIndex(uint256 agentId) external view returns (uint256 index);

    /**
     * @notice Returns a specific round's information.
     * @param roundId The round ID.
     * @return woundedAgentIds The agent IDs of the wounded agents in the specified round.
     * @return healingAgentIds The agent IDs of the healing agents in the specified round.
     */
    function getRoundInfo(
        uint256 roundId
    ) external view returns (uint256[] memory woundedAgentIds, uint256[] memory healingAgentIds);
}

File 3 of 20 : OwnableTwoSteps.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

// Interfaces
import {IOwnableTwoSteps} from "./interfaces/IOwnableTwoSteps.sol";

/**
 * @title OwnableTwoSteps
 * @notice This contract offers transfer of ownership in two steps with potential owner
 *         having to confirm the transaction to become the owner.
 *         Renouncement of the ownership is also a two-step process since the next potential owner is the address(0).
 * @author LooksRare protocol team (👀,💎)
 */
abstract contract OwnableTwoSteps is IOwnableTwoSteps {
    /**
     * @notice Address of the current owner.
     */
    address public owner;

    /**
     * @notice Address of the potential owner.
     */
    address public potentialOwner;

    /**
     * @notice Ownership status.
     */
    Status public ownershipStatus;

    /**
     * @notice Modifier to wrap functions for contracts that inherit this contract.
     */
    modifier onlyOwner() {
        _onlyOwner();
        _;
    }

    /**
     * @notice Constructor
     * @param _owner The contract's owner
     */
    constructor(address _owner) {
        owner = _owner;
        emit NewOwner(_owner);
    }

    /**
     * @notice This function is used to cancel the ownership transfer.
     * @dev This function can be used for both cancelling a transfer to a new owner and
     *      cancelling the renouncement of the ownership.
     */
    function cancelOwnershipTransfer() external onlyOwner {
        Status _ownershipStatus = ownershipStatus;
        if (_ownershipStatus == Status.NoOngoingTransfer) {
            revert NoOngoingTransferInProgress();
        }

        if (_ownershipStatus == Status.TransferInProgress) {
            delete potentialOwner;
        }

        delete ownershipStatus;

        emit CancelOwnershipTransfer();
    }

    /**
     * @notice This function is used to confirm the ownership renouncement.
     */
    function confirmOwnershipRenouncement() external onlyOwner {
        if (ownershipStatus != Status.RenouncementInProgress) {
            revert RenouncementNotInProgress();
        }

        delete owner;
        delete ownershipStatus;

        emit NewOwner(address(0));
    }

    /**
     * @notice This function is used to confirm the ownership transfer.
     * @dev This function can only be called by the current potential owner.
     */
    function confirmOwnershipTransfer() external {
        if (ownershipStatus != Status.TransferInProgress) {
            revert TransferNotInProgress();
        }

        if (msg.sender != potentialOwner) {
            revert WrongPotentialOwner();
        }

        owner = msg.sender;
        delete ownershipStatus;
        delete potentialOwner;

        emit NewOwner(msg.sender);
    }

    /**
     * @notice This function is used to initiate the transfer of ownership to a new owner.
     * @param newPotentialOwner New potential owner address
     */
    function initiateOwnershipTransfer(address newPotentialOwner) external onlyOwner {
        if (ownershipStatus != Status.NoOngoingTransfer) {
            revert TransferAlreadyInProgress();
        }

        ownershipStatus = Status.TransferInProgress;
        potentialOwner = newPotentialOwner;

        /**
         * @dev This function can only be called by the owner, so msg.sender is the owner.
         *      We don't have to SLOAD the owner again.
         */
        emit InitiateOwnershipTransfer(msg.sender, newPotentialOwner);
    }

    /**
     * @notice This function is used to initiate the ownership renouncement.
     */
    function initiateOwnershipRenouncement() external onlyOwner {
        if (ownershipStatus != Status.NoOngoingTransfer) {
            revert TransferAlreadyInProgress();
        }

        ownershipStatus = Status.RenouncementInProgress;

        emit InitiateOwnershipRenouncement();
    }

    function _onlyOwner() private view {
        if (msg.sender != owner) revert NotOwner();
    }
}

File 4 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface IERC20 {
    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);

    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address to, uint256 amount) external returns (bool);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function transferFrom(address from, address to, uint256 amount) external returns (bool);

    function decimals() external view returns (uint8);
}

File 5 of 20 : ProtocolFee.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title ProtocolFee
 * @notice This contract makes it possible for a contract to charge a protocol fee.
 * @author LooksRare protocol team (👀,💎)
 */
abstract contract ProtocolFee {
    /**
     * @dev Emitted when the protocol fee basis points is updated.
     */
    event ProtocolFeeBpUpdated(uint16 protocolFeeBp);

    /**
     * @dev Emitted when the protocol fee recipient is updated.
     */
    event ProtocolFeeRecipientUpdated(address protocolFeeRecipient);

    /**
     * @dev This error is used when the protocol fee basis points is too high
     *      or when the protocol fee recipient is a zero address.
     */
    error ProtocolFee__InvalidValue();

    /**
     * @notice The maximum protocol fee in basis points, which is 25%.
     */
    uint16 public constant MAXIMUM_PROTOCOL_FEE_BP = 2_500;

    /**
     * @notice The address of the protocol fee recipient.
     */
    address public protocolFeeRecipient;

    /**
     * @notice The protocol fee basis points.
     */
    uint16 public protocolFeeBp;

    /**
     * @dev This function is used to update the protocol fee recipient. It should be overridden
     *      by the contract that inherits from this contract. The function should be guarded
     *      by an access control mechanism to prevent unauthorized users from calling it.
     * @param _protocolFeeRecipient The address of the protocol fee recipient
     */
    function updateProtocolFeeRecipient(address _protocolFeeRecipient) external virtual;

    /**
     * @dev This function is used to update the protocol fee basis points. It should be overridden
     *      by the contract that inherits from this contract. The function should be guarded
     *      by an access control mechanism to prevent unauthorized users from calling it.
     * @param _protocolFeeBp The protocol fee basis points
     */
    function updateProtocolFeeBp(uint16 _protocolFeeBp) external virtual;

    /**
     * @param _protocolFeeRecipient The new protocol fee recipient address
     */
    function _updateProtocolFeeRecipient(address _protocolFeeRecipient) internal {
        if (_protocolFeeRecipient == address(0)) {
            revert ProtocolFee__InvalidValue();
        }
        protocolFeeRecipient = _protocolFeeRecipient;
        emit ProtocolFeeRecipientUpdated(_protocolFeeRecipient);
    }

    /**
     * @param _protocolFeeBp The new protocol fee in basis points
     */
    function _updateProtocolFeeBp(uint16 _protocolFeeBp) internal {
        if (_protocolFeeBp > MAXIMUM_PROTOCOL_FEE_BP) {
            revert ProtocolFee__InvalidValue();
        }
        protocolFeeBp = _protocolFeeBp;
        emit ProtocolFeeBpUpdated(_protocolFeeBp);
    }
}

File 6 of 20 : PackableReentrancyGuard.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

// Interfaces
import {IReentrancyGuard} from "./interfaces/IReentrancyGuard.sol";

/**
 * @title PackableReentrancyGuard
 * @notice This contract protects against reentrancy attacks.
 *         It is adjusted from OpenZeppelin.
 *         The only difference between this contract and ReentrancyGuard
 *         is that _status is uint8 instead of uint256 so that it can be
 *         packed with other contracts' storage variables.
 * @author LooksRare protocol team (👀,💎)
 */
abstract contract PackableReentrancyGuard is IReentrancyGuard {
    uint8 private _status;

    /**
     * @notice Modifier to wrap functions to prevent reentrancy calls.
     */
    modifier nonReentrant() {
        if (_status == 2) {
            revert ReentrancyFail();
        }

        _status = 2;
        _;
        _status = 1;
    }

    constructor() {
        _status = 1;
    }
}

File 7 of 20 : LowLevelERC20Transfer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

// Interfaces
import {IERC20} from "../interfaces/generic/IERC20.sol";

// Errors
import {ERC20TransferFail, ERC20TransferFromFail} from "../errors/LowLevelErrors.sol";
import {NotAContract} from "../errors/GenericErrors.sol";

/**
 * @title LowLevelERC20Transfer
 * @notice This contract contains low-level calls to transfer ERC20 tokens.
 * @author LooksRare protocol team (👀,💎)
 */
contract LowLevelERC20Transfer {
    /**
     * @notice Execute ERC20 transferFrom
     * @param currency Currency address
     * @param from Sender address
     * @param to Recipient address
     * @param amount Amount to transfer
     */
    function _executeERC20TransferFrom(address currency, address from, address to, uint256 amount) internal {
        if (currency.code.length == 0) {
            revert NotAContract();
        }

        (bool status, bytes memory data) = currency.call(abi.encodeCall(IERC20.transferFrom, (from, to, amount)));

        if (!status) {
            revert ERC20TransferFromFail();
        }

        if (data.length > 0) {
            if (!abi.decode(data, (bool))) {
                revert ERC20TransferFromFail();
            }
        }
    }

    /**
     * @notice Execute ERC20 (direct) transfer
     * @param currency Currency address
     * @param to Recipient address
     * @param amount Amount to transfer
     */
    function _executeERC20DirectTransfer(address currency, address to, uint256 amount) internal {
        if (currency.code.length == 0) {
            revert NotAContract();
        }

        (bool status, bytes memory data) = currency.call(abi.encodeCall(IERC20.transfer, (to, amount)));

        if (!status) {
            revert ERC20TransferFail();
        }

        if (data.length > 0) {
            if (!abi.decode(data, (bool))) {
                revert ERC20TransferFail();
            }
        }
    }
}

File 8 of 20 : LowLevelWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

// Interfaces
import {IWETH} from "../interfaces/generic/IWETH.sol";

/**
 * @title LowLevelWETH
 * @notice This contract contains a function to transfer ETH with an option to wrap to WETH.
 *         If the ETH transfer fails within a gas limit, the amount in ETH is wrapped to WETH and then transferred.
 * @author LooksRare protocol team (👀,💎)
 */
contract LowLevelWETH {
    /**
     * @notice It transfers ETH to a recipient with a specified gas limit.
     *         If the original transfers fails, it wraps to WETH and transfers the WETH to recipient.
     * @param _WETH WETH address
     * @param _to Recipient address
     * @param _amount Amount to transfer
     * @param _gasLimit Gas limit to perform the ETH transfer
     */
    function _transferETHAndWrapIfFailWithGasLimit(
        address _WETH,
        address _to,
        uint256 _amount,
        uint256 _gasLimit
    ) internal {
        bool status;

        assembly {
            status := call(_gasLimit, _to, _amount, 0, 0, 0, 0)
        }

        if (!status) {
            IWETH(_WETH).deposit{value: _amount}();
            IWETH(_WETH).transfer(_to, _amount);
        }
    }
}

File 9 of 20 : ITransferManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

// Enums
import {TokenType} from "../enums/TokenType.sol";

/**
 * @title ITransferManager
 * @author LooksRare protocol team (👀,💎)
 */
interface ITransferManager {
    /**
     * @notice This struct is only used for transferBatchItemsAcrossCollections.
     * @param tokenAddress Token address
     * @param tokenType 0 for ERC721, 1 for ERC1155
     * @param itemIds Array of item ids to transfer
     * @param amounts Array of amounts to transfer
     */
    struct BatchTransferItem {
        address tokenAddress;
        TokenType tokenType;
        uint256[] itemIds;
        uint256[] amounts;
    }

    /**
     * @notice It is emitted if operators' approvals to transfer NFTs are granted by a user.
     * @param user Address of the user
     * @param operators Array of operator addresses
     */
    event ApprovalsGranted(address user, address[] operators);

    /**
     * @notice It is emitted if operators' approvals to transfer NFTs are revoked by a user.
     * @param user Address of the user
     * @param operators Array of operator addresses
     */
    event ApprovalsRemoved(address user, address[] operators);

    /**
     * @notice It is emitted if a new operator is added to the global allowlist.
     * @param operator Operator address
     */
    event OperatorAllowed(address operator);

    /**
     * @notice It is emitted if an operator is removed from the global allowlist.
     * @param operator Operator address
     */
    event OperatorRemoved(address operator);

    /**
     * @notice It is returned if the operator to approve has already been approved by the user.
     */
    error OperatorAlreadyApprovedByUser();

    /**
     * @notice It is returned if the operator to revoke has not been previously approved by the user.
     */
    error OperatorNotApprovedByUser();

    /**
     * @notice It is returned if the transfer caller is already allowed by the owner.
     * @dev This error can only be returned for owner operations.
     */
    error OperatorAlreadyAllowed();

    /**
     * @notice It is returned if the operator to approve is not in the global allowlist defined by the owner.
     * @dev This error can be returned if the user tries to grant approval to an operator address not in the
     *      allowlist or if the owner tries to remove the operator from the global allowlist.
     */
    error OperatorNotAllowed();

    /**
     * @notice It is returned if the transfer caller is invalid.
     *         For a transfer called to be valid, the operator must be in the global allowlist and
     *         approved by the 'from' user.
     */
    error TransferCallerInvalid();

    /**
     * @notice This function transfers ERC20 tokens.
     * @param tokenAddress Token address
     * @param from Sender address
     * @param to Recipient address
     * @param amount amount
     */
    function transferERC20(
        address tokenAddress,
        address from,
        address to,
        uint256 amount
    ) external;

    /**
     * @notice This function transfers a single item for a single ERC721 collection.
     * @param tokenAddress Token address
     * @param from Sender address
     * @param to Recipient address
     * @param itemId Item ID
     */
    function transferItemERC721(
        address tokenAddress,
        address from,
        address to,
        uint256 itemId
    ) external;

    /**
     * @notice This function transfers items for a single ERC721 collection.
     * @param tokenAddress Token address
     * @param from Sender address
     * @param to Recipient address
     * @param itemIds Array of itemIds
     * @param amounts Array of amounts
     */
    function transferItemsERC721(
        address tokenAddress,
        address from,
        address to,
        uint256[] calldata itemIds,
        uint256[] calldata amounts
    ) external;

    /**
     * @notice This function transfers a single item for a single ERC1155 collection.
     * @param tokenAddress Token address
     * @param from Sender address
     * @param to Recipient address
     * @param itemId Item ID
     * @param amount Amount
     */
    function transferItemERC1155(
        address tokenAddress,
        address from,
        address to,
        uint256 itemId,
        uint256 amount
    ) external;

    /**
     * @notice This function transfers items for a single ERC1155 collection.
     * @param tokenAddress Token address
     * @param from Sender address
     * @param to Recipient address
     * @param itemIds Array of itemIds
     * @param amounts Array of amounts
     * @dev It does not allow batch transferring if from = msg.sender since native function should be used.
     */
    function transferItemsERC1155(
        address tokenAddress,
        address from,
        address to,
        uint256[] calldata itemIds,
        uint256[] calldata amounts
    ) external;

    /**
     * @notice This function transfers items across an array of tokens that can be ERC20, ERC721 and ERC1155.
     * @param items Array of BatchTransferItem
     * @param from Sender address
     * @param to Recipient address
     */
    function transferBatchItemsAcrossCollections(
        BatchTransferItem[] calldata items,
        address from,
        address to
    ) external;

    /**
     * @notice This function allows a user to grant approvals for an array of operators.
     *         Users cannot grant approvals if the operator is not allowed by this contract's owner.
     * @param operators Array of operator addresses
     * @dev Each operator address must be globally allowed to be approved.
     */
    function grantApprovals(address[] calldata operators) external;

    /**
     * @notice This function allows a user to revoke existing approvals for an array of operators.
     * @param operators Array of operator addresses
     * @dev Each operator address must be approved at the user level to be revoked.
     */
    function revokeApprovals(address[] calldata operators) external;

    /**
     * @notice This function allows an operator to be added for the shared transfer system.
     *         Once the operator is allowed, users can grant NFT approvals to this operator.
     * @param operator Operator address to allow
     * @dev Only callable by owner.
     */
    function allowOperator(address operator) external;

    /**
     * @notice This function allows the user to remove an operator for the shared transfer system.
     * @param operator Operator address to remove
     * @dev Only callable by owner.
     */
    function removeOperator(address operator) external;

    /**
     * @notice This returns whether the user has approved the operator address.
     * The first address is the user and the second address is the operator.
     */
    function hasUserApprovedOperator(address user, address operator) external view returns (bool);
}

File 10 of 20 : VRFCoordinatorV2Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;

  /*
   * @notice Check to see if there exists a request commitment consumers
   * for all consumers and keyhashes for a given sub.
   * @param subId - ID of the subscription
   * @return true if there exists at least one unfulfilled request for the subscription, false
   * otherwise.
   */
  function pendingRequestExists(uint64 subId) external view returns (bool);
}

File 11 of 20 : VRFConsumerBaseV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness. It ensures 2 things:
 * @dev 1. The fulfillment came from the VRFCoordinator
 * @dev 2. The consumer contract implements fulfillRandomWords.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash). Create subscription, fund it
 * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
 * @dev subscription management functions).
 * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
 * @dev callbackGasLimit, numWords),
 * @dev see (VRFCoordinatorInterface for a description of the arguments).
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomWords method.
 *
 * @dev The randomness argument to fulfillRandomWords is a set of random words
 * @dev generated from your requestId and the blockHash of the request.
 *
 * @dev If your contract could have concurrent requests open, you can use the
 * @dev requestId returned from requestRandomWords to track which response is associated
 * @dev with which randomness request.
 * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ.
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request. It is for this reason that
 * @dev that you can signal to an oracle you'd like them to wait longer before
 * @dev responding to the request (however this is not enforced in the contract
 * @dev and so remains effective only in the case of unmodified oracle software).
 */
abstract contract VRFConsumerBaseV2 {
  error OnlyCoordinatorCanFulfill(address have, address want);
  address private immutable vrfCoordinator;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   */
  constructor(address _vrfCoordinator) {
    vrfCoordinator = _vrfCoordinator;
  }

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomWords the VRF output expanded to the requested number of words
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
    if (msg.sender != vrfCoordinator) {
      revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
    }
    fulfillRandomWords(requestId, randomWords);
  }
}

File 12 of 20 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

    // Mapping from token ID to approved address.
    mapping(uint256 => TokenApprovalRef) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        // Counter underflow is impossible as `_currentIndex` does not decrement,
        // and it is initialized to `_startTokenId()`.
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            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) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @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) public payable virtual override {
        address owner = ownerOf(tokenId);

        if (_msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                revert ApprovalCallerNotOwnerNorApproved();
            }

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}

File 13 of 20 : UnsafeMathUint256.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

library UnsafeMathUint256 {
  function unsafeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
      unchecked {
          return a + b;
      }
  }

  function unsafeSubtract(uint256 a, uint256 b) internal pure returns (uint256) {
      unchecked {
          return a - b;
      }
  }

  function unsafeMultiply(uint256 a, uint256 b) internal pure returns (uint256) {
      unchecked {
          return a * b;
      }
  }

  function unsafeDivide(uint256 a, uint256 b) internal pure returns (uint256) {
      unchecked {
          return a / b;
      }
  }
}

File 14 of 20 : IOwnableTwoSteps.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title IOwnableTwoSteps
 * @author LooksRare protocol team (👀,💎)
 */
interface IOwnableTwoSteps {
    /**
     * @notice This enum keeps track of the ownership status.
     * @param NoOngoingTransfer The default status when the owner is set
     * @param TransferInProgress The status when a transfer to a new owner is initialized
     * @param RenouncementInProgress The status when a transfer to address(0) is initialized
     */
    enum Status {
        NoOngoingTransfer,
        TransferInProgress,
        RenouncementInProgress
    }

    /**
     * @notice This is returned when there is no transfer of ownership in progress.
     */
    error NoOngoingTransferInProgress();

    /**
     * @notice This is returned when the caller is not the owner.
     */
    error NotOwner();

    /**
     * @notice This is returned when there is no renouncement in progress but
     *         the owner tries to validate the ownership renouncement.
     */
    error RenouncementNotInProgress();

    /**
     * @notice This is returned when the transfer is already in progress but the owner tries
     *         initiate a new ownership transfer.
     */
    error TransferAlreadyInProgress();

    /**
     * @notice This is returned when there is no ownership transfer in progress but the
     *         ownership change tries to be approved.
     */
    error TransferNotInProgress();

    /**
     * @notice This is returned when the ownership transfer is attempted to be validated by the
     *         a caller that is not the potential owner.
     */
    error WrongPotentialOwner();

    /**
     * @notice This is emitted if the ownership transfer is cancelled.
     */
    event CancelOwnershipTransfer();

    /**
     * @notice This is emitted if the ownership renouncement is initiated.
     */
    event InitiateOwnershipRenouncement();

    /**
     * @notice This is emitted if the ownership transfer is initiated.
     * @param previousOwner Previous/current owner
     * @param potentialOwner Potential/future owner
     */
    event InitiateOwnershipTransfer(address previousOwner, address potentialOwner);

    /**
     * @notice This is emitted when there is a new owner.
     */
    event NewOwner(address newOwner);
}

File 15 of 20 : IReentrancyGuard.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title IReentrancyGuard
 * @author LooksRare protocol team (👀,💎)
 */
interface IReentrancyGuard {
    /**
     * @notice This is returned when there is a reentrant call.
     */
    error ReentrancyFail();
}

File 16 of 20 : LowLevelErrors.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @notice It is emitted if the ETH transfer fails.
 */
error ETHTransferFail();

/**
 * @notice It is emitted if the ERC20 approval fails.
 */
error ERC20ApprovalFail();

/**
 * @notice It is emitted if the ERC20 transfer fails.
 */
error ERC20TransferFail();

/**
 * @notice It is emitted if the ERC20 transferFrom fails.
 */
error ERC20TransferFromFail();

/**
 * @notice It is emitted if the ERC721 transferFrom fails.
 */
error ERC721TransferFromFail();

/**
 * @notice It is emitted if the ERC1155 safeTransferFrom fails.
 */
error ERC1155SafeTransferFromFail();

/**
 * @notice It is emitted if the ERC1155 safeBatchTransferFrom fails.
 */
error ERC1155SafeBatchTransferFromFail();

File 17 of 20 : GenericErrors.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @notice It is emitted if the call recipient is not a contract.
 */
error NotAContract();

File 18 of 20 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;

interface IWETH {
    function deposit() external payable;

    function transfer(address dst, uint256 wad) external returns (bool);

    function withdraw(uint256 wad) external;
}

File 19 of 20 : TokenType.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

enum TokenType {
    ERC20,
    ERC721,
    ERC1155
}

File 20 of 20 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

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

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

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

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

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

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

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

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

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            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);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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`,
     * 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 be 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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * 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 payable;

    /**
     * @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 payable;

    /**
     * @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);

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

Settings
{
  "remappings": [
    "@chainlink/=node_modules/@chainlink/",
    "@ensdomains/=node_modules/@ensdomains/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@looksrare/=node_modules/@looksrare/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc721a/=node_modules/erc721a/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=node_modules/hardhat/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 888888
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"maxMintPerAddress","type":"uint256"},{"internalType":"uint256","name":"blocksPerRound","type":"uint256"},{"internalType":"uint256","name":"agentsToWoundPerRoundInBasisPoints","type":"uint256"},{"internalType":"uint256","name":"roundsToBeWoundedBeforeDead","type":"uint256"},{"internalType":"address","name":"looks","type":"address"},{"internalType":"address","name":"vrfCoordinator","type":"address"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint64","name":"subscriptionId","type":"uint64"},{"internalType":"address","name":"transferManager","type":"address"},{"internalType":"uint256","name":"healBaseCost","type":"uint256"},{"internalType":"address","name":"protocolFeeRecipient","type":"address"},{"internalType":"uint16","name":"protocolFeeBp","type":"uint16"},{"internalType":"address","name":"weth","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"internalType":"struct IInfiltration.ConstructorCalldata","name":"constructorCalldata","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"ERC20TransferFail","type":"error"},{"inputs":[],"name":"ExceededTotalSupply","type":"error"},{"inputs":[],"name":"FrontrunLockIsOn","type":"error"},{"inputs":[],"name":"GameAlreadyBegun","type":"error"},{"inputs":[],"name":"GameIsStillRunning","type":"error"},{"inputs":[],"name":"GameNotYetBegun","type":"error"},{"inputs":[],"name":"GameOver","type":"error"},{"inputs":[],"name":"HealingDisabled","type":"error"},{"inputs":[],"name":"Immutable","type":"error"},{"inputs":[],"name":"InexactNativeTokensSupplied","type":"error"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"enum IInfiltration.AgentStatus","name":"expectedStatus","type":"uint8"}],"name":"InvalidAgentStatus","type":"error"},{"inputs":[],"name":"InvalidHealingRoundsDelay","type":"error"},{"inputs":[],"name":"InvalidMaxSupply","type":"error"},{"inputs":[],"name":"InvalidMintPeriod","type":"error"},{"inputs":[],"name":"InvalidPlacement","type":"error"},{"inputs":[],"name":"InvalidRandomnessRequestId","type":"error"},{"inputs":[],"name":"MaximumHealingRequestPerRoundExceeded","type":"error"},{"inputs":[],"name":"MintAlreadyStarted","type":"error"},{"inputs":[],"name":"MintCanOnlyBeExtended","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintStartIsInThePast","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NoAgentsLeft","type":"error"},{"inputs":[],"name":"NoAgentsProvided","type":"error"},{"inputs":[],"name":"NoOngoingTransferInProgress","type":"error"},{"inputs":[],"name":"NotAContract","type":"error"},{"inputs":[],"name":"NotAgentOwner","type":"error"},{"inputs":[],"name":"NotEnoughMinted","type":"error"},{"inputs":[],"name":"NotInMintPeriod","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NothingToClaim","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"ProtocolFee__InvalidValue","type":"error"},{"inputs":[],"name":"RandomnessRequestAlreadyExists","type":"error"},{"inputs":[],"name":"ReentrancyFail","type":"error"},{"inputs":[],"name":"RenouncementNotInProgress","type":"error"},{"inputs":[],"name":"RoundsToBeWoundedBeforeDeadTooLow","type":"error"},{"inputs":[],"name":"StillMinting","type":"error"},{"inputs":[],"name":"TooEarlyToRetryRandomnessRequest","type":"error"},{"inputs":[],"name":"TooEarlyToStartNewRound","type":"error"},{"inputs":[],"name":"TooManyMinted","type":"error"},{"inputs":[],"name":"TransferAlreadyInProgress","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferNotInProgress","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"WoundedAgentIdsPerRoundExceeded","type":"error"},{"inputs":[],"name":"WrongPotentialOwner","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"CancelOwnershipTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"looksAmount","type":"uint256"}],"name":"EmergencyWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"agentIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"name":"Escaped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"components":[{"internalType":"uint256","name":"agentId","type":"uint256"},{"internalType":"enum IInfiltration.HealOutcome","name":"outcome","type":"uint8"}],"indexed":false,"internalType":"struct IInfiltration.HealResult[]","name":"healResults","type":"tuple[]"}],"name":"HealRequestFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"agentIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"costs","type":"uint256[]"}],"name":"HealRequestSubmitted","type":"event"},{"anonymous":false,"inputs":[],"name":"InitiateOwnershipRenouncement","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":false,"internalType":"address","name":"potentialOwner","type":"address"}],"name":"InitiateOwnershipTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomnessRequestRoundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentRoundId","type":"uint256"}],"name":"InvalidRandomnessFulfillment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"agentIds","type":"uint256[]"}],"name":"Killed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"mintStart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintEnd","type":"uint256"}],"name":"MintPeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"agentId","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PrizeClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"protocolFeeBp","type":"uint16"}],"name":"ProtocolFeeBpUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"protocolFeeRecipient","type":"address"}],"name":"ProtocolFeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"RandomnessFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"RandomnessRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"RoundStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"Won","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"agentIds","type":"uint256[]"}],"name":"Wounded","type":"event"},{"inputs":[],"name":"AGENTS_TO_WOUND_PER_ROUND_IN_BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCKS_PER_ROUND","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HEAL_BASE_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_PROTOCOL_FEE_BP","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINT_PER_ADDRESS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"agentIndex","outputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"agentsAlive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"amountMintedPerAddress","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimGrandPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"agentId","type":"uint256"}],"name":"claimSecondaryPrizes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"closeRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"confirmOwnershipRenouncement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"confirmOwnershipTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"agentIds","type":"uint256[]"}],"name":"costToHeal","outputs":[{"internalType":"uint256","name":"cost","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"agentIds","type":"uint256[]"}],"name":"escape","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"escapeMultiplier","outputs":[{"internalType":"uint256","name":"multiplier","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"agentIds","type":"uint256[]"}],"name":"escapeReward","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"escapeRewardSplitForSecondaryPrizePool","outputs":[{"internalType":"uint256","name":"split","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameInfo","outputs":[{"internalType":"uint16","name":"activeAgents","type":"uint16"},{"internalType":"uint16","name":"woundedAgents","type":"uint16"},{"internalType":"uint16","name":"healingAgents","type":"uint16"},{"internalType":"uint16","name":"deadAgents","type":"uint16"},{"internalType":"uint16","name":"escapedAgents","type":"uint16"},{"internalType":"uint40","name":"currentRoundId","type":"uint40"},{"internalType":"uint40","name":"currentRoundBlockNumber","type":"uint40"},{"internalType":"uint40","name":"randomnessLastRequestedAt","type":"uint40"},{"internalType":"uint256","name":"prizePool","type":"uint256"},{"internalType":"uint256","name":"secondaryPrizePool","type":"uint256"},{"internalType":"uint256","name":"secondaryLooksPrizePool","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getAgent","outputs":[{"components":[{"internalType":"uint16","name":"agentId","type":"uint16"},{"internalType":"enum IInfiltration.AgentStatus","name":"status","type":"uint8"},{"internalType":"uint40","name":"woundedAt","type":"uint40"},{"internalType":"uint16","name":"healCount","type":"uint16"}],"internalType":"struct IInfiltration.Agent","name":"agent","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundInfo","outputs":[{"internalType":"uint256[]","name":"woundedAgentIds","type":"uint256[]"},{"internalType":"uint256[]","name":"healingAgentIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"agentIds","type":"uint256[]"}],"name":"heal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"healingRoundsDelay","type":"uint256"}],"name":"healProbability","outputs":[{"internalType":"uint256","name":"y","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initiateOwnershipRenouncement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPotentialOwner","type":"address"}],"name":"initiateOwnershipTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintEnd","outputs":[{"internalType":"uint40","name":"","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintStart","outputs":[{"internalType":"uint40","name":"","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownershipStatus","outputs":[{"internalType":"enum IOwnableTwoSteps.Status","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"potentialOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"premint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"protocolFeeBp","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"randomnessRequests","outputs":[{"internalType":"enum IInfiltration.RandomnessRequestStatus","name":"status","type":"uint8"},{"internalType":"uint40","name":"roundId","type":"uint40"},{"internalType":"uint256","name":"randomWord","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"secondaryPrizePoolAmount","type":"uint256"},{"internalType":"uint256","name":"placement","type":"uint256"}],"name":"secondaryPrizePoolShareAmount","outputs":[{"internalType":"uint256","name":"shareAmount","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"placement","type":"uint256"}],"name":"secondaryPrizePoolShareBp","outputs":[{"internalType":"uint256","name":"share","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint40","name":"newMintStart","type":"uint40"},{"internalType":"uint40","name":"newMintEnd","type":"uint40"}],"name":"setMintPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startNewRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"updateProtocolFeeBp","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"updateProtocolFeeRecipient","outputs":[],"stateMutability":"pure","type":"function"}]

6102806040523462000a285762006a1a803803806200001e8162000a2d565b928339602082828101031262000a28578151916001600160401b03831162000a2857610260838201838301031262000a28576040519261026084016001600160401b03811185821017620007e6576040526200007c81830162000a53565b8452818101602001516001600160401b03811162000a2857620000a790848401908385010162000a68565b6020850152818101604001516001600160401b03811162000a2857620000d590848401908385010162000a68565b6040850152818101606081810151908601526080808201519086015260a0808201519086015260c0808201519086015260e08082015190860152610100808201519086015262000129906101200162000a53565b610120850152620001406101408284010162000a53565b610140850152818101610160818101519086015261018001516001600160401b038116810362000a2857610180850152620001816101a08284010162000a53565b6101a08501526101c081830101516101c0850152620001a66101e08284010162000a53565b6101e0850152610200818301015161ffff8116810362000a2857610200850152620001d76102208284010162000a53565b6102208501528181016102400151906001600160401b03821162000a28576200020593830192010162000a68565b6102408201526101408101516020808301516040808501518551600080546001600160a01b0319166001600160a01b0392831690811790915592519283529295909490939216917f3edd90e7770f06fafde38004653b33870066c33bfc923ff6102acd601f85dfbc91a183516001600160401b038111620007e657600454600181811c9116801562000a1d575b6020821014620007c557601f8111620009b7575b506020601f8211600114620009475781929394956000926200093b575b50508160011b916000199060031b1c1916176004555b82516001600160401b038111620007e657600554600181811c9116801562000930575b6020821014620007c557601f8111620008e6575b506020601f82116001146200087757819293946000926200086b575b50508160011b916000199060031b1c1916176005555b60016002556080908152600a805461ffff60b01b191661020160b01b17905581015160328111801591906200085e575b506200084c57608081015160e0820151908181029181830414901517156200081257620493e0106200083a576003610100820151106200082857606081015160e052608081015160a05260a081015160c05260c08101516101005260e08101516101205261010081015180610140526000198101610160526063810290808204606314811517156200081257604f19820191821162000812576305f5e1009082828102048214831517156200081257600019810115620007fc57600019019102046101809081526101208201516001600160a01b039081166101e0526101c0808401516101a0908152610160850151610200526101408501518316610220908152938501516001600160401b039081166102409081529186015184166102605293850151909216905282015180519092918111620007e657600c54600181811c91168015620007db575b6020821014620007c557601f81116200075b575b50602092601f8211600114620006f05792819293600092620006e4575b50508160011b916000199060031b1c191617600c555b6101e08101516001600160a01b0316908115620006d257610200600a54917fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d6020604051868152a101519061ffff8216906109c48211620006d2576001600160b01b03191690921760a09190911b61ffff60a01b1617600a556040519081527fede4aee4284b8033b84c1aadcc51b229a4e46e6b42ab40092e237f07508b462690602090a1604051615f3f908162000adb823960805181615558015260a0518181816113f30152818161336201526151da015260c0518181816114850152612986015260e0518181816123d0015261526d015261010051818181610ad301528181612d540152613703015261012051818181612bb60152614be7015261014051818181610cf9015281816120ba01528181612e3901526145ec0152610160518161458c0152610180518161454101526101a0518181816138e40152614e8a01526101c051818181610be5015281816126a201528181613484015281816135b1015261404101526101e0518181816118530152818161360401528181613eea0152613f8301526102005181614740015261022051816147b501526102405181614766015261026051816118300152f35b604051635937835d60e01b8152600490fd5b015190503880620004ed565b601f19821693600c60005260206000209160005b86811062000742575083600195961062000728575b505050811b01600c5562000503565b015160001960f88460031b161c1916905538808062000719565b9192602060018192868501518155019401920162000704565b600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7601f830160051c81019160208410620007ba575b601f0160051c01905b818110620007ad5750620004d0565b600081556001016200079e565b909150819062000795565b634e487b7160e01b600052602260045260246000fd5b90607f1690620004bc565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6040516334b8ab9f60e21b8152600490fd5b60405163691b800960e11b8152600490fd5b60405163066f305360e21b8152600490fd5b61ffff9150113862000372565b0151905038806200032c565b600560005260206000209060005b601f1984168110620008cd5750600193949583601f19811610620008b3575b505050811b0160055562000342565b015160001960f88460031b161c19169055388080620008a4565b9091602060018192858a01518155019301910162000885565b60056000526020600020601f830160051c81016020841062000928575b601f830160051c820181106200091b57505062000310565b6000815560010162000903565b508062000903565b90607f1690620002fc565b015190503880620002c3565b600460005260206000209060005b601f19841681106200099e575060019394959683601f1981161062000984575b505050811b01600455620002d9565b015160001960f88460031b161c1916905538808062000975565b9091602060018192858b01518155019301910162000955565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c81016020841062000a15575b601f830160051c8201811062000a08575050620002a6565b60008155600101620009f0565b5080620009f0565b90607f169062000292565b600080fd5b6040519190601f01601f191682016001600160401b03811183821017620007e657604052565b51906001600160a01b038216820362000a2857565b919080601f8401121562000a285782516001600160401b038111620007e65760209062000a9e601f8201601f1916830162000a2d565b9281845282828701011162000a285760005b81811062000ac657508260009394955001015290565b858101830151848201840152820162000ab056fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a7146103f757806306fdde03146103f25780630744f3d5146103ed578063081812fc146103e8578063095ea7b3146103e35780630cc73b6a146103de5780631613f92c146103d957806317d65508146103d457806318160ddd146103cf5780631df47f80146103ca5780631fe543e3146103c557806323452b9c146103c057806323b872dd146103bb578063255e4685146103b65780632b5e3e26146103b15780632bb5a9e6146103ac5780632de5aaf7146103a7578063311b8d5c146103a257806332cb6b0c1461039d57806335a8bfca146103985780633acd6cb2146103935780633e5675391461038e57806342842e0e1461038957806349890e151461038457806352a43eed1461037f57806355b159091461037a5780635b6ac011146103755780635cb6dfff146103705780636352211e1461036b57806364df049e14610366578063703fd3f81461036157806370a082311461035c5780637200b829146103575780637762df25146103525780637c18f2b61461034d57806388c3ffb01461034857806388e01a98146103435780638d859f3e1461033e5780638da5cb5b1461033957806395d89b411461033457806398753c461461032f5780639c87e0a81461032a5780639feddaed14610325578063a0712d6814610320578063a1fb20151461031b578063a22cb46514610316578063b106857914610311578063b88d4fde1461030c578063bd85948c14610307578063c0b6f56114610302578063c87b56dd146102fd578063d580c87f146102f8578063d65ab5f2146102f3578063db2e21bc146102ee578063db73bfce146102e9578063e1c31530146102e4578063e67e1666146102df578063e9254d26146102da578063e985e9c5146102d5578063ea2b4ab2146102d0578063ee94cec9146102cb5763eedaaa8d146102c657600080fd5b613ce9565b613a8d565b613a22565b613988565b613907565b6138ae565b61386d565b6137ac565b61351e565b6132ff565b61329a565b6130a3565b612fbb565b612cb5565b612c13565b612b80565b612a91565b612a46565b61289b565b61280b565b612569565b612526565b612445565b6123f3565b61239a565b611fc4565b611f3e565b611eb7565b611e65565b611cf5565b611c56565b611c1a565b611bc8565b611b6e565b611afc565b611a20565b6119e4565b6115fb565b6115c0565b61159d565b6114a8565b61144f565b611416565b6113bd565b611357565b611267565b6111c5565b611127565b6110e1565b6110cf565b610f67565b610ebb565b610d80565b610d1c565b610cc3565b610af6565b610a9d565b610960565b610882565b61076c565b6105a0565b61042b565b7fffffffff0000000000000000000000000000000000000000000000000000000081160361042657565b600080fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760207fffffffff00000000000000000000000000000000000000000000000000000000600435610489816103fc565b167f01ffc9a70000000000000000000000000000000000000000000000000000000081149081156104f1575b81156104c7575b506040519015158152f35b7f5b5e139f00000000000000000000000000000000000000000000000000000000915014386104bc565b7f80ac58cd00000000000000000000000000000000000000000000000000000000811491506104b5565b600091031261042657565b60005b8381106105395750506000910152565b8181015183820152602001610529565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60209361058581518092818752878088019101610526565b0116010190565b90602061059d928181520190610549565b90565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe5760405190806004549060019180831c928082169283156106f4575b60209283861085146106c7578588526020880194908115610688575060011461062f575b61062b8761061f81890382610e62565b6040519182918261058c565b0390f35b600460005294509192917f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838610610677575050509101905061061f8261062b388061060f565b80548587015294820194810161065b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685525050505090151560051b01905061061f8261062b388061060f565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526022600452fd5b93607f16936105eb565b80fd5b9060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126104265760043567ffffffffffffffff9283821161042657806023830112156104265781600401359384116104265760248460051b83010111610426576024019190565b346104265761077a36610701565b60009161079f61079a8361079561ffff6013541661ffff1690565b61408d565b6154d6565b6107a7614689565b916014546015549185925b8184106107c457604051878152602090f35b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60019161085e61087261086b61084d8b809d61086461085561084d8f8f8f8f9061083c61081a610841948b9461084797614114565b35610837610827826146d9565b600052600f602052604060002090565b615315565b614153565b95615001565b85613d77565b612710900490565b96878093613d54565b9e61508a565b9103613d77565b8093613d54565b95030397019301929495916107b2565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576004356108bd81615af3565b156108f0576000526008602052602073ffffffffffffffffffffffffffffffffffffffff60406000205416604051908152f35b60046040517fcf4700e4000000000000000000000000000000000000000000000000000000008152fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361042657565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361042657565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265761099261091a565b60243573ffffffffffffffffffffffffffffffffffffffff806109b483615a37565b1690813303610a34575b600083815260086020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b81600052600960205260ff610a6d3360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166109be5760046040517fcfb3b942000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57600260ff600a5460b01c1614610c9957610b7c7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b610b846153fc565b60018152600f602052604081205461ffff1680610c94575060015b610ba8816152c4565b6014548015610c6a577f4aa95f981a8337cb337de335b965507da0879c3b49f799d20058e913f5ad2c2691610bdd6000601455565b610c095a83337f00000000000000000000000000000000000000000000000000000000000000006158ec565b6040805191825260006020830152810191909152606090a1610c677601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b80f35b60046040517f969bf728000000000000000000000000000000000000000000000000000000008152fd5b610b9f565b60046040517f1bbee726000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600254600354602091037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b604051908152f35b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657610db761091a565b5060046040517fbb7790e6000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610e2d57604052565b610de2565b67ffffffffffffffff8111610e2d57604052565b6020810190811067ffffffffffffffff821117610e2d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610e2d57604052565b67ffffffffffffffff8111610e2d5760051b60200190565b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760243567ffffffffffffffff8111610426573660238201121561042657806004013590610f1682610ea3565b90610f246040519283610e62565b82825260209260248484019160051b8301019136831161042657602401905b828210610f5857610f5684600435615554565b005b81358152908401908401610f43565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57610f9f6156f9565b60015460ff8160a01c16610fb2816111b6565b80156110455780610fc46001926111b6565b1461101a575b507fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff600154166001557f8eca980489e87f7dba4f26917aa4bfc906eb3f2b4f7b4b9fd0ff2b8bb3e21ae38180a180f35b7fffffffffffffffffffffffff00000000000000000000000000000000000000001660015538610fca565b60046040517fccf69db7000000000000000000000000000000000000000000000000000000008152fd5b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60609101126104265773ffffffffffffffffffffffffffffffffffffffff90600435828116810361042657916024359081168103610426579060443590565b610f566110db3661106f565b91614229565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602064ffffffffff600a5460c01c16604051908152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657610f5661115c61091a565b602435906111686156f9565b61117182615267565b61117a826151a4565b61118261522a565b615cf2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600311156111c057565b611187565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602060ff60015460a01c166040519061120c816111b6565b8152f35b600511156111c057565b9060058210156111c05752565b919091606060808201938161ffff9182815116855261124e6020820151602087019061121a565b64ffffffffff6040820151166040860152015116910152565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600435604080606081516112a981610e11565b600091818380935282602082015282858201520152838152600f60205220908051916112d483610e11565b5461ffff808216845260ff8260101c169160058310156111c05761062b956113256113459361133e9361134d9660208a015264ffffffffff8160181c16888a0152871c16606088019061ffff169052565b61133981600052600f602052604060002090565b614e66565b61ffff1690565b61ffff168352565b5191829182611227565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760043561ffff8116036104265760046040517fbb7790e6000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78614689565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe576114e06156f9565b600154600260ff8260a01c166114f5816111b6565b03611573577fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff907fffffffffffffffffffffffff00000000000000000000000000000000000000008354168355166001557f3edd90e7770f06fafde38004653b33870066c33bfc923ff6102acd601f85dfbc6020604051838152a180f35b60046040517f045c5122000000000000000000000000000000000000000000000000000000008152fd5b610f566115a93661106f565b90604051926115b784610e46565b60008452615b47565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040516109c48152f35b346104265761160936610701565b600260ff600a5460b01c1614610c995761165f7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b611667615469565b6013549161ffff92603284821611156119ba5764ffffffffff9061168a846154a5565b60501c16906116a3826000526012602052604060002090565b926116b361133e855461ffff1690565b9080820192601e841161199057600094916116cd816140c5565b9186935b8497838610156117a75761179f908b6117826117726116f18a8989614114565b359361175684611720611703886146d9565b6108278961171b83600052600f602052604060002090565b615364565b805490620200007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff831617905560401c16614e79565b6117608c8c61416f565b5261176b8b8b61416f565b5190613d54565b9860018091019c8b01018d613ddf565b919092169082549060031b9161ffff809116831b921b1916179055565b9693966116d1565b89547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff898d1616178a5592848b6013547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff8480848460101c160360101b938360201c160160201b9116171760135573ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016917f0000000000000000000000000000000000000000000000000000000000000000833b15610426576040517fda3e8ce400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015233602482015230604482015260648101889052936000908590608490829084905af190811561198b577fc336583a12cbbd0e56a944ad6e644ea9b89b312ea7174f79e72f27e83d23c188976119299561191d93611972575b5060021c9061579c565b604051948594856141f3565b0390a1610f567601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b8061197f61198592610e32565b8061051b565b89611913565b613d99565b60046040517f943c39b6000000000000000000000000000000000000000000000000000000008152fd5b60046040517fc90c904e000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78600435614531565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57611a586156f9565b60015460ff8160a01c16611a6b816111b6565b611ad2577fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674020000000000000000000000000000000000000000176001557f3ff05a45e46337fa1cbf20996d2eeb927280bce099f37252bcca1040609604ec8180a180f35b60046040517f74ed79ae000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600435600052600e60205260606040600020805464ffffffffff600160ff83169301549160405193611b5c816111b6565b845260081c1660208301526040820152f35b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff611bbf600435615a37565b16604051908152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff600a5416604051908152f35b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78600435614626565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265773ffffffffffffffffffffffffffffffffffffffff611ca261091a565b168015611ccb576000526007602052602067ffffffffffffffff60406000205416604051908152f35b60046040517f8f4eb604000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600154600160ff8260a01c16611d39816111b6565b03611e3b5773ffffffffffffffffffffffffffffffffffffffff163303611e1157600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055611db17fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff60015416600155565b611dde7fffffffffffffffffffffffff000000000000000000000000000000000000000060015416600155565b6040513381527f3edd90e7770f06fafde38004653b33870066c33bfc923ff6102acd601f85dfbc9080602081015b0390a1005b60046040517fafdcfb92000000000000000000000000000000000000000000000000000000008152fd5b60046040517f5e4f2826000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020612710611f01611ef9602435614626565b600435613d77565b04604051908152f35b90815180825260208080930193019160005b828110611f2a575050505090565b835185529381019392810192600101611f1c565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657611fb6600435806000526011602052611f896040600020615509565b90600052601260205261062b611fa26040600020615509565b604051938493604085526040850190611f0a565b908382036020850152611f0a565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760135464ffffffffff808260501c16612018600435600052600e602052604060002090565b91818354918260081c161490811591612382575b50612358577f33a701182892fd888ed152ca2ac23771a32e814469b7cd255965471e1af3a65992600180930154612061614689565b9161ffff91828083169260201c1690600091806122fa575b5060328311156121a957846120b47fffffffffffffffffffffffffffffffffffffffffffffffff0000ffff00000000928561213d988a614bda565b906000907f0000000000000000000000000000000000000000000000000000000000000000808a11612195575b505081816013549501878660301c160160301b968560101c16010360101b9303911617171782907fffffffffffffff000000000000000000000000000000ffffffffffffffffffff60014360781b930160501b91161717601355565b612184770100000000000000000000000000000000000000000000007fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b604051910181528060208101611e0c565b6121a29250890389614d55565b38806120e1565b8291876122309694119182612235575b508293946121eb7fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff00009460135497615106565b8560301c16010160301b9216171782907fffffffffffffff000000000000000000000000000000ffffffffffffffffffff60014360781b930160501b91161717601355565b61213d565b927f671c98e1063255ef19ccc962aca12d122b0043de83631fac15be1cb076e9f7b26122cb866122ab8c61228a867fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff00009a6146f7565b016122a38161133981600052600f602052604060002090565b928391614eae565b6122b361409a565b906122bd82614162565b526040519182918c83614701565b0390a17fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9485019401926121b9565b9294915061235261230d85928489614a4d565b939180828097039901960303167fffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff65ffff000000006013549260201b16911617601355565b38612079565b60046040517fe4c98f71000000000000000000000000000000000000000000000000000000008152fd5b6002915060ff16612392816111b6565b14153861202c565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe5760405190806005549060019180831c9280821692831561251c575b60209283861085146106c757858852602088019490811561068857506001146124c35761062b8761061f81890382610e62565b600560005294509192917f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b83861061250b575050509101905061061f8261062b388061060f565b8054858701529482019481016124ef565b93607f1693612490565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602061ffff600a5460a01c16604051908152f35b346104265761257736610701565b90600260ff600a5460b01c1614610c99576125ce7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b6125d6615469565b6125df826154a5565b6125f38261079561133e60135461ffff1690565b906125fd826154d6565b612605614689565b9060145493601554946000612619836140c5565b91815b84811061272e5750916126c66126e09261269d6126e89a6126987f537267dffdb0954f0c19f86e8ea73087f7db51b35dc6bea8a9df9b42b86c53d39998976013548d7fffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff00008b61ffff8460401c160160401b92161717601355601455565b601555565b5a90337f00000000000000000000000000000000000000000000000000000000000000006158ec565b60135460501c64ffffffffff1692604051948594856141c0565b0390a1615106565b610f567601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b958691819961273e84888a614114565b3590612749826152c4565b612752826146d9565b928261276885600052600f602052604060002090565b9061277291615315565b61277c8582614153565b9661278686615001565b6127909089613d77565b6127109004806127a181998c61416f565b526127ab91613d54565b96866127b68761508a565b9103906127c291613d77565b61271090049586910303946127d691613d54565b9a6127e092614f13565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019560010161261c565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600260ff600a5460b01c1614610c99576128907602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b6126e8600435613e00565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600435600260ff600a5460b01c1614610c995761291e7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b600a5461293a9060c01c64ffffffffff165b64ffffffffff1690565b42108015612a2b575b612a015761294f61522a565b6129838161297d3373ffffffffffffffffffffffffffffffffffffffff16600052600d602052604060002090565b54613d54565b907f000000000000000000000000000000000000000000000000000000000000000082116129d7576126e8916129b882615267565b6129c1826151a4565b336000908152600d602052604090205533615cf2565b60046040517fdb815ecd000000000000000000000000000000000000000000000000000000008152fd5b60046040517ffa073358000000000000000000000000000000000000000000000000000000008152fd5b50612a3f612930600b5464ffffffffff1690565b4211612943565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78612a82614689565b61508a565b8015150361042657565b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657612ac861091a565b73ffffffffffffffffffffffffffffffffffffffff60243591612aea83612a87565b336000526009602052612b218160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b921515927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541660ff851617905560405192835216907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b67ffffffffffffffff8111610e2d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657612c4561091a565b612c4d61093d565b6064359167ffffffffffffffff8311610426573660238401121561042657826004013591612c7a83612bd9565b92612c886040519485610e62565b8084523660248287010111610426576020816000926024610f569801838801378501015260443591615b47565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57600260ff600a5460b01c1614610c9957612d3b7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b60135464ffffffffff90818160501c16918215612f91577f0000000000000000000000000000000000000000000000000000000000000000818360781c16014310612f675762015180908260a01c16014210612f3d57612d99614689565b9161ffff80921691600191828514612f0c575b60328411612eff578290612dca61133e60135461ffff9060101c1690565b612e37575b505050821115612e29575050612de3614718565b610c677601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b612e3291615106565b612de3565b7f000000000000000000000000000000000000000000000000000000000000000080821115612ef85781035b9087925b612eab575b50507fffffffffffffffffffffffffffffffffffffffffffffffff0000ffff0000ffff90601354928360301c160160301b911617601355388181612dcf565b909591612ed061133e612ec8896000526011602052604060002090565b5461ffff1690565b15612ef15790848092612ee4858a85614d55565b8091019403970191612e67565b9195612e6c565b5081612e63565b5050505050612e32614718565b828403612dac5760046040517fdf469ccb000000000000000000000000000000000000000000000000000000008152fd5b60046040517f9f0306e8000000000000000000000000000000000000000000000000000000008152fd5b60046040517fa9d9eca0000000000000000000000000000000000000000000000000000000008152fd5b60046040517fc1409a71000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657612ff261091a565b612ffa6156f9565b60015460ff8160a01c1661300d816111b6565b611ad2577fffffffffffffffffffffff0000000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911690811774010000000000000000000000000000000000000000176001556040805133815260208101929092527fb86c75c9bffca616b2d314cc914f7c3f1d174255b16b941c3f3ededee276d5ef919081908101611e0c565b34610426576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576004356130df81615af3565b1561327057604051906000600c549060019180831c92808216918215613266575b87851083146132395784875286939260208501929181156131fd57506001146131a2575b505061313292500383610e62565b81511561318f5761062b9261316361314c61061f93615e66565b61315d604051958694850190615a20565b90615a20565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610e62565b50505061062b61319d615744565b61061f565b600c60005291507fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7936000925b888285106131e7575050506131329350013880613124565b86548585015295810195889550909301926131cf565b9050613132959293507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009150168252151560051b013880613124565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526022600452fd5b93607f1693613100565b60046040517fa14c4b50000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265773ffffffffffffffffffffffffffffffffffffffff6132e661091a565b16600052600d6020526020604060002054604051908152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576133366156f9565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f000000000000000000000000000000000000000000000000000000000000000081106134da575b603281106134b05761ffff6134099161339f61522a565b6133d96a01000000000000000000007fffffffffffffffffffffffffffffffffff0000000000ffffffffffffffffffff6013541617601355565b1661ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00006013541617601355565b6134a84761343961343161342761133e600a5461ffff9060a01c1690565b8302612710900490565b809203601455565b604051600181527f33a701182892fd888ed152ca2ac23771a32e814469b7cd255965471e1af3a65990602090a1600a5473ffffffffffffffffffffffffffffffffffffffff16905a917f00000000000000000000000000000000000000000000000000000000000000006158ec565b610f56614718565b60046040517f93c93e01000000000000000000000000000000000000000000000000000000008152fd5b6134ed612930600b5464ffffffffff1690565b4210156133885760046040517f532b23d7000000000000000000000000000000000000000000000000000000008152fd5b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe576135566156f9565b60135461ffff908181169164ffffffffff91828160501c161592831594859384613745575b508361373a575b50826136f9575b5050816136d7575b82156136cf575b5081156136c7575b506135a85780f35b476135d55a82337f00000000000000000000000000000000000000000000000000000000000000006158ec565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152907f00000000000000000000000000000000000000000000000000000000000000009060208360248173ffffffffffffffffffffffffffffffffffffffff86165afa91821561198b577f99010623e00d801536d5e2da7de373bda9592873b6d101d65738aa2582e64522938593613693575b508261368091339061587e565b604080519182526020820192909252a180f35b6136809193506136b99060203d81116136c0575b6136b18183610e62565b810190613d8a565b9290613673565b503d6136a7565b9050386135a0565b915038613598565b90506201fa406136f0612930600b5464ffffffffff1690565b01421190613591565b61373192506137277f0000000000000000000000000000000000000000000000000000000000000000613d61565b9160781c16613d54565b43113880613589565b600110925038613582565b613779919650613774818560301c1691613774818760401c1691613774818960201c16918960101c168c613d54565b613d54565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011415943861357b565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576013546014546015546016546040805161ffff8087168252601087901c811660208084019190915287901c811682840152603087901c811660608301529186901c909116608082015264ffffffffff605086901c811660a080840191909152607887901c821660c08401529590951c90941660e085015261010084019290925261012083015261014082015261016090f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d786138a9614689565b615001565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346104265761391536610701565b60009182915b80841061392d57602083604051908152f35b909161396c61ffff613940868587614114565b3561394a816146d9565b600052600f602052604090613963826000209182615364565b54901c16614e79565b81018091116139835760019390930192919061391b565b613d25565b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602060ff613a166139c661091a565b73ffffffffffffffffffffffffffffffffffffffff6139e361093d565b91166000526009845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602064ffffffffff600b5416604051908152f35b6004359064ffffffffff8216820361042657565b6024359064ffffffffff8216820361042657565b34610426576040807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657613ac5613a65565b90613ace613a79565b90613ad76156f9565b64ffffffffff8381169390831680851015613cc0578415948515613be5575b50804211908115613bc9575b50613ba0577fde0225a54e6c9fb403aa996cb755cf686017f93bc6bc8e4f9f37e398e3e146bd93613b5f8464ffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000600b541617600b55565b15613b965750600a54611e0c9060c01c64ffffffffff16915b5164ffffffffff928316815292909116602083015281906040820190565b611e0c9091613b78565b600482517fbe62021d000000000000000000000000000000000000000000000000000000008152fd5b9050613bde612930600b5464ffffffffff1690565b1138613b02565b4211613c9757600a54613c019060c01c64ffffffffff16612930565b80613c61575b50613c5b827fffffff0000000000ffffffffffffffffffffffffffffffffffffffffffffffff7cffffffffff000000000000000000000000000000000000000000000000600a549260c01b16911617600a55565b38613af6565b421015613c6e5738613c07565b600483517fd8aefac8000000000000000000000000000000000000000000000000000000008152fd5b600483517f0fcb8b7b000000000000000000000000000000000000000000000000000000008152fd5b600483517f3ad9580b000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d786004356146d9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9190820180921161398357565b9060d882029180830460d8149015171561398357565b8181029291811591840414171561398357565b90816020910312610426575190565b6040513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600052602060002090565b919091601f831015613dfb57601e908360041c019260011b1690565b613da5565b613e086153fc565b613e11816152c4565b613e1a816146d9565b613e23816153b6565b600b5466ffffffffffffff9060281c811680831c600116610c6a57613e86916001841b16177fffffffffffffffffffffffffffffffffffffffff00000000000000ffffffffff6bffffffffffffff0000000000600b549260281b16911617600b55565b613e9281601554614612565b80614014575b506016548015613f4d575b613eb990613eb361271093614626565b90613d77565b0480613ec3575050565b7f4aa95f981a8337cb337de335b965507da0879c3b49f799d20058e913f5ad2c2691613f487f000000000000000000000000000000000000000000000000000000000000000092613f1581338661587e565b6040519384938473ffffffffffffffffffffffffffffffffffffffff604092959493606083019683521660208201520152565b0390a1565b506040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152906020826024817f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff165afa91821561198b57600092613ff4575b50818215613fee57613eb3613eb992613fe461271095601655565b9350509050613ea3565b50505050565b61400d91925060203d81116136c0576136b18183610e62565b9038613fc9565b6140847f4aa95f981a8337cb337de335b965507da0879c3b49f799d20058e913f5ad2c26916140655a82337f00000000000000000000000000000000000000000000000000000000000000006158ec565b6040805186815260006020820152908101919091529081906060820190565b0390a138613e98565b9190820391821161398357565b604051906040820182811067ffffffffffffffff821117610e2d576040526001825260203681840137565b906140cf82610ea3565b6140dc6040519182610e62565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061410a8294610ea3565b0190602036910137565b9190811015613dfb5760051b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b811561415d570490565b614124565b805115613dfb5760200190565b8051821015613dfb5760209160051b010190565b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83116104265760209260051b809284830137010190565b929161059d949264ffffffffff6141e593168552606060208601526060850191614183565b916040818403910152611f0a565b929161059d94926141e5928552606060208601526060850191614183565b908152604081019291614227916020019061121a565b565b90614233836146d9565b600052600f60205260ff60406000205460101c1660058110156111c057600181116144f7575061426283615a37565b73ffffffffffffffffffffffffffffffffffffffff8084169283828416036144cd576000868152600860205260409020805490926142c073ffffffffffffffffffffffffffffffffffffffff881633908114908414171590565b1590565b61443e575b82169586156144145761434e936143029261440a575b5073ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905573ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b805460010190557c0200000000000000000000000000000000000000000000000000000000804260a01b85171761438f866000526006602052604060002090565b558116156143c0575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b600184016143d8816000526006602052604060002090565b54156143e5575b50614398565b60025481146143df57614402906000526006602052604060002090565b5538806143df565b60009055386142db565b60046040517fea553b34000000000000000000000000000000000000000000000000000000008152fd5b61449e6142bc614497336144728b73ffffffffffffffffffffffffffffffffffffffff166000526009602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460ff1690565b156142c55760046040517f59c896be000000000000000000000000000000000000000000000000000000008152fd5b60046040517fa1148100000000000000000000000000000000000000000000000000000000008152fd5b8361452d6040519283927f0d5323a900000000000000000000000000000000000000000000000000000000845260048401614211565b0390fd5b80158080156145e9575b6145bf577f000000000000000000000000000000000000000000000000000000000000000091601381029181830460131417156139835763713fb30002908082046305f5e1001490151715613983577f000000000000000000000000000000000000000000000000000000000000000090811561415d570481039081116139835790565b60046040517f04ea02d5000000000000000000000000000000000000000000000000000000008152fd5b507f0000000000000000000000000000000000000000000000000000000000000000821161453b565b61462290613eb361271093614626565b0490565b60318102908082046031149015171561398357801561415d57633b4e7ec0047ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5436810190811161398357620202e9908082029182040361398357633b9aca00900490565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160135461ffff90818160301c1683039283116139835760401c1681039081116139835790565b908160005260106020526040600020549182156146f35750565b9150565b811561415d570690565b60409061059d939281528160208201520190611f0a565b6040517f5d3b1d300000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201527f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16602482015260036044820152622625a060648201526001608482015260208160a48160007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff165af190811561198b57600091614940575b5061481361449782600052600e602052604060002090565b61481c816111b6565b614916576013547f3d94fecedaa4f90b8bd459797adb95f5bb11426025c5541390d9ccc1ad1b60a1919060501c64ffffffffff16601380547fffffffffffffff0000000000ffffffffffffffffffffffffffffffffffffffff164260a01b78ffffffffff00000000000000000000000000000000000000001617905581600052600e6020528060081b6001176040600020556148f5770200000000000000000000000000000000000000000000007fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b6040805164ffffffffff909216825260208201929092529081908101613f48565b60046040517ff9012132000000000000000000000000000000000000000000000000000000008152fd5b614958915060203d81116136c0576136b18183610e62565b386147fb565b9061496882610ea3565b604061497681519283610e62565b8382527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06149a48395610ea3565b01906000805b8381106149b8575050505050565b8251908382019180831067ffffffffffffffff841117610e2d5760209285528381528284818301528288010152016149aa565b906060604092838101928152602091818584809401528651809552019401926000905b838210614a1d57505050505090565b90919293948386518051835201519060028210156111c05784810191909152810194830193929160010190614a0e565b929091600093600093614a6a826000526012602052604060002090565b614a7961133e825461ffff1690565b9081614a87575b5050505090565b919392965080614a97879261495e565b926000955b828710614ae65750507ff0c0bd04f09c5b4c03d28f7311833e44f9fe752809264f87607a694d218993de9394500395614ada604051928392836149eb565b0390a138808080614a80565b919380959193506001808801978b614b1261133e614b048c8a613ddf565b905461ffff9160031b1c1690565b91614b5d614b1f846146d9565b9284614b3f84614b3987600052600f602052604060002090565b9961416f565b51528654614b569060181c64ffffffffff16612930565b9003614531565b6402540be400870611614b99575050505090613dd4614b8e92805461ffff6001818360401c160160401b9116179055565b939290918792614a9c565b614b8e959c93945090614bbd6020614bb5614bcd95948d61416f565b510160019052565b614bc7848861408d565b90614eae565b0197600052602060002090565b9290939161084d614c0c917f000000000000000000000000000000000000000000000000000000000000000090613d77565b928315614d4c575b614c20849592956140c5565b91614c35826000526011602052604060002090565b956000905b868210614cac57505050614c9d849561ffff7fe740435bd797b3f29ea5e91b18d424d5418e497bd3a2267dfba548e842c1f4fa95961661ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000825416179055565b613f4860405192839283614701565b614cfc90600180614cbd86846146f7565b0190614cd382600052600f602052604060002090565b9182549060ff8260101c16614ce781611210565b15614d01575b50505050600052602060002090565b614c3a565b614d439362010000614d279369ffff000000000000ffff8c60181b911617178155614e66565b9485614d33828b61416f565b52019361ffff611782868d613ddf565b38808080614ced565b60019350614c14565b919290600092614d6f826000526011602052604060002090565b94614d7f61133e875461ffff1690565b90614d89826140c5565b9360005b838110614dcc57505050507f671c98e1063255ef19ccc962aca12d122b0043de83631fac15be1cb076e9f7b292939450613f4860405192839283614701565b600180820191614de261133e614b04858e613ddf565b90614dec826146d9565b9085614e0283600052600f602052604060002090565b548560ff8260101c16614e1481611210565b14614e25575b505050505050614d8d565b60181c64ffffffffff1614614e3c575b8581614e1a565b9082614e50614e5b94938c9e96979e61416f565b52614bc7848861408d565b019638808080614e35565b5461ffff1680614e74575090565b905090565b60ff811161398357600161059d911b7f0000000000000000000000000000000000000000000000000000000000000000613d77565b916204000091614f08614ef7600095838752600f602052806040614ed486828b20614e66565b98878152601060205286828220558981522055600052600f602052604060002090565b91600052600f602052604060002090565b938454179055179055565b916203000091614f08614ef7600095838752600f602052806040614ed486828b20614e66565b8015614ffb578080600114614ff457600214614fee576001908161013382101682600b83101617614fe657906002815b808211614f9f575050817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048111613983570290565b9092807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04811161398357818416614fdd575b800292811c90614f69565b80920291614fd2565b600291500a90565b50600490565b5050600190565b50600090565b612710908181029181830414901517156139835760025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801561415d5761504f9104614f39565b80603202906032820403613983576401dcd6500081810391818311613983576064830292830460641491141715613983576305f5e100900490565b9061271091828102908082048414901517156139835760025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190811561415d5704611f4090818102918183041490151715613983576063620f61d0910481039081116139835760649004918083116146f35750565b6001146151105750565b60011461511957565b6013546001600052600f6020527f169f97de0d9a84d840042b17d3c6b9638b3d6fd9024c9eb0c7a306a17b49f88f547f3c6f6a06cfd9c0c95090713d31b06691fff09d08efa09dfe81b5f4fcd0db2c349160501c64ffffffffff169061ffff168061519e57506001905b6040805164ffffffffff9290921682526020820192909252a1565b90615183565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01908101809111613983577f00000000000000000000000000000000000000000000000000000000000000001061520057565b60046040517f5d20e856000000000000000000000000000000000000000000000000000000008152fd5b64ffffffffff60135460501c1661523d57565b60046040517fab6ecc53000000000000000000000000000000000000000000000000000000008152fd5b615292907f000000000000000000000000000000000000000000000000000000000000000090613d77565b340361529a57565b60046040517f2a12a0cc000000000000000000000000000000000000000000000000000000008152fd5b6152e273ffffffffffffffffffffffffffffffffffffffff91615a37565b1633036152eb57565b60046040517f390772fc000000000000000000000000000000000000000000000000000000008152fd5b5460101c60ff1660058110156111c05761532c5750565b604490604051907f0d5323a9000000000000000000000000000000000000000000000000000000008252600482015260006024820152fd5b5460101c60ff1660058110156111c05760010361537e5750565b604490604051907f0d5323a9000000000000000000000000000000000000000000000000000000008252600482015260016024820152fd5b80159081156153f1575b506153c757565b60046040517f297146a9000000000000000000000000000000000000000000000000000000008152fd5b6032915011386153c0565b60135461ffff60018183161491821592615459575b821561544a575b505061542057565b60046040517fc7284d0e000000000000000000000000000000000000000000000000000000008152fd5b60201c16151590503880615418565b9150808260101c16151591615411565b600260ff600a5460b81c161461547b57565b60046040517f2e98fd9a000000000000000000000000000000000000000000000000000000008152fd5b156154ac57565b60046040517fd8ba85a4000000000000000000000000000000000000000000000000000000008152fd5b6001116154df57565b60046040517f61df2a20000000000000000000000000000000000000000000000000000000008152fd5b9061ffff918281541661551b816140c5565b9360005b82811061552c5750505050565b600181019061554e8361553f8488613ddf565b90549060031b1c16918861416f565b5261551f565b91907f00000000000000000000000000000000000000000000000000000000000000009273ffffffffffffffffffffffffffffffffffffffff841633036155a0576142279293506155ed565b6040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff85166024820152604490fd5b80600052600e60205260406000209161561361293060135464ffffffffff9060501c1690565b83549064ffffffffff8260081c1691818314908115916156e1575b506156a05750507f546aca7b2683440b8f02fa95faeb8efc79dd0f16af3d815a002742ea6f76116c926156636148f592614162565b51600182015580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021781555460081c64ffffffffff1690565b60408051948552602085019290925290830152507fea18705d978143c83c4009ada26bdca3246bfd37055c03a17f85d3210cbf859991508060608101613f48565b6001915060ff166156f1816111b6565b14153861562e565b73ffffffffffffffffffffffffffffffffffffffff60005416330361571a57565b60046040517f30cd7471000000000000000000000000000000000000000000000000000000008152fd5b6040519061575182610e46565b60008252565b3d15615782573d9061576882612bd9565b916157766040519384610e62565b82523d6000602084013e565b606090565b90816020910312610426575161059d81612a87565b90813b15615854576000918291826040516157f28161316360208201957fa9059cbb0000000000000000000000000000000000000000000000000000000087526024830191906020604084019361dead81520152565b51925af16157fe615757565b901561582a5780518061580f575050565b816020806142bc936158249501019101615787565b61582a57565b60046040517ff1568f95000000000000000000000000000000000000000000000000000000008152fd5b60046040517f09ee12d5000000000000000000000000000000000000000000000000000000008152fd5b919091803b15615854576040517fa9059cbb000000000000000000000000000000000000000000000000000000006020820190815273ffffffffffffffffffffffffffffffffffffffff90941660248201526044810192909252600092839283906157f28160648101613163565b61590182849395600080809781948294f11590565b61590b5750505050565b73ffffffffffffffffffffffffffffffffffffffff16803b15615a1c57604051937fd0e30db0000000000000000000000000000000000000000000000000000000008552838560048186865af193841561198b576159c495602095615a09575b506040518096819582947fa9059cbb000000000000000000000000000000000000000000000000000000008452600484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03925af1801561198b576159db575b808080613fee565b6159fb9060203d8111615a02575b6159f38183610e62565b810190615787565b50386159d3565b503d6159e9565b8061197f615a1692610e32565b3861596b565b8280fd5b90615a3360209282815194859201610526565b0190565b808060011115615a6c575b60046040517fdf2d9b42000000000000000000000000000000000000000000000000000000008152fd5b600254811015615a42576000526006602052604060002054907c01000000000000000000000000000000000000000000000000000000008216615a42575b8115615ab4575090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff915001615aec816000526006602052604060002090565b5490615aaa565b80600111159081615b3b575b81615b08575090565b905060005260066020527c0100000000000000000000000000000000000000000000000000000000604060002054161590565b60025481109150615aff565b929190615b55828286614229565b803b615b615750505050565b615b6a93615bf3565b15615b785738808080613fee565b60046040517fd1a57ed6000000000000000000000000000000000000000000000000000000008152fd5b90816020910312610426575161059d816103fc565b909261059d949360809373ffffffffffffffffffffffffffffffffffffffff809216845216602083015260408201528160608201520190610549565b92602091615c4a93600073ffffffffffffffffffffffffffffffffffffffff6040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c85523360048601615bb7565b0393165af160009181615cc2575b50615c9c57615c65615757565b80519081615c975760046040517fd1a57ed6000000000000000000000000000000000000000000000000000000008152fd5b602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000161490565b615ce491925060203d8111615ceb575b615cdc8183610e62565b810190615ba2565b9038615c58565b503d615cd2565b6002549073ffffffffffffffffffffffffffffffffffffffff8116908115615e3c578315615e12576113888411615de85761422793615d5360009273ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b68010000000000000001820281540190556001811460e11b4260a01b178317615d86856000526006602052604060002090565b558301927fdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d60405180615de07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8801829190602083019252565b0390a4600255565b60046040517f3db1f9af000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb562e8dd000000000000000000000000000000000000000000000000000000008152fd5b60046040517f2e076300000000000000000000000000000000000000000000000000000000008152fd5b9060405160a081016040527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608082019360008552935b0192600a90818106603001855304928315615ed9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90615e9d565b92506080837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0920301920191825256fea2646970667358221220fdf813bba190b40ad708e1294664585f393aa810708005f2dc221218df3306dc64736f6c634300081400330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b5a9e5a319c7fda551a30be592c77394bf935c6f000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000023000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699098af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef00000000000000000000000000000000000000000000000000000000000002de00000000000000000000000000000000000ea4af05656c17b90f4d64add29e1d0000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000c8c57e4c73c71f72ca0a7e043e5d2d144f98ef1300000000000000000000000000000000000000000000000000000000000005dc000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000164c6f6f6b735261726520494e46494c54524154494f4e0000000000000000000000000000000000000000000000000000000000000000000000000000000000074c524147454e5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003468747470733a2f2f6170692e6c6f6f6b73726172652e6f72672f6170692f76312f696e66696c74726174696f6e2f6167656e742f000000000000000000000000

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c806301ffc9a7146103f757806306fdde03146103f25780630744f3d5146103ed578063081812fc146103e8578063095ea7b3146103e35780630cc73b6a146103de5780631613f92c146103d957806317d65508146103d457806318160ddd146103cf5780631df47f80146103ca5780631fe543e3146103c557806323452b9c146103c057806323b872dd146103bb578063255e4685146103b65780632b5e3e26146103b15780632bb5a9e6146103ac5780632de5aaf7146103a7578063311b8d5c146103a257806332cb6b0c1461039d57806335a8bfca146103985780633acd6cb2146103935780633e5675391461038e57806342842e0e1461038957806349890e151461038457806352a43eed1461037f57806355b159091461037a5780635b6ac011146103755780635cb6dfff146103705780636352211e1461036b57806364df049e14610366578063703fd3f81461036157806370a082311461035c5780637200b829146103575780637762df25146103525780637c18f2b61461034d57806388c3ffb01461034857806388e01a98146103435780638d859f3e1461033e5780638da5cb5b1461033957806395d89b411461033457806398753c461461032f5780639c87e0a81461032a5780639feddaed14610325578063a0712d6814610320578063a1fb20151461031b578063a22cb46514610316578063b106857914610311578063b88d4fde1461030c578063bd85948c14610307578063c0b6f56114610302578063c87b56dd146102fd578063d580c87f146102f8578063d65ab5f2146102f3578063db2e21bc146102ee578063db73bfce146102e9578063e1c31530146102e4578063e67e1666146102df578063e9254d26146102da578063e985e9c5146102d5578063ea2b4ab2146102d0578063ee94cec9146102cb5763eedaaa8d146102c657600080fd5b613ce9565b613a8d565b613a22565b613988565b613907565b6138ae565b61386d565b6137ac565b61351e565b6132ff565b61329a565b6130a3565b612fbb565b612cb5565b612c13565b612b80565b612a91565b612a46565b61289b565b61280b565b612569565b612526565b612445565b6123f3565b61239a565b611fc4565b611f3e565b611eb7565b611e65565b611cf5565b611c56565b611c1a565b611bc8565b611b6e565b611afc565b611a20565b6119e4565b6115fb565b6115c0565b61159d565b6114a8565b61144f565b611416565b6113bd565b611357565b611267565b6111c5565b611127565b6110e1565b6110cf565b610f67565b610ebb565b610d80565b610d1c565b610cc3565b610af6565b610a9d565b610960565b610882565b61076c565b6105a0565b61042b565b7fffffffff0000000000000000000000000000000000000000000000000000000081160361042657565b600080fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760207fffffffff00000000000000000000000000000000000000000000000000000000600435610489816103fc565b167f01ffc9a70000000000000000000000000000000000000000000000000000000081149081156104f1575b81156104c7575b506040519015158152f35b7f5b5e139f00000000000000000000000000000000000000000000000000000000915014386104bc565b7f80ac58cd00000000000000000000000000000000000000000000000000000000811491506104b5565b600091031261042657565b60005b8381106105395750506000910152565b8181015183820152602001610529565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60209361058581518092818752878088019101610526565b0116010190565b90602061059d928181520190610549565b90565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe5760405190806004549060019180831c928082169283156106f4575b60209283861085146106c7578588526020880194908115610688575060011461062f575b61062b8761061f81890382610e62565b6040519182918261058c565b0390f35b600460005294509192917f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838610610677575050509101905061061f8261062b388061060f565b80548587015294820194810161065b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685525050505090151560051b01905061061f8261062b388061060f565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526022600452fd5b93607f16936105eb565b80fd5b9060207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126104265760043567ffffffffffffffff9283821161042657806023830112156104265781600401359384116104265760248460051b83010111610426576024019190565b346104265761077a36610701565b60009161079f61079a8361079561ffff6013541661ffff1690565b61408d565b6154d6565b6107a7614689565b916014546015549185925b8184106107c457604051878152602090f35b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60019161085e61087261086b61084d8b809d61086461085561084d8f8f8f8f9061083c61081a610841948b9461084797614114565b35610837610827826146d9565b600052600f602052604060002090565b615315565b614153565b95615001565b85613d77565b612710900490565b96878093613d54565b9e61508a565b9103613d77565b8093613d54565b95030397019301929495916107b2565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576004356108bd81615af3565b156108f0576000526008602052602073ffffffffffffffffffffffffffffffffffffffff60406000205416604051908152f35b60046040517fcf4700e4000000000000000000000000000000000000000000000000000000008152fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361042657565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361042657565b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265761099261091a565b60243573ffffffffffffffffffffffffffffffffffffffff806109b483615a37565b1690813303610a34575b600083815260086020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b81600052600960205260ff610a6d3360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166109be5760046040517fcfb3b942000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000238152f35b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57600260ff600a5460b01c1614610c9957610b7c7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b610b846153fc565b60018152600f602052604081205461ffff1680610c94575060015b610ba8816152c4565b6014548015610c6a577f4aa95f981a8337cb337de335b965507da0879c3b49f799d20058e913f5ad2c2691610bdd6000601455565b610c095a83337f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26158ec565b6040805191825260006020830152810191909152606090a1610c677601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b80f35b60046040517f969bf728000000000000000000000000000000000000000000000000000000008152fd5b610b9f565b60046040517f1bbee726000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000308152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600254600354602091037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b604051908152f35b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657610db761091a565b5060046040517fbb7790e6000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610e2d57604052565b610de2565b67ffffffffffffffff8111610e2d57604052565b6020810190811067ffffffffffffffff821117610e2d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610e2d57604052565b67ffffffffffffffff8111610e2d5760051b60200190565b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760243567ffffffffffffffff8111610426573660238201121561042657806004013590610f1682610ea3565b90610f246040519283610e62565b82825260209260248484019160051b8301019136831161042657602401905b828210610f5857610f5684600435615554565b005b81358152908401908401610f43565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57610f9f6156f9565b60015460ff8160a01c16610fb2816111b6565b80156110455780610fc46001926111b6565b1461101a575b507fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff600154166001557f8eca980489e87f7dba4f26917aa4bfc906eb3f2b4f7b4b9fd0ff2b8bb3e21ae38180a180f35b7fffffffffffffffffffffffff00000000000000000000000000000000000000001660015538610fca565b60046040517fccf69db7000000000000000000000000000000000000000000000000000000008152fd5b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60609101126104265773ffffffffffffffffffffffffffffffffffffffff90600435828116810361042657916024359081168103610426579060443590565b610f566110db3661106f565b91614229565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602064ffffffffff600a5460c01c16604051908152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657610f5661115c61091a565b602435906111686156f9565b61117182615267565b61117a826151a4565b61118261522a565b615cf2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600311156111c057565b611187565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602060ff60015460a01c166040519061120c816111b6565b8152f35b600511156111c057565b9060058210156111c05752565b919091606060808201938161ffff9182815116855261124e6020820151602087019061121a565b64ffffffffff6040820151166040860152015116910152565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600435604080606081516112a981610e11565b600091818380935282602082015282858201520152838152600f60205220908051916112d483610e11565b5461ffff808216845260ff8260101c169160058310156111c05761062b956113256113459361133e9361134d9660208a015264ffffffffff8160181c16888a0152871c16606088019061ffff169052565b61133981600052600f602052604060002090565b614e66565b61ffff1690565b61ffff168352565b5191829182611227565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760043561ffff8116036104265760046040517fbb7790e6000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000027108152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78614689565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000000000000000328152f35b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe576114e06156f9565b600154600260ff8260a01c166114f5816111b6565b03611573577fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff907fffffffffffffffffffffffff00000000000000000000000000000000000000008354168355166001557f3edd90e7770f06fafde38004653b33870066c33bfc923ff6102acd601f85dfbc6020604051838152a180f35b60046040517f045c5122000000000000000000000000000000000000000000000000000000008152fd5b610f566115a93661106f565b90604051926115b784610e46565b60008452615b47565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040516109c48152f35b346104265761160936610701565b600260ff600a5460b01c1614610c995761165f7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b611667615469565b6013549161ffff92603284821611156119ba5764ffffffffff9061168a846154a5565b60501c16906116a3826000526012602052604060002090565b926116b361133e855461ffff1690565b9080820192601e841161199057600094916116cd816140c5565b9186935b8497838610156117a75761179f908b6117826117726116f18a8989614114565b359361175684611720611703886146d9565b6108278961171b83600052600f602052604060002090565b615364565b805490620200007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff831617905560401c16614e79565b6117608c8c61416f565b5261176b8b8b61416f565b5190613d54565b9860018091019c8b01018d613ddf565b919092169082549060031b9161ffff809116831b921b1916179055565b9693966116d1565b89547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff898d1616178a5592848b6013547fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffff8480848460101c160360101b938360201c160160201b9116171760135573ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000ea4af05656c17b90f4d64add29e1d16917f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e833b15610426576040517fda3e8ce400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015233602482015230604482015260648101889052936000908590608490829084905af190811561198b577fc336583a12cbbd0e56a944ad6e644ea9b89b312ea7174f79e72f27e83d23c188976119299561191d93611972575b5060021c9061579c565b604051948594856141f3565b0390a1610f567601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b8061197f61198592610e32565b8061051b565b89611913565b613d99565b60046040517f943c39b6000000000000000000000000000000000000000000000000000000008152fd5b60046040517fc90c904e000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78600435614531565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57611a586156f9565b60015460ff8160a01c16611a6b816111b6565b611ad2577fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674020000000000000000000000000000000000000000176001557f3ff05a45e46337fa1cbf20996d2eeb927280bce099f37252bcca1040609604ec8180a180f35b60046040517f74ed79ae000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600435600052600e60205260606040600020805464ffffffffff600160ff83169301549160405193611b5c816111b6565b845260081c1660208301526040820152f35b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff611bbf600435615a37565b16604051908152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff600a5416604051908152f35b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78600435614626565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265773ffffffffffffffffffffffffffffffffffffffff611ca261091a565b168015611ccb576000526007602052602067ffffffffffffffff60406000205416604051908152f35b60046040517f8f4eb604000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600154600160ff8260a01c16611d39816111b6565b03611e3b5773ffffffffffffffffffffffffffffffffffffffff163303611e1157600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055611db17fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff60015416600155565b611dde7fffffffffffffffffffffffff000000000000000000000000000000000000000060015416600155565b6040513381527f3edd90e7770f06fafde38004653b33870066c33bfc923ff6102acd601f85dfbc9080602081015b0390a1005b60046040517fafdcfb92000000000000000000000000000000000000000000000000000000008152fd5b60046040517f5e4f2826000000000000000000000000000000000000000000000000000000008152fd5b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020612710611f01611ef9602435614626565b600435613d77565b04604051908152f35b90815180825260208080930193019160005b828110611f2a575050505090565b835185529381019392810192600101611f1c565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657611fb6600435806000526011602052611f896040600020615509565b90600052601260205261062b611fa26040600020615509565b604051938493604085526040850190611f0a565b908382036020850152611f0a565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760135464ffffffffff808260501c16612018600435600052600e602052604060002090565b91818354918260081c161490811591612382575b50612358577f33a701182892fd888ed152ca2ac23771a32e814469b7cd255965471e1af3a65992600180930154612061614689565b9161ffff91828083169260201c1690600091806122fa575b5060328311156121a957846120b47fffffffffffffffffffffffffffffffffffffffffffffffff0000ffff00000000928561213d988a614bda565b906000907f0000000000000000000000000000000000000000000000000000000000000030808a11612195575b505081816013549501878660301c160160301b968560101c16010360101b9303911617171782907fffffffffffffff000000000000000000000000000000ffffffffffffffffffff60014360781b930160501b91161717601355565b612184770100000000000000000000000000000000000000000000007fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b604051910181528060208101611e0c565b6121a29250890389614d55565b38806120e1565b8291876122309694119182612235575b508293946121eb7fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff00009460135497615106565b8560301c16010160301b9216171782907fffffffffffffff000000000000000000000000000000ffffffffffffffffffff60014360781b930160501b91161717601355565b61213d565b927f671c98e1063255ef19ccc962aca12d122b0043de83631fac15be1cb076e9f7b26122cb866122ab8c61228a867fffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff00009a6146f7565b016122a38161133981600052600f602052604060002090565b928391614eae565b6122b361409a565b906122bd82614162565b526040519182918c83614701565b0390a17fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9485019401926121b9565b9294915061235261230d85928489614a4d565b939180828097039901960303167fffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffff65ffff000000006013549260201b16911617601355565b38612079565b60046040517fe4c98f71000000000000000000000000000000000000000000000000000000008152fd5b6002915060ff16612392816111b6565b14153861202c565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f00000000000000000000000000000000000000000000000000b1a2bc2ec500008152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe5760405190806005549060019180831c9280821692831561251c575b60209283861085146106c757858852602088019490811561068857506001146124c35761062b8761061f81890382610e62565b600560005294509192917f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b83861061250b575050509101905061061f8261062b388061060f565b8054858701529482019481016124ef565b93607f1693612490565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602061ffff600a5460a01c16604051908152f35b346104265761257736610701565b90600260ff600a5460b01c1614610c99576125ce7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b6125d6615469565b6125df826154a5565b6125f38261079561133e60135461ffff1690565b906125fd826154d6565b612605614689565b9060145493601554946000612619836140c5565b91815b84811061272e5750916126c66126e09261269d6126e89a6126987f537267dffdb0954f0c19f86e8ea73087f7db51b35dc6bea8a9df9b42b86c53d39998976013548d7fffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffff00008b61ffff8460401c160160401b92161717601355601455565b601555565b5a90337f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26158ec565b60135460501c64ffffffffff1692604051948594856141c0565b0390a1615106565b610f567601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b958691819961273e84888a614114565b3590612749826152c4565b612752826146d9565b928261276885600052600f602052604060002090565b9061277291615315565b61277c8582614153565b9661278686615001565b6127909089613d77565b6127109004806127a181998c61416f565b526127ab91613d54565b96866127b68761508a565b9103906127c291613d77565b61271090049586910303946127d691613d54565b9a6127e092614f13565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019560010161261c565b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600260ff600a5460b01c1614610c99576128907602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b6126e8600435613e00565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657600435600260ff600a5460b01c1614610c995761291e7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b600a5461293a9060c01c64ffffffffff165b64ffffffffff1690565b42108015612a2b575b612a015761294f61522a565b6129838161297d3373ffffffffffffffffffffffffffffffffffffffff16600052600d602052604060002090565b54613d54565b907f000000000000000000000000000000000000000000000000000000000000003282116129d7576126e8916129b882615267565b6129c1826151a4565b336000908152600d602052604090205533615cf2565b60046040517fdb815ecd000000000000000000000000000000000000000000000000000000008152fd5b60046040517ffa073358000000000000000000000000000000000000000000000000000000008152fd5b50612a3f612930600b5464ffffffffff1690565b4211612943565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d78612a82614689565b61508a565b8015150361042657565b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657612ac861091a565b73ffffffffffffffffffffffffffffffffffffffff60243591612aea83612a87565b336000526009602052612b218160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b921515927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541660ff851617905560405192835216907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f000000000000000000000000000000000000000000000000000000000000001e8152f35b67ffffffffffffffff8111610e2d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657612c4561091a565b612c4d61093d565b6064359167ffffffffffffffff8311610426573660238401121561042657826004013591612c7a83612bd9565b92612c886040519485610e62565b8084523660248287010111610426576020816000926024610f569801838801378501015260443591615b47565b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe57600260ff600a5460b01c1614610c9957612d3b7602000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b60135464ffffffffff90818160501c16918215612f91577f0000000000000000000000000000000000000000000000000000000000000023818360781c16014310612f675762015180908260a01c16014210612f3d57612d99614689565b9161ffff80921691600191828514612f0c575b60328411612eff578290612dca61133e60135461ffff9060101c1690565b612e37575b505050821115612e29575050612de3614718565b610c677601000000000000000000000000000000000000000000007fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b612e3291615106565b612de3565b7f000000000000000000000000000000000000000000000000000000000000003080821115612ef85781035b9087925b612eab575b50507fffffffffffffffffffffffffffffffffffffffffffffffff0000ffff0000ffff90601354928360301c160160301b911617601355388181612dcf565b909591612ed061133e612ec8896000526011602052604060002090565b5461ffff1690565b15612ef15790848092612ee4858a85614d55565b8091019403970191612e67565b9195612e6c565b5081612e63565b5050505050612e32614718565b828403612dac5760046040517fdf469ccb000000000000000000000000000000000000000000000000000000008152fd5b60046040517f9f0306e8000000000000000000000000000000000000000000000000000000008152fd5b60046040517fa9d9eca0000000000000000000000000000000000000000000000000000000008152fd5b60046040517fc1409a71000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657612ff261091a565b612ffa6156f9565b60015460ff8160a01c1661300d816111b6565b611ad2577fffffffffffffffffffffff0000000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911690811774010000000000000000000000000000000000000000176001556040805133815260208101929092527fb86c75c9bffca616b2d314cc914f7c3f1d174255b16b941c3f3ededee276d5ef919081908101611e0c565b34610426576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576004356130df81615af3565b1561327057604051906000600c549060019180831c92808216918215613266575b87851083146132395784875286939260208501929181156131fd57506001146131a2575b505061313292500383610e62565b81511561318f5761062b9261316361314c61061f93615e66565b61315d604051958694850190615a20565b90615a20565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610e62565b50505061062b61319d615744565b61061f565b600c60005291507fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7936000925b888285106131e7575050506131329350013880613124565b86548585015295810195889550909301926131cf565b9050613132959293507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009150168252151560051b013880613124565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526022600452fd5b93607f1693613100565b60046040517fa14c4b50000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265773ffffffffffffffffffffffffffffffffffffffff6132e661091a565b16600052600d6020526020604060002054604051908152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576133366156f9565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f000000000000000000000000000000000000000000000000000000000000271081106134da575b603281106134b05761ffff6134099161339f61522a565b6133d96a01000000000000000000007fffffffffffffffffffffffffffffffffff0000000000ffffffffffffffffffff6013541617601355565b1661ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00006013541617601355565b6134a84761343961343161342761133e600a5461ffff9060a01c1690565b8302612710900490565b809203601455565b604051600181527f33a701182892fd888ed152ca2ac23771a32e814469b7cd255965471e1af3a65990602090a1600a5473ffffffffffffffffffffffffffffffffffffffff16905a917f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26158ec565b610f56614718565b60046040517f93c93e01000000000000000000000000000000000000000000000000000000008152fd5b6134ed612930600b5464ffffffffff1690565b4210156133885760046040517f532b23d7000000000000000000000000000000000000000000000000000000008152fd5b34610426576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106fe576135566156f9565b60135461ffff908181169164ffffffffff91828160501c161592831594859384613745575b508361373a575b50826136f9575b5050816136d7575b82156136cf575b5081156136c7575b506135a85780f35b476135d55a82337f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26158ec565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152907f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e9060208360248173ffffffffffffffffffffffffffffffffffffffff86165afa91821561198b577f99010623e00d801536d5e2da7de373bda9592873b6d101d65738aa2582e64522938593613693575b508261368091339061587e565b604080519182526020820192909252a180f35b6136809193506136b99060203d81116136c0575b6136b18183610e62565b810190613d8a565b9290613673565b503d6136a7565b9050386135a0565b915038613598565b90506201fa406136f0612930600b5464ffffffffff1690565b01421190613591565b61373192506137277f0000000000000000000000000000000000000000000000000000000000000023613d61565b9160781c16613d54565b43113880613589565b600110925038613582565b613779919650613774818560301c1691613774818760401c1691613774818960201c16918960101c168c613d54565b613d54565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011415943861357b565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576013546014546015546016546040805161ffff8087168252601087901c811660208084019190915287901c811682840152603087901c811660608301529186901c909116608082015264ffffffffff605086901c811660a080840191909152607887901c821660c08401529590951c90941660e085015261010084019290925261012083015261014082015261016090f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d786138a9614689565b615001565b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104265760206040517f0000000000000000000000000000000000000000000000056bc75e2d631000008152f35b346104265761391536610701565b60009182915b80841061392d57602083604051908152f35b909161396c61ffff613940868587614114565b3561394a816146d9565b600052600f602052604090613963826000209182615364565b54901c16614e79565b81018091116139835760019390930192919061391b565b613d25565b346104265760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602060ff613a166139c661091a565b73ffffffffffffffffffffffffffffffffffffffff6139e361093d565b91166000526009845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b346104265760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657602064ffffffffff600b5416604051908152f35b6004359064ffffffffff8216820361042657565b6024359064ffffffffff8216820361042657565b34610426576040807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261042657613ac5613a65565b90613ace613a79565b90613ad76156f9565b64ffffffffff8381169390831680851015613cc0578415948515613be5575b50804211908115613bc9575b50613ba0577fde0225a54e6c9fb403aa996cb755cf686017f93bc6bc8e4f9f37e398e3e146bd93613b5f8464ffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000600b541617600b55565b15613b965750600a54611e0c9060c01c64ffffffffff16915b5164ffffffffff928316815292909116602083015281906040820190565b611e0c9091613b78565b600482517fbe62021d000000000000000000000000000000000000000000000000000000008152fd5b9050613bde612930600b5464ffffffffff1690565b1138613b02565b4211613c9757600a54613c019060c01c64ffffffffff16612930565b80613c61575b50613c5b827fffffff0000000000ffffffffffffffffffffffffffffffffffffffffffffffff7cffffffffff000000000000000000000000000000000000000000000000600a549260c01b16911617600a55565b38613af6565b421015613c6e5738613c07565b600483517fd8aefac8000000000000000000000000000000000000000000000000000000008152fd5b600483517f0fcb8b7b000000000000000000000000000000000000000000000000000000008152fd5b600483517f3ad9580b000000000000000000000000000000000000000000000000000000008152fd5b346104265760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610426576020610d786004356146d9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9190820180921161398357565b9060d882029180830460d8149015171561398357565b8181029291811591840414171561398357565b90816020910312610426575190565b6040513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600052602060002090565b919091601f831015613dfb57601e908360041c019260011b1690565b613da5565b613e086153fc565b613e11816152c4565b613e1a816146d9565b613e23816153b6565b600b5466ffffffffffffff9060281c811680831c600116610c6a57613e86916001841b16177fffffffffffffffffffffffffffffffffffffffff00000000000000ffffffffff6bffffffffffffff0000000000600b549260281b16911617600b55565b613e9281601554614612565b80614014575b506016548015613f4d575b613eb990613eb361271093614626565b90613d77565b0480613ec3575050565b7f4aa95f981a8337cb337de335b965507da0879c3b49f799d20058e913f5ad2c2691613f487f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e92613f1581338661587e565b6040519384938473ffffffffffffffffffffffffffffffffffffffff604092959493606083019683521660208201520152565b0390a1565b506040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152906020826024817f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e73ffffffffffffffffffffffffffffffffffffffff165afa91821561198b57600092613ff4575b50818215613fee57613eb3613eb992613fe461271095601655565b9350509050613ea3565b50505050565b61400d91925060203d81116136c0576136b18183610e62565b9038613fc9565b6140847f4aa95f981a8337cb337de335b965507da0879c3b49f799d20058e913f5ad2c26916140655a82337f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26158ec565b6040805186815260006020820152908101919091529081906060820190565b0390a138613e98565b9190820391821161398357565b604051906040820182811067ffffffffffffffff821117610e2d576040526001825260203681840137565b906140cf82610ea3565b6140dc6040519182610e62565b8281527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061410a8294610ea3565b0190602036910137565b9190811015613dfb5760051b0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b811561415d570490565b614124565b805115613dfb5760200190565b8051821015613dfb5760209160051b010190565b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83116104265760209260051b809284830137010190565b929161059d949264ffffffffff6141e593168552606060208601526060850191614183565b916040818403910152611f0a565b929161059d94926141e5928552606060208601526060850191614183565b908152604081019291614227916020019061121a565b565b90614233836146d9565b600052600f60205260ff60406000205460101c1660058110156111c057600181116144f7575061426283615a37565b73ffffffffffffffffffffffffffffffffffffffff8084169283828416036144cd576000868152600860205260409020805490926142c073ffffffffffffffffffffffffffffffffffffffff881633908114908414171590565b1590565b61443e575b82169586156144145761434e936143029261440a575b5073ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905573ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b805460010190557c0200000000000000000000000000000000000000000000000000000000804260a01b85171761438f866000526006602052604060002090565b558116156143c0575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b600184016143d8816000526006602052604060002090565b54156143e5575b50614398565b60025481146143df57614402906000526006602052604060002090565b5538806143df565b60009055386142db565b60046040517fea553b34000000000000000000000000000000000000000000000000000000008152fd5b61449e6142bc614497336144728b73ffffffffffffffffffffffffffffffffffffffff166000526009602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460ff1690565b156142c55760046040517f59c896be000000000000000000000000000000000000000000000000000000008152fd5b60046040517fa1148100000000000000000000000000000000000000000000000000000000008152fd5b8361452d6040519283927f0d5323a900000000000000000000000000000000000000000000000000000000845260048401614211565b0390fd5b80158080156145e9575b6145bf577f00000000000000000000000000000000000000000000000000000002507edb3b91601381029181830460131417156139835763713fb30002908082046305f5e1001490151715613983577f000000000000000000000000000000000000000000000000000000000000002f90811561415d570481039081116139835790565b60046040517f04ea02d5000000000000000000000000000000000000000000000000000000008152fd5b507f0000000000000000000000000000000000000000000000000000000000000030821161453b565b61462290613eb361271093614626565b0490565b60318102908082046031149015171561398357801561415d57633b4e7ec0047ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5436810190811161398357620202e9908082029182040361398357633b9aca00900490565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160135461ffff90818160301c1683039283116139835760401c1681039081116139835790565b908160005260106020526040600020549182156146f35750565b9150565b811561415d570690565b60409061059d939281528160208201520190611f0a565b6040517f5d3b1d300000000000000000000000000000000000000000000000000000000081527f8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef60048201527f00000000000000000000000000000000000000000000000000000000000002de67ffffffffffffffff16602482015260036044820152622625a060648201526001608482015260208160a48160007f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990973ffffffffffffffffffffffffffffffffffffffff165af190811561198b57600091614940575b5061481361449782600052600e602052604060002090565b61481c816111b6565b614916576013547f3d94fecedaa4f90b8bd459797adb95f5bb11426025c5541390d9ccc1ad1b60a1919060501c64ffffffffff16601380547fffffffffffffff0000000000ffffffffffffffffffffffffffffffffffffffff164260a01b78ffffffffff00000000000000000000000000000000000000001617905581600052600e6020528060081b6001176040600020556148f5770200000000000000000000000000000000000000000000007fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff600a541617600a55565b6040805164ffffffffff909216825260208201929092529081908101613f48565b60046040517ff9012132000000000000000000000000000000000000000000000000000000008152fd5b614958915060203d81116136c0576136b18183610e62565b386147fb565b9061496882610ea3565b604061497681519283610e62565b8382527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06149a48395610ea3565b01906000805b8381106149b8575050505050565b8251908382019180831067ffffffffffffffff841117610e2d5760209285528381528284818301528288010152016149aa565b906060604092838101928152602091818584809401528651809552019401926000905b838210614a1d57505050505090565b90919293948386518051835201519060028210156111c05784810191909152810194830193929160010190614a0e565b929091600093600093614a6a826000526012602052604060002090565b614a7961133e825461ffff1690565b9081614a87575b5050505090565b919392965080614a97879261495e565b926000955b828710614ae65750507ff0c0bd04f09c5b4c03d28f7311833e44f9fe752809264f87607a694d218993de9394500395614ada604051928392836149eb565b0390a138808080614a80565b919380959193506001808801978b614b1261133e614b048c8a613ddf565b905461ffff9160031b1c1690565b91614b5d614b1f846146d9565b9284614b3f84614b3987600052600f602052604060002090565b9961416f565b51528654614b569060181c64ffffffffff16612930565b9003614531565b6402540be400870611614b99575050505090613dd4614b8e92805461ffff6001818360401c160160401b9116179055565b939290918792614a9c565b614b8e959c93945090614bbd6020614bb5614bcd95948d61416f565b510160019052565b614bc7848861408d565b90614eae565b0197600052602060002090565b9290939161084d614c0c917f000000000000000000000000000000000000000000000000000000000000001e90613d77565b928315614d4c575b614c20849592956140c5565b91614c35826000526011602052604060002090565b956000905b868210614cac57505050614c9d849561ffff7fe740435bd797b3f29ea5e91b18d424d5418e497bd3a2267dfba548e842c1f4fa95961661ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000825416179055565b613f4860405192839283614701565b614cfc90600180614cbd86846146f7565b0190614cd382600052600f602052604060002090565b9182549060ff8260101c16614ce781611210565b15614d01575b50505050600052602060002090565b614c3a565b614d439362010000614d279369ffff000000000000ffff8c60181b911617178155614e66565b9485614d33828b61416f565b52019361ffff611782868d613ddf565b38808080614ced565b60019350614c14565b919290600092614d6f826000526011602052604060002090565b94614d7f61133e875461ffff1690565b90614d89826140c5565b9360005b838110614dcc57505050507f671c98e1063255ef19ccc962aca12d122b0043de83631fac15be1cb076e9f7b292939450613f4860405192839283614701565b600180820191614de261133e614b04858e613ddf565b90614dec826146d9565b9085614e0283600052600f602052604060002090565b548560ff8260101c16614e1481611210565b14614e25575b505050505050614d8d565b60181c64ffffffffff1614614e3c575b8581614e1a565b9082614e50614e5b94938c9e96979e61416f565b52614bc7848861408d565b019638808080614e35565b5461ffff1680614e74575090565b905090565b60ff811161398357600161059d911b7f0000000000000000000000000000000000000000000000056bc75e2d63100000613d77565b916204000091614f08614ef7600095838752600f602052806040614ed486828b20614e66565b98878152601060205286828220558981522055600052600f602052604060002090565b91600052600f602052604060002090565b938454179055179055565b916203000091614f08614ef7600095838752600f602052806040614ed486828b20614e66565b8015614ffb578080600114614ff457600214614fee576001908161013382101682600b83101617614fe657906002815b808211614f9f575050817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048111613983570290565b9092807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04811161398357818416614fdd575b800292811c90614f69565b80920291614fd2565b600291500a90565b50600490565b5050600190565b50600090565b612710908181029181830414901517156139835760025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801561415d5761504f9104614f39565b80603202906032820403613983576401dcd6500081810391818311613983576064830292830460641491141715613983576305f5e100900490565b9061271091828102908082048414901517156139835760025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190811561415d5704611f4090818102918183041490151715613983576063620f61d0910481039081116139835760649004918083116146f35750565b6001146151105750565b60011461511957565b6013546001600052600f6020527f169f97de0d9a84d840042b17d3c6b9638b3d6fd9024c9eb0c7a306a17b49f88f547f3c6f6a06cfd9c0c95090713d31b06691fff09d08efa09dfe81b5f4fcd0db2c349160501c64ffffffffff169061ffff168061519e57506001905b6040805164ffffffffff9290921682526020820192909252a1565b90615183565b60025460035490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01908101809111613983577f00000000000000000000000000000000000000000000000000000000000027101061520057565b60046040517f5d20e856000000000000000000000000000000000000000000000000000000008152fd5b64ffffffffff60135460501c1661523d57565b60046040517fab6ecc53000000000000000000000000000000000000000000000000000000008152fd5b615292907f00000000000000000000000000000000000000000000000000b1a2bc2ec5000090613d77565b340361529a57565b60046040517f2a12a0cc000000000000000000000000000000000000000000000000000000008152fd5b6152e273ffffffffffffffffffffffffffffffffffffffff91615a37565b1633036152eb57565b60046040517f390772fc000000000000000000000000000000000000000000000000000000008152fd5b5460101c60ff1660058110156111c05761532c5750565b604490604051907f0d5323a9000000000000000000000000000000000000000000000000000000008252600482015260006024820152fd5b5460101c60ff1660058110156111c05760010361537e5750565b604490604051907f0d5323a9000000000000000000000000000000000000000000000000000000008252600482015260016024820152fd5b80159081156153f1575b506153c757565b60046040517f297146a9000000000000000000000000000000000000000000000000000000008152fd5b6032915011386153c0565b60135461ffff60018183161491821592615459575b821561544a575b505061542057565b60046040517fc7284d0e000000000000000000000000000000000000000000000000000000008152fd5b60201c16151590503880615418565b9150808260101c16151591615411565b600260ff600a5460b81c161461547b57565b60046040517f2e98fd9a000000000000000000000000000000000000000000000000000000008152fd5b156154ac57565b60046040517fd8ba85a4000000000000000000000000000000000000000000000000000000008152fd5b6001116154df57565b60046040517f61df2a20000000000000000000000000000000000000000000000000000000008152fd5b9061ffff918281541661551b816140c5565b9360005b82811061552c5750505050565b600181019061554e8361553f8488613ddf565b90549060031b1c16918861416f565b5261551f565b91907f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699099273ffffffffffffffffffffffffffffffffffffffff841633036155a0576142279293506155ed565b6040517f1cf993f400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff85166024820152604490fd5b80600052600e60205260406000209161561361293060135464ffffffffff9060501c1690565b83549064ffffffffff8260081c1691818314908115916156e1575b506156a05750507f546aca7b2683440b8f02fa95faeb8efc79dd0f16af3d815a002742ea6f76116c926156636148f592614162565b51600182015580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660021781555460081c64ffffffffff1690565b60408051948552602085019290925290830152507fea18705d978143c83c4009ada26bdca3246bfd37055c03a17f85d3210cbf859991508060608101613f48565b6001915060ff166156f1816111b6565b14153861562e565b73ffffffffffffffffffffffffffffffffffffffff60005416330361571a57565b60046040517f30cd7471000000000000000000000000000000000000000000000000000000008152fd5b6040519061575182610e46565b60008252565b3d15615782573d9061576882612bd9565b916157766040519384610e62565b82523d6000602084013e565b606090565b90816020910312610426575161059d81612a87565b90813b15615854576000918291826040516157f28161316360208201957fa9059cbb0000000000000000000000000000000000000000000000000000000087526024830191906020604084019361dead81520152565b51925af16157fe615757565b901561582a5780518061580f575050565b816020806142bc936158249501019101615787565b61582a57565b60046040517ff1568f95000000000000000000000000000000000000000000000000000000008152fd5b60046040517f09ee12d5000000000000000000000000000000000000000000000000000000008152fd5b919091803b15615854576040517fa9059cbb000000000000000000000000000000000000000000000000000000006020820190815273ffffffffffffffffffffffffffffffffffffffff90941660248201526044810192909252600092839283906157f28160648101613163565b61590182849395600080809781948294f11590565b61590b5750505050565b73ffffffffffffffffffffffffffffffffffffffff16803b15615a1c57604051937fd0e30db0000000000000000000000000000000000000000000000000000000008552838560048186865af193841561198b576159c495602095615a09575b506040518096819582947fa9059cbb000000000000000000000000000000000000000000000000000000008452600484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03925af1801561198b576159db575b808080613fee565b6159fb9060203d8111615a02575b6159f38183610e62565b810190615787565b50386159d3565b503d6159e9565b8061197f615a1692610e32565b3861596b565b8280fd5b90615a3360209282815194859201610526565b0190565b808060011115615a6c575b60046040517fdf2d9b42000000000000000000000000000000000000000000000000000000008152fd5b600254811015615a42576000526006602052604060002054907c01000000000000000000000000000000000000000000000000000000008216615a42575b8115615ab4575090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff915001615aec816000526006602052604060002090565b5490615aaa565b80600111159081615b3b575b81615b08575090565b905060005260066020527c0100000000000000000000000000000000000000000000000000000000604060002054161590565b60025481109150615aff565b929190615b55828286614229565b803b615b615750505050565b615b6a93615bf3565b15615b785738808080613fee565b60046040517fd1a57ed6000000000000000000000000000000000000000000000000000000008152fd5b90816020910312610426575161059d816103fc565b909261059d949360809373ffffffffffffffffffffffffffffffffffffffff809216845216602083015260408201528160608201520190610549565b92602091615c4a93600073ffffffffffffffffffffffffffffffffffffffff6040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c85523360048601615bb7565b0393165af160009181615cc2575b50615c9c57615c65615757565b80519081615c975760046040517fd1a57ed6000000000000000000000000000000000000000000000000000000008152fd5b602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000161490565b615ce491925060203d8111615ceb575b615cdc8183610e62565b810190615ba2565b9038615c58565b503d615cd2565b6002549073ffffffffffffffffffffffffffffffffffffffff8116908115615e3c578315615e12576113888411615de85761422793615d5360009273ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b68010000000000000001820281540190556001811460e11b4260a01b178317615d86856000526006602052604060002090565b558301927fdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d60405180615de07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8801829190602083019252565b0390a4600255565b60046040517f3db1f9af000000000000000000000000000000000000000000000000000000008152fd5b60046040517fb562e8dd000000000000000000000000000000000000000000000000000000008152fd5b60046040517f2e076300000000000000000000000000000000000000000000000000000000008152fd5b9060405160a081016040527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608082019360008552935b0192600a90818106603001855304928315615ed9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90615e9d565b92506080837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0920301920191825256fea2646970667358221220fdf813bba190b40ad708e1294664585f393aa810708005f2dc221218df3306dc64736f6c63430008140033

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

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b5a9e5a319c7fda551a30be592c77394bf935c6f000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000023000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699098af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef00000000000000000000000000000000000000000000000000000000000002de00000000000000000000000000000000000ea4af05656c17b90f4d64add29e1d0000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000c8c57e4c73c71f72ca0a7e043e5d2d144f98ef1300000000000000000000000000000000000000000000000000000000000005dc000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000164c6f6f6b735261726520494e46494c54524154494f4e0000000000000000000000000000000000000000000000000000000000000000000000000000000000074c524147454e5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003468747470733a2f2f6170692e6c6f6f6b73726172652e6f72672f6170692f76312f696e66696c74726174696f6e2f6167656e742f000000000000000000000000

-----Decoded View---------------
Arg [0] : constructorCalldata (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
27 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 000000000000000000000000b5a9e5a319c7fda551a30be592c77394bf935c6f
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000260
Arg [3] : 00000000000000000000000000000000000000000000000000000000000002a0
Arg [4] : 00000000000000000000000000000000000000000000000000b1a2bc2ec50000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000023
Arg [8] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000030
Arg [10] : 000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e
Arg [11] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [12] : 8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef
Arg [13] : 00000000000000000000000000000000000000000000000000000000000002de
Arg [14] : 00000000000000000000000000000000000ea4af05656c17b90f4d64add29e1d
Arg [15] : 0000000000000000000000000000000000000000000000056bc75e2d63100000
Arg [16] : 000000000000000000000000c8c57e4c73c71f72ca0a7e043e5d2d144f98ef13
Arg [17] : 00000000000000000000000000000000000000000000000000000000000005dc
Arg [18] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [19] : 00000000000000000000000000000000000000000000000000000000000002e0
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000016
Arg [21] : 4c6f6f6b735261726520494e46494c54524154494f4e00000000000000000000
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [23] : 4c524147454e5400000000000000000000000000000000000000000000000000
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000034
Arg [25] : 68747470733a2f2f6170692e6c6f6f6b73726172652e6f72672f6170692f7631
Arg [26] : 2f696e66696c74726174696f6e2f6167656e742f000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.