creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts/security/ReentrancyGuard.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant _NOT_ENTERED = 1;\n    uint256 private constant _ENTERED = 2;\n\n    uint256 private _status;\n\n    constructor() {\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and make it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        // On the first call to nonReentrant, _notEntered will be true\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n\n        _;\n\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = _NOT_ENTERED;\n    }\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    ) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    function safeTransfer(\n        IERC20 token,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(\n        IERC20 token,\n        address from,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    function safeIncreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        uint256 newAllowance = token.allowance(address(this), spender) + value;\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            uint256 newAllowance = oldAllowance - value;\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        if (returndata.length > 0) {\n            // Return data is optional\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"
      },
      "@openzeppelin/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize, which returns 0 for contracts in\n        // construction, since the code is only stored at the end of the\n        // constructor execution.\n\n        uint256 size;\n        assembly {\n            size := extcodesize(account)\n        }\n        return size > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length > 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"
      },
      "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Trees proofs.\n *\n * The proofs can be generated using the JavaScript library\n * https://github.com/miguelmota/merkletreejs[merkletreejs].\n * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.\n *\n * See `test/utils/cryptography/MerkleProof.test.js` for some examples.\n */\nlibrary MerkleProof {\n    /**\n     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n     * defined by `root`. For this, a `proof` must be provided, containing\n     * sibling hashes on the branch from the leaf to the root of the tree. Each\n     * pair of leaves and each pair of pre-images are assumed to be sorted.\n     */\n    function verify(\n        bytes32[] memory proof,\n        bytes32 root,\n        bytes32 leaf\n    ) internal pure returns (bool) {\n        bytes32 computedHash = leaf;\n\n        for (uint256 i = 0; i < proof.length; i++) {\n            bytes32 proofElement = proof[i];\n\n            if (computedHash <= proofElement) {\n                // Hash(current computed hash + current element of the proof)\n                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));\n            } else {\n                // Hash(current element of the proof + current computed hash)\n                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));\n            }\n        }\n\n        // Check if the computed hash (root) is equal to the provided root\n        return computedHash == root;\n    }\n}\n"
      },
      "contracts/errors/Airdrop.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.18;\n\n/**\n * @title AirdropErrors\n * @author Non-Fungible Technologies, Inc.\n *\n * This file contains all custom errors for the Arcade Token airdrop contract.\n * All errors are prefixed by  \"AA_\" for ArcadeAirdrop. Errors located in one place\n * to make it possible to holistically look at all the failure cases.\n */\n\n// ==================================== ARCADE AIRDROP ======================================\n/// @notice All errors prefixed with AA_, to separate from other contracts in governance.\n\n/**\n * @notice Ensure airdrop claim period has expired before reclaiming tokens.\n */\nerror AA_ClaimingNotExpired();\n\n/**\n * @notice Cannot claim tokens after airdrop has expired.\n */\nerror AA_ClaimingExpired();\n\n/**\n * @notice Cannot claim tokens multiple times.\n */\nerror AA_AlreadyClaimed();\n\n/**\n * @notice Merkle proof not verified. User is not a participant in the airdrop.\n */\nerror AA_NonParticipant();\n\n/**\n * @notice Zero address passed in where not allowed.\n *\n * @param addressType                The name of the parameter for which a zero\n *                                   address was provided.\n */\nerror AA_ZeroAddress(string addressType);\n\n/**\n * @notice Thrown when the merkle root is set to bytes32(0).\n */\nerror AA_NotInitialized();\n"
      },
      "contracts/external/council/libraries/Authorizable.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity >=0.7.0;\n\ncontract Authorizable {\n    // This contract allows a flexible authorization scheme\n\n    // The owner who can change authorization status\n    address public owner;\n    // A mapping from an address to its authorization status\n    mapping(address => bool) public authorized;\n\n    /// @dev We set the deployer to the owner\n    constructor() {\n        owner = msg.sender;\n    }\n\n    /// @dev This modifier checks if the msg.sender is the owner\n    modifier onlyOwner() {\n\n        require(msg.sender == owner, \"Sender not owner\");\n        _;\n\n    }\n\n    /// @dev This modifier checks if an address is authorized\n    modifier onlyAuthorized() {\n        require(isAuthorized(msg.sender), \"Sender not Authorized\");\n        _;\n    }\n\n    /// @dev Returns true if an address is authorized\n    /// @param who the address to check\n    /// @return true if authorized false if not\n    function isAuthorized(address who) public view returns (bool) {\n        return authorized[who];\n    }\n\n    /// @dev Privileged function authorize an address\n    /// @param who the address to authorize\n    function authorize(address who) external onlyOwner() {\n        _authorize(who);\n    }\n\n    /// @dev Privileged function to de authorize an address\n    /// @param who The address to remove authorization from\n    function deauthorize(address who) external onlyOwner() {\n        authorized[who] = false;\n    }\n\n    /// @dev Function to change owner\n    /// @param who The new owner address\n    function setOwner(address who) public onlyOwner() {\n        owner = who;\n    }\n\n    /// @dev Inheritable function which authorizes someone\n    /// @param who the address to authorize\n    function _authorize(address who) internal {\n        authorized[who] = true;\n    }\n}"
      },
      "contracts/external/dao-contracts/interfaces/IAirdropSingleSidedStaking.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.18;\n\ninterface IAirdropSingleSidedStaking {\n    enum Lock {\n        Short,\n        Medium,\n        Long\n    }\n\n    function airdropReceive(\n        address recipient,\n        uint256 amount,\n        address delegation,\n        Lock lock\n    ) external;\n}"
      },
      "contracts/token/airdrop/AirdropSeason1.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.18;\n\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\n\nimport \"./ArcadeAirdropBase.sol\";\n\nimport \"../../external/dao-contracts/interfaces/IAirdropSingleSidedStaking.sol\";\n\nimport { AA_ZeroAddress } from \"../../errors/Airdrop.sol\";\n\n/**\n * @title Airdrop Season 1\n * @author Non-Fungible Technologies, Inc.\n *\n * This contract is used to distribute tokens to users who have been airdropped\n * tokens. The tokens are distributed to the users directly, or users can choose\n * to have thier allocation staked in the ArcadeSingleSidedStaking contract.\n */\ncontract AirdropSeason1 is ArcadeAirdropBase, ReentrancyGuard {\n    using SafeERC20 for IERC20;\n\n    // ============================================ STATE ==============================================\n    /// @notice the voting vault vault which receives airdropped tokens\n    IAirdropSingleSidedStaking public immutable votingVault;\n\n    // ============================================ EVENTS =============================================\n\n    event Claimed(address indexed user, uint128 totalGrant);\n\n    // ========================================== CONSTRUCTOR ==========================================\n    /**\n     * @notice Initiate the contract with a merkle tree root, a token for distribution,\n     *         an expiration time for claims, and the voting vault that tokens will be\n     *         airdropped into.\n     *\n     * @param _token                The token to airdrop\n     * @param _merkleRoot           The merkle root with deposits encoded into it as hash [address, amount]\n     * @param _expiration           The expiration of the airdrop\n     * @param _votingVault          The voting vault to deposit tokens to\n     */\n    constructor(\n        IERC20 _token,\n        bytes32 _merkleRoot,\n        uint256 _expiration,\n        IAirdropSingleSidedStaking _votingVault\n    ) ArcadeAirdropBase(_token, _merkleRoot, _expiration) {\n        if (address(_votingVault) == address(0)) revert AA_ZeroAddress(\"votingVault\");\n\n        votingVault = _votingVault;\n    }\n\n    // ===================================== CLAIM FUNCTIONALITY =======================================\n\n    /**\n     * @notice Claims an amount of tokens in the tree and stakes the tokens in the ArcadeSingleSidedStaking\n     *         contract. The caller can choose who to delegate their voting power to by passing in the\n     *         address of their delegate. If a user already has an active stake in the ArcadeSingleSidedStaking\n     *         voting vault they must use the same delegate address they are already delegating to.\n     *\n     * @param delegate               The address the user will delegate to\n     * @param totalGrant             The total amount of tokens the user was granted\n     * @param merkleProof            The merkle proof showing the user is in the merkle tree\n     * @param lock                   The locking period to apply to the staked tokens\n     */\n    function claimAndStake(\n        address delegate,\n        uint128 totalGrant,\n        bytes32[] calldata merkleProof,\n        IAirdropSingleSidedStaking.Lock lock\n    ) external {\n        _validateWithdraw(totalGrant, merkleProof);\n\n        _setClaimed(msg.sender, totalGrant);\n\n        // approve the voting vault to transfer tokens\n        token.approve(address(votingVault), uint256(totalGrant));\n        // stake tokens in voting vault for this msg.sender and delegate\n        votingVault.airdropReceive(msg.sender, totalGrant, delegate, lock);\n\n        emit Claimed(msg.sender, totalGrant);\n    }\n\n    /**\n     * @notice Claims an amount of tokens in the tree and send them to the caller.\n     *\n     * @param totalGrant             The total amount of tokens the user was granted\n     * @param merkleProof            The merkle proof showing the user is in the merkle tree\n     */\n    function claim(uint128 totalGrant, bytes32[] calldata merkleProof) external nonReentrant {\n        _validateWithdraw(totalGrant, merkleProof);\n\n        _setClaimed(msg.sender, totalGrant);\n\n        // transfer tokens to the caller\n        token.safeTransfer(msg.sender, totalGrant);\n\n        emit Claimed(msg.sender, totalGrant);\n    }\n}\n"
      },
      "contracts/token/airdrop/ArcadeAirdropBase.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.18;\n\nimport \"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport \"../../external/council/libraries/Authorizable.sol\";\n\nimport {\n    AA_ClaimingNotExpired,\n    AA_AlreadyClaimed,\n    AA_NonParticipant,\n    AA_ClaimingExpired,\n    AA_ZeroAddress,\n    AA_NotInitialized\n} from \"../../errors/Airdrop.sol\";\n\n/**\n * @title Arcade Airdrop\n * @author Non-Fungible Technologies, Inc.\n *\n * This contract contains the base functionality for an airdrop. The contract is ownable, where the\n * owner can reclaim any remaining tokens once the airdrop is over and also change the merkle root\n * and expiration at their discretion.\n */\nabstract contract ArcadeAirdropBase is Authorizable {\n    using SafeERC20 for IERC20;\n    // ============================================ STATE ==============================================\n    /// @notice the token to airdrop\n    IERC20 public immutable token;\n\n    /// @notice the merkle root with deposits encoded into it as hash [address, amount]\n    bytes32 public rewardsRoot;\n\n    /// @notice the timestamp expiration of the rewards root\n    uint256 public expiration;\n\n    /// @notice user claim history by merkle root used to claim\n    mapping(address => mapping(bytes32 => uint256)) public claimed;\n\n    // ============================================= EVENTS =============================================\n\n    event SetMerkleRoot(bytes32 indexed merkleRoot, uint256 indexed expiration);\n\n    // ========================================== CONSTRUCTOR ===========================================\n\n    /**\n     * @notice Initiate the contract with a merkle tree root, a token for distribution,\n     *         an expiration time for claims.\n     *\n     * @param _token                The token to airdrop\n     * @param _rewardsRoot          The merkle root with deposits encoded into it as hash [address, amount]\n     * @param _expiration           The expiration of the airdrop\n     */\n    constructor(IERC20 _token, bytes32 _rewardsRoot, uint256 _expiration) {\n        if (address(_token) == address(0)) revert AA_ZeroAddress(\"token\");\n        if (_expiration <= block.timestamp) revert AA_ClaimingExpired();\n\n        token = _token;\n        rewardsRoot = _rewardsRoot;\n        expiration = _expiration;\n    }\n\n    // ======================================= REWARDS VALIDATION ========================================\n\n    /**\n     * @notice Validate a withdraw attempt by checking merkle proof and ensuring the user has not\n     *         previously withdrawn.\n     *\n     * @param totalGrant             The total amount of tokens the user was granted\n     * @param merkleProof            The merkle proof showing the user is in the merkle tree\n     */\n    function _validateWithdraw(uint256 totalGrant, bytes32[] memory merkleProof) internal view {\n        // merkle root must be set\n        if (rewardsRoot == bytes32(0)) revert AA_NotInitialized();\n        // can only claim before the expiration time\n        if (block.timestamp > expiration) revert AA_ClaimingExpired();\n\n        // validate proof and leaf hash\n        bytes32 leafHash = keccak256(abi.encodePacked(msg.sender, totalGrant));\n        if (!MerkleProof.verify(merkleProof, rewardsRoot, leafHash)) revert AA_NonParticipant();\n    }\n\n    // ========================================== HELPERS ===============================================\n\n    /**\n     * @notice Get the claimed amount for a user and merkle root\n     *\n     * @param user                  The user to check\n     * @param merkleRoot            The merkle root to check\n     *\n     * @return claimed              The amount claimed by the user\n     */\n    function getClaimed(address user, bytes32 merkleRoot) external view returns (uint256) {\n        return claimed[user][merkleRoot];\n    }\n\n    /**\n     * @notice Set the claimed amount for a user and merkle root. The user\n     *         cannot claim twice from the same root.\n     *\n     * @param user                  The user to set\n     * @param totalGrant            The total amount claimed\n     */\n    function _setClaimed(address user, uint256 totalGrant) internal {\n        // ensure the user has not already claimed the airdrop for this merkle root\n        if (claimed[user][rewardsRoot] != 0) revert AA_AlreadyClaimed();\n\n        claimed[user][rewardsRoot] = totalGrant;\n    }\n\n    // ===================================== ADMIN FUNCTIONALITY ========================================\n\n    /**\n     * @notice Allows governance to remove the funds in this contract once the airdrop is over.\n     *         This function can only be called after the expiration time.\n     *\n     * @param destination        The address which will receive the remaining tokens\n     */\n    function reclaim(address destination) external onlyOwner {\n        if (block.timestamp <= expiration) revert AA_ClaimingNotExpired();\n        if (destination == address(0)) revert AA_ZeroAddress(\"destination\");\n\n        uint256 unclaimed = token.balanceOf(address(this));\n        token.safeTransfer(destination, unclaimed);\n    }\n\n    /**\n     * @notice Allows the owner to set a merkle root and its expiration timestamp. When creating\n     *         a merkle trie, a users address should not be associated with multiple leaves.\n     *\n     * @param _merkleRoot        The new merkle root\n     * @param _expiration        The new expiration timestamp for this root\n     */\n    function setMerkleRoot(bytes32 _merkleRoot, uint256 _expiration) external onlyOwner {\n        if (_expiration <= block.timestamp) revert AA_ClaimingExpired();\n\n        rewardsRoot = _merkleRoot;\n        expiration = _expiration;\n\n        emit SetMerkleRoot(_merkleRoot, _expiration);\n    }\n}\n"
      }
    },
    "settings": {
      "metadata": {
        "bytecodeHash": "none"
      },
      "optimizer": {
        "enabled": true,
        "runs": 999999
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}