creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts/access/Ownable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable is Context {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    constructor () internal {\n        address msgSender = _msgSender();\n        _owner = msgSender;\n        emit OwnershipTransferred(address(0), msgSender);\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        emit OwnershipTransferred(_owner, address(0));\n        _owner = address(0);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        emit OwnershipTransferred(_owner, newOwner);\n        _owner = newOwner;\n    }\n}\n"
      },
      "@openzeppelin/contracts/GSN/Context.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address payable) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes memory) {\n        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n        return msg.data;\n    }\n}\n"
      },
      "@openzeppelin/contracts/introspection/ERC165.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts may inherit from this and call {_registerInterface} to declare\n * their support of an interface.\n */\ncontract ERC165 is IERC165 {\n    /*\n     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7\n     */\n    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;\n\n    /**\n     * @dev Mapping of interface ids to whether or not it's supported.\n     */\n    mapping(bytes4 => bool) private _supportedInterfaces;\n\n    constructor () internal {\n        // Derived contracts need only register support for their own interfaces,\n        // we register support for ERC165 itself here\n        _registerInterface(_INTERFACE_ID_ERC165);\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     *\n     * Time complexity O(1), guaranteed to always use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n        return _supportedInterfaces[interfaceId];\n    }\n\n    /**\n     * @dev Registers the contract as an implementer of the interface defined by\n     * `interfaceId`. Support of the actual ERC165 interface is automatic and\n     * registering its interface id is not required.\n     *\n     * See {IERC165-supportsInterface}.\n     *\n     * Requirements:\n     *\n     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).\n     */\n    function _registerInterface(bytes4 interfaceId) internal virtual {\n        require(interfaceId != 0xffffffff, \"ERC165: invalid interface id\");\n        _supportedInterfaces[interfaceId] = true;\n    }\n}\n"
      },
      "@openzeppelin/contracts/introspection/IERC165.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
      },
      "@openzeppelin/contracts/math/SafeMath.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c >= a, \"SafeMath: addition overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        return sub(a, b, \"SafeMath: subtraction overflow\");\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b <= a, errorMessage);\n        uint256 c = a - b;\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n        // benefit is lost if 'b' is also tested.\n        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n        if (a == 0) {\n            return 0;\n        }\n\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers. Reverts on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        return div(a, b, \"SafeMath: division by zero\");\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        uint256 c = a / b;\n        // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n        return c;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * Reverts when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        return mod(a, b, \"SafeMath: modulo by zero\");\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * Reverts with custom message when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b != 0, errorMessage);\n        return a % b;\n    }\n}\n"
      },
      "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.2;\n\nimport \"../../introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n    /**\n     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n     */\n    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n    /**\n     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n     * transfers.\n     */\n    event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);\n\n    /**\n     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n     * `approved`.\n     */\n    event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n    /**\n     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n     *\n     * If an {URI} event was emitted for `id`, the standard\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n     * returned by {IERC1155MetadataURI-uri}.\n     */\n    event URI(string value, uint256 indexed id);\n\n    /**\n     * @dev Returns the amount of tokens of token type `id` owned by `account`.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function balanceOf(address account, uint256 id) external view returns (uint256);\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n     *\n     * Requirements:\n     *\n     * - `accounts` and `ids` must have the same length.\n     */\n    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);\n\n    /**\n     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n     *\n     * Emits an {ApprovalForAll} event.\n     *\n     * Requirements:\n     *\n     * - `operator` cannot be the caller.\n     */\n    function setApprovalForAll(address operator, bool approved) external;\n\n    /**\n     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n     *\n     * See {setApprovalForAll}.\n     */\n    function isApprovedForAll(address account, address operator) external view returns (bool);\n\n    /**\n     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n     * - `from` must have a balance of tokens of type `id` of at least `amount`.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n     * acceptance magic value.\n     */\n    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - `ids` and `amounts` must have the same length.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n     * acceptance magic value.\n     */\n    function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/ERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"../../GSN/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n    using SafeMath for uint256;\n    using Address for address;\n\n    mapping (address => uint256) private _balances;\n\n    mapping (address => mapping (address => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n    uint8 private _decimals;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n     * a default value of 18.\n     *\n     * To select a different value for {decimals}, use {_setupDecimals}.\n     *\n     * All three of these values are immutable: they can only be set once during\n     * construction.\n     */\n    constructor (string memory name, string memory symbol) public {\n        _name = name;\n        _symbol = symbol;\n        _decimals = 18;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n     * called.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view returns (uint8) {\n        return _decimals;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view override returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view override returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `recipient` cannot be the zero address.\n     * - the caller must have a balance of at least `amount`.\n     */\n    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\n        _transfer(_msgSender(), recipient, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual override returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 amount) public virtual override returns (bool) {\n        _approve(_msgSender(), spender, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20};\n     *\n     * Requirements:\n     * - `sender` and `recipient` cannot be the zero address.\n     * - `sender` must have a balance of at least `amount`.\n     * - the caller must have allowance for ``sender``'s tokens of at least\n     * `amount`.\n     */\n    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\n        _transfer(sender, recipient, amount);\n        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n        return true;\n    }\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n        return true;\n    }\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `subtractedValue`.\n     */\n    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n        return true;\n    }\n\n    /**\n     * @dev Moves tokens `amount` from `sender` to `recipient`.\n     *\n     * This is internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * Requirements:\n     *\n     * - `sender` cannot be the zero address.\n     * - `recipient` cannot be the zero address.\n     * - `sender` must have a balance of at least `amount`.\n     */\n    function _transfer(address sender, address recipient, uint256 amount) internal virtual {\n        require(sender != address(0), \"ERC20: transfer from the zero address\");\n        require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n        _beforeTokenTransfer(sender, recipient, amount);\n\n        _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n        _balances[recipient] = _balances[recipient].add(amount);\n        emit Transfer(sender, recipient, amount);\n    }\n\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n     * the total supply.\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * Requirements\n     *\n     * - `to` cannot be the zero address.\n     */\n    function _mint(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: mint to the zero address\");\n\n        _beforeTokenTransfer(address(0), account, amount);\n\n        _totalSupply = _totalSupply.add(amount);\n        _balances[account] = _balances[account].add(amount);\n        emit Transfer(address(0), account, amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, reducing the\n     * total supply.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * Requirements\n     *\n     * - `account` cannot be the zero address.\n     * - `account` must have at least `amount` tokens.\n     */\n    function _burn(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: burn from the zero address\");\n\n        _beforeTokenTransfer(account, address(0), amount);\n\n        _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n        _totalSupply = _totalSupply.sub(amount);\n        emit Transfer(account, address(0), amount);\n    }\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     */\n    function _approve(address owner, address spender, uint256 amount) internal virtual {\n        require(owner != address(0), \"ERC20: approve from the zero address\");\n        require(spender != address(0), \"ERC20: approve to the zero address\");\n\n        _allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    /**\n     * @dev Sets {decimals} to a value other than the default one of 18.\n     *\n     * WARNING: This function should only be called from the constructor. Most\n     * applications that interact with token contracts will not expect\n     * {decimals} to ever change, and may work incorrectly if it does.\n     */\n    function _setupDecimals(uint8 decimals_) internal {\n        _decimals = decimals_;\n    }\n\n    /**\n     * @dev Hook that is called before any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * will be to transferred to `to`.\n     * - when `from` is zero, `amount` tokens will be minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.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(address sender, address recipient, uint256 amount) 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/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.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 SafeMath for uint256;\n    using Address for address;\n\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) 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(IERC20 token, address spender, uint256 value) 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        // solhint-disable-next-line max-line-length\n        require((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(IERC20 token, address spender, uint256 value) internal {\n        uint256 newAllowance = token.allowance(address(this), spender).add(value);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\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) { // Return data is optional\n            // solhint-disable-next-line max-line-length\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"
      },
      "@openzeppelin/contracts/token/ERC721/IERC721.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.2;\n\nimport \"../../introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n    /**\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n     */\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n     */\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n    /**\n     * @dev Returns the number of tokens in ``owner``'s account.\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId) external view returns (address owner);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n     * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Transfers `tokenId` token from `from` to `to`.\n     *\n     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n     * The approval is cleared when the token is transferred.\n     *\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n     *\n     * Requirements:\n     *\n     * - The caller must own the token or be an approved operator.\n     * - `tokenId` must exist.\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address to, uint256 tokenId) external;\n\n    /**\n     * @dev Returns the account approved for `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function getApproved(uint256 tokenId) external view returns (address operator);\n\n    /**\n     * @dev Approve or remove `operator` as an operator for the caller.\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n     *\n     * Requirements:\n     *\n     * - The `operator` cannot be the caller.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function setApprovalForAll(address operator, bool _approved) external;\n\n    /**\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n     *\n     * See {setApprovalForAll}\n     */\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n    /**\n      * @dev Safely transfers `tokenId` token from `from` to `to`.\n      *\n      * Requirements:\n      *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n      * - `tokenId` token must exist and be owned by `from`.\n      * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n      * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n      *\n      * Emits a {Transfer} event.\n      */\n    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n}\n"
      },
      "@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.2;\n\nimport \"./IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n\n    /**\n     * @dev Returns the total amount of tokens stored by the contract.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n     */\n    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);\n\n    /**\n     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n     * Use along with {totalSupply} to enumerate all tokens.\n     */\n    function tokenByIndex(uint256 index) external view returns (uint256);\n}\n"
      },
      "@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.2;\n\nimport \"./IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n\n    /**\n     * @dev Returns the token collection name.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the token collection symbol.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n     */\n    function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n"
      },
      "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n    /**\n     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n     * by `operator` from `from`, this function is called.\n     *\n     * It must return its Solidity selector to confirm the token transfer.\n     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n     *\n     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n     */\n    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)\n    external returns (bytes4);\n}\n"
      },
      "@openzeppelin/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.2;\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 in 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        // solhint-disable-next-line no-inline-assembly\n        assembly { size := extcodesize(account) }\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        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\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(address target, bytes memory data, string memory errorMessage) 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(address target, bytes memory data, uint256 value) 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(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        return _functionCallWithValue(target, data, value, errorMessage);\n    }\n\n    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {\n        require(isContract(target), \"Address: call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);\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                // solhint-disable-next-line no-inline-assembly\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/ReentrancyGuard.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.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 */\ncontract 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 () internal {\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"
      },
      "contracts/v1/interfaces/ILepton.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\n// ILepton.sol -- Part of the Charged Particles Protocol\n// Copyright (c) 2021 Firma Lux, Inc. <https://charged.fi>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\npragma solidity >=0.6.0;\n\n/**\n * @title Charged Particles Lepton Interface\n * @dev ...\n */\ninterface ILepton {\n\n  struct Classification {\n    string tokenUri;\n    uint256 price;\n    uint128 _upperBounds;\n    uint32 supply;\n    uint32 multiplier;\n    uint32 bonus;\n  }\n\n  function mintLepton() external payable returns (uint256 newTokenId);\n  function batchMintLepton(uint256 count) external payable;\n  function getNextType() external view returns (uint256);\n  function getNextPrice() external view returns (uint256);\n  function getMultiplier(uint256 tokenId) external view returns (uint256);\n  function getBonus(uint256 tokenId) external view returns (uint256);\n\n\n  event MaxMintPerTxSet(uint256 maxAmount);\n  event LeptonTypeAdded(string tokenUri, uint256 price, uint32 supply, uint32 multiplier, uint32 bonus, uint256 upperBounds);\n  event LeptonTypeUpdated(uint256 leptonIndex, string tokenUri, uint256 price, uint32 supply, uint32 multiplier, uint32 bonus, uint256 upperBounds);\n  event LeptonMinted(address indexed receiver, uint256 indexed tokenId, uint256 price, uint32 multiplier);\n  event LeptonBatchMinted(address indexed receiver, uint256 indexed tokenId, uint256 count, uint256 price, uint32 multiplier);\n  event PausedStateSet(bool isPaused);\n}\n"
      },
      "contracts/v1/leptons/store.sol": {
        "content": "pragma solidity 0.6.12;\n\nimport \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"../lib/BlackholePrevention.sol\";\nimport \"../tokens/Ionx.sol\";\nimport \"../tokens/Lepton2.sol\";\n\ninterface ILepsonsStore {\n   function load(uint256 amount) external payable;\n   function setLepton(address _lepton) external;\n}\n\ncontract LeptonsStore is ILepsonsStore, IERC721Receiver, Ownable, BlackholePrevention {\n  using SafeMath for uint256;\n\n  event SoldLepton(address indexed buyer, uint256 amount, uint256 price);\n\n  Lepton2 public lepton;\n  Ionx public ionx;\n\n  uint256 public nextTokenId;\n  uint256 public ionxPerLepton;\n\n  constructor(address _lepton, address _ionx, uint256 _ionxPerLepton) public {\n    lepton = Lepton2(_lepton);\n    ionx = Ionx(_ionx);\n    ionxPerLepton = _ionxPerLepton;\n  }\n\n  function buyWithIonx(\n    uint256 leptonAmount,\n    uint256 deadline,\n    uint8 v,\n    bytes32 r,\n    bytes32 s\n  ) external {\n    uint256 ionxAmount = leptonAmount * ionxPerLepton;\n    require(ionx.balanceOf(msg.sender) >= ionxAmount, \"Insufficient IONX balance\");\n\n    ionx.permit(msg.sender, address(this), ionxAmount, deadline, v, r, s);\n    ionx.transferFrom(msg.sender, address(this), ionxAmount);\n\n    for (uint256 i = 0; i < leptonAmount; ++i) {\n      uint256 tokenId = nextTokenId;\n      nextTokenId = nextTokenId.add(1);\n\n      lepton.safeTransferFrom(address(this), msg.sender, tokenId);\n    }\n\n    emit SoldLepton(msg.sender, leptonAmount, ionxAmount);\n  }\n\n  function onERC721Received(address, address, uint256, bytes calldata) external override returns (bytes4) {\n    return IERC721Receiver.onERC721Received.selector;\n  }\n\n  /***********************************|\n  |          Only Admin/DAO           |\n  |__________________________________*/\n\n  function load(uint256 amount) external payable override onlyOwner {\n    require(lepton.balanceOf(address(this)) == 0, \"store not empty\");\n    nextTokenId =  lepton.totalSupply().add(1);\n    lepton.batchMintLepton{ value: msg.value }(amount);\n  }\n\n  function setLepton(address _lepton) external override onlyOwner {\n    require(_lepton != address(0), \"Invalid address\");\n    lepton = Lepton2(_lepton);\n  }\n\n  function setIonx(address _ionx) external onlyOwner {\n    require(_ionx != address(0), \"Invalid address\");\n    ionx = Ionx(_ionx);\n  }\n\n  function setIonxPerLepton(uint256 ionxAmount) external onlyOwner {\n    ionxPerLepton = ionxAmount;\n  }\n\n  /***********************************|\n  |          Only Admin/DAO           |\n  |      (blackhole prevention)       |\n  |__________________________________*/\n\n  function withdrawEther(address payable receiver, uint256 amount) external onlyOwner {\n    _withdrawEther(receiver, amount);\n  }\n\n  function withdrawErc20(address payable receiver, address tokenAddress, uint256 amount) external onlyOwner {\n    _withdrawERC20(receiver, tokenAddress, amount);\n  }\n\n  function withdrawERC721(address payable receiver, address tokenAddress, uint256 tokenId) external onlyOwner {\n    _withdrawERC721(receiver, tokenAddress, tokenId);\n  }\n\n  function withdrawERC1155(address payable receiver, address tokenAddress, uint256 tokenId, uint256 amount) external onlyOwner {\n    _withdrawERC1155(receiver, tokenAddress, tokenId, amount);\n  }\n}"
      },
      "contracts/v1/lib/BlackholePrevention.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\n// BlackholePrevention.sol -- Part of the Charged Particles Protocol\n// Copyright (c) 2021 Firma Lux, Inc. <https://charged.fi>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\npragma solidity >=0.6.0;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\n\n/**\n * @notice Prevents ETH or Tokens from getting stuck in a contract by allowing\n *  the Owner/DAO to pull them out on behalf of a user\n * This is only meant to contracts that are not expected to hold tokens, but do handle transferring them.\n */\ncontract BlackholePrevention {\n  using Address for address payable;\n  using SafeERC20 for IERC20;\n\n  event WithdrawStuckEther(address indexed receiver, uint256 amount);\n  event WithdrawStuckERC20(address indexed receiver, address indexed tokenAddress, uint256 amount);\n  event WithdrawStuckERC721(address indexed receiver, address indexed tokenAddress, uint256 indexed tokenId);\n  event WithdrawStuckERC1155(address indexed receiver, address indexed tokenAddress, uint256 indexed tokenId, uint256 amount);\n\n  function _withdrawEther(address payable receiver, uint256 amount) internal virtual {\n    require(receiver != address(0x0), \"BHP:E-403\");\n    if (address(this).balance >= amount) {\n      receiver.sendValue(amount);\n      emit WithdrawStuckEther(receiver, amount);\n    }\n  }\n\n  function _withdrawERC20(address payable receiver, address tokenAddress, uint256 amount) internal virtual {\n    require(receiver != address(0x0), \"BHP:E-403\");\n    if (IERC20(tokenAddress).balanceOf(address(this)) >= amount) {\n      IERC20(tokenAddress).safeTransfer(receiver, amount);\n      emit WithdrawStuckERC20(receiver, tokenAddress, amount);\n    }\n  }\n\n  function _withdrawERC721(address payable receiver, address tokenAddress, uint256 tokenId) internal virtual {\n    require(receiver != address(0x0), \"BHP:E-403\");\n    if (IERC721(tokenAddress).ownerOf(tokenId) == address(this)) {\n      IERC721(tokenAddress).transferFrom(address(this), receiver, tokenId);\n      emit WithdrawStuckERC721(receiver, tokenAddress, tokenId);\n    }\n  }\n\n  function _withdrawERC1155(address payable receiver, address tokenAddress, uint256 tokenId, uint256 amount) internal virtual {\n    require(receiver != address(0x0), \"BHP:E-403\");\n    if (IERC1155(tokenAddress).balanceOf(address(this), tokenId) >= amount) {\n      IERC1155(tokenAddress).safeTransferFrom(address(this), receiver, tokenId, amount, \"\");\n      emit WithdrawStuckERC1155(receiver, tokenAddress, tokenId, amount);\n    }\n  }\n}\n"
      },
      "contracts/v1/lib/ERC721Basic.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\nimport \"@openzeppelin/contracts/GSN/Context.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport \"@openzeppelin/contracts/introspection/ERC165.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title ERC721 Non-Fungible Token Standard basic implementation\n * @dev see https://eips.ethereum.org/EIPS/eip-721\n */\ncontract ERC721Basic is Context, ERC165, IERC721, IERC721Metadata {\n  using SafeMath for uint256;\n  using Address for address;\n\n  // Equals to `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n  // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`\n  bytes4 internal constant _ERC721_RECEIVED = 0x150b7a02;\n\n  // mapping from token ids to their owners\n  mapping (uint256 => address) internal _tokenOwners;\n\n  // mapping from owner to token balance\n  mapping (address => uint256) internal _ownerBalance;\n\n  // Mapping from token ID to approved address\n  mapping (uint256 => address) internal _tokenApprovals;\n\n  // Mapping from owner to operator approvals\n  mapping (address => mapping (address => bool)) internal _operatorApprovals;\n\n  // Token name\n  string internal _name;\n\n  // Token symbol\n  string internal _symbol;\n\n  // Token Count\n  uint256 internal _tokenCount;\n\n  /*\n    *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231\n    *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e\n    *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3\n    *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc\n    *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465\n    *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5\n    *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd\n    *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e\n    *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde\n    *\n    *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^\n    *        0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd\n    */\n  bytes4 internal constant _INTERFACE_ID_ERC721 = 0x80ac58cd;\n\n  /*\n    *     bytes4(keccak256('name()')) == 0x06fdde03\n    *     bytes4(keccak256('symbol()')) == 0x95d89b41\n    *     bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd\n    *\n    *     => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f\n    */\n  bytes4 internal constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;\n\n  /**\n    * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n    */\n  constructor (string memory name, string memory symbol) public {\n    _name = name;\n    _symbol = symbol;\n\n    // register the supported interfaces to conform to ERC721 via ERC165\n    _registerInterface(_INTERFACE_ID_ERC721);\n    _registerInterface(_INTERFACE_ID_ERC721_METADATA);\n  }\n\n  /**\n    * @dev See {IERC721-balanceOf}.\n    */\n  function balanceOf(address owner) public view override returns (uint256) {\n    require(owner != address(0), \"ERC721:E-403\");\n    return _ownerBalance[owner];\n  }\n\n  /**\n    * @dev See {IERC721-ownerOf}.\n    */\n  function ownerOf(uint256 tokenId) public view override returns (address) {\n    return _tokenOwners[tokenId];\n  }\n\n  /**\n    * @dev See {IERC721Metadata-name}.\n    */\n  function name() public view override returns (string memory) {\n    return _name;\n  }\n\n  /**\n    * @dev See {IERC721Metadata-symbol}.\n    */\n  function symbol() public view override returns (string memory) {\n    return _symbol;\n  }\n\n  /**\n    * @dev See {IERC721Metadata-tokenURI}.\n    */\n  function tokenURI(uint256 /* tokenId */) public view virtual override returns (string memory) {\n    return \"\";\n  }\n\n  /**\n    * @dev See {IERC721-approve}.\n    */\n  function approve(address to, uint256 tokenId) public virtual override {\n    address owner = ownerOf(tokenId);\n    require(to != owner, \"ERC721:E-111\");\n\n    require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), \"ERC721:E-105\");\n\n    _approve(to, tokenId);\n  }\n\n  /**\n    * @dev See {IERC721-getApproved}.\n    */\n  function getApproved(uint256 tokenId) public view override returns (address) {\n    require(_exists(tokenId), \"ERC721:E-405\");\n    return _tokenApprovals[tokenId];\n  }\n\n  /**\n    * @dev See {IERC721-setApprovalForAll}.\n    */\n  function setApprovalForAll(address operator, bool approved) public virtual override {\n    require(operator != _msgSender(), \"ERC721:E-111\");\n\n    _operatorApprovals[_msgSender()][operator] = approved;\n    emit ApprovalForAll(_msgSender(), operator, approved);\n  }\n\n  /**\n    * @dev See {IERC721-isApprovedForAll}.\n    */\n  function isApprovedForAll(address owner, address operator) public view override returns (bool) {\n    return _operatorApprovals[owner][operator];\n  }\n\n  /**\n    * @dev See {IERC721-transferFrom}.\n    */\n  function transferFrom(address from, address to, uint256 tokenId) public virtual override {\n    //solhint-disable-next-line max-line-length\n    require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721:E-105\");\n\n    _transfer(from, to, tokenId);\n  }\n\n  /**\n    * @dev See {IERC721-safeTransferFrom}.\n    */\n  function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {\n    safeTransferFrom(from, to, tokenId, \"\");\n  }\n\n  /**\n    * @dev See {IERC721-safeTransferFrom}.\n    */\n  function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {\n    require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721:E-105\");\n    _safeTransfer(from, to, tokenId, _data);\n  }\n\n  /**\n    * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n    * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n    *\n    * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n    *\n    * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n    * implement alternative mecanisms to perform token transfer, such as signature-based.\n    *\n    * Requirements:\n    *\n    * - `from` cannot be the zero address.\n    * - `to` cannot be the zero address.\n    * - `tokenId` token must exist and be owned by `from`.\n    * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n    *\n    * Emits a {Transfer} event.\n    */\n  function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {\n    _transfer(from, to, tokenId);\n    require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721:E-402\");\n  }\n\n  /**\n    * @dev Returns whether `tokenId` exists.\n    *\n    * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n    *\n    * Tokens start existing when they are minted (`_mint`),\n    * and stop existing when they are burned (`_burn`).\n    */\n  function _exists(uint256 tokenId) internal view returns (bool) {\n    return _tokenOwners[tokenId] != address(0x0);\n  }\n\n  /**\n    * @dev Returns whether `spender` is allowed to manage `tokenId`.\n    *\n    * Requirements:\n    *\n    * - `tokenId` must exist.\n    */\n  function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {\n    require(_exists(tokenId), \"ERC721:E-405\");\n    address owner = ownerOf(tokenId);\n    return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n  }\n\n  /**\n    * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n    * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n    */\n  function _safeMint(address to, bytes memory _data) internal virtual returns (uint256) {\n    uint256 tokenId = _mint(to);\n    require(_checkOnERC721Received(address(0), to, tokenId, _data), \"ERC721:E-402\");\n    return tokenId;\n  }\n\n  /**\n    * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n    * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n    */\n  function _safeMintBatch(address to, uint256 count, bytes memory _data) internal virtual {\n    uint256 startTokenId = _mintBatch(to, count);\n    require(_checkOnERC721Received(address(0), to, startTokenId, _data), \"ERC721:E-402\");\n  }\n\n  /**\n    * @dev Mints `tokenId` and transfers it to `to`.\n    *\n    * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n    *\n    * Requirements:\n    *\n    * - `tokenId` must not exist.\n    * - `to` cannot be the zero address.\n    *\n    * Emits a {Transfer} event.\n    */\n  function _mint(address to) internal virtual returns (uint256) {\n    require(to != address(0), \"ERC721:E-403\");\n\n    _tokenCount = _tokenCount.add(1);\n    uint256 tokenId = _tokenCount;\n    require(!_exists(tokenId), \"ERC721:E-407\");\n\n    _tokenOwners[tokenId] = to;\n    _ownerBalance[to] = _ownerBalance[to].add(1);\n\n    emit Transfer(address(0), to, tokenId);\n    return tokenId;\n  }\n\n  /**\n    * @dev Mints `tokenId` and transfers it to `to`.\n    *\n    * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n    *\n    * Requirements:\n    *\n    * - `tokenId` must not exist.\n    * - `to` cannot be the zero address.\n    *\n    * Emits a {Transfer} event.\n    */\n  function _mintBatch(address to, uint256 count) internal virtual returns (uint256) {\n    require(to != address(0), \"ERC721:E-403\");\n\n    uint256 startTokenId = _tokenCount.add(1);\n    for (uint i = 1; i <= count; i++) {\n      uint256 tokenId = _tokenCount.add(i);\n      _tokenOwners[tokenId] = to;\n      emit Transfer(address(0), to, tokenId);\n    }\n\n    _tokenCount = _tokenCount.add(count);\n    _ownerBalance[to] = _ownerBalance[to].add(count);\n    return startTokenId;\n  }\n\n  /**\n    * @dev Transfers `tokenId` from `from` to `to`.\n    *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n    *\n    * Requirements:\n    *\n    * - `to` cannot be the zero address.\n    * - `tokenId` token must be owned by `from`.\n    *\n    * Emits a {Transfer} event.\n    */\n  function _transfer(address from, address to, uint256 tokenId) internal virtual {\n    require(ownerOf(tokenId) == from, \"ERC721:E-102\");\n    require(to != address(0), \"ERC721:E-403\");\n\n    // Clear approvals from the previous owner\n    _approve(address(0), tokenId);\n\n    _tokenOwners[tokenId] = to;\n    _ownerBalance[from] = _ownerBalance[from].sub(1);\n    _ownerBalance[to] = _ownerBalance[to].add(1);\n\n    emit Transfer(from, to, tokenId);\n  }\n\n  /**\n    * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n    * The call is not executed if the target address is not a contract.\n    *\n    * @param from address representing the previous owner of the given token ID\n    * @param to target address that will receive the tokens\n    * @param tokenId uint256 ID of the token to be transferred\n    * @param _data bytes optional data to send along with the call\n    * @return bool whether the call correctly returned the expected magic value\n    */\n  function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)\n    internal returns (bool)\n  {\n    if (!to.isContract()) {\n      return true;\n    }\n    bytes memory returndata = to.functionCall(abi.encodeWithSelector(\n      IERC721Receiver(to).onERC721Received.selector,\n      _msgSender(),\n      from,\n      tokenId,\n      _data\n    ), \"ERC721:E-402\");\n    bytes4 retval = abi.decode(returndata, (bytes4));\n    return (retval == _ERC721_RECEIVED);\n  }\n\n  function _approve(address to, uint256 tokenId) internal {\n    _tokenApprovals[tokenId] = to;\n    emit Approval(ownerOf(tokenId), to, tokenId);\n  }\n}\n"
      },
      "contracts/v1/tokens/Ionx.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\n// Ionx.sol -- Part of the Charged Particles Protocol\n// Copyright (c) 2021 Firma Lux, Inc. <https://charged.fi>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\npragma solidity 0.6.12;\n\nimport \"erc20permit/contracts/ERC20Permit.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"../lib/BlackholePrevention.sol\";\n\n\ncontract Ionx is ERC20Permit, Ownable, BlackholePrevention {\n  using SafeMath for uint256;\n\n  /// @notice An event thats emitted when the minter address is changed\n  event MinterChanged(address minter, address newMinter);\n\n  /// @notice Total number of tokens in circulation\n  uint256 constant public INITIAL_SUPPLY = 1e8 ether;\n\n  /// @notice Minimum time between mints\n  uint32 public constant INFLATION_EPOCH = 1 days * 365;\n\n  /// @notice Cap on the percentage of totalSupply that can be minted at each mint\n  uint8 public constant INFLATION_CAP = 2;\n\n  /// @notice Address which may mint new tokens\n  address public minter;\n\n  /// @notice The timestamp after which minting may occur\n  uint256 public mintingAllowedAfter;\n\n\n  constructor() public ERC20Permit(\"Charged Particles - IONX\", \"IONX\") {}\n\n\n  /**\n    * @notice Change the minter address\n    * @param newMinter The address of the new minter\n    */\n  function setMinter(address newMinter) external onlyOwner {\n    emit MinterChanged(minter, newMinter);\n    minter = newMinter;\n  }\n\n  /**\n    * @notice Mint new tokens\n    * @param receiver The address of the destination account\n    * @param amount The number of tokens to be minted\n    */\n  function mint(address receiver, uint256 amount) external onlyMinter {\n    require(block.timestamp >= mintingAllowedAfter, \"Ionx:E-114\");\n    require(receiver != address(0), \"Ionx:E-403\");\n\n    uint256 amountToMint = amount;\n    uint256 _totalSupply = totalSupply();\n\n    // From Inflationary Supply\n    if (_totalSupply >= INITIAL_SUPPLY) {\n      mintingAllowedAfter = mintingAllowedAfter.add(INFLATION_EPOCH);\n      amountToMint = _totalSupply.mul(INFLATION_CAP).div(100);\n    }\n\n    // From Initial Supply\n    else {\n      if (_totalSupply.add(amountToMint) > INITIAL_SUPPLY) {\n        amountToMint = INITIAL_SUPPLY.sub(_totalSupply);\n      }\n      if (_totalSupply.add(amountToMint) == INITIAL_SUPPLY) {\n        mintingAllowedAfter = block.timestamp.add(INFLATION_EPOCH);\n      }\n    }\n\n    // transfer the amount to the recipient\n    _mint(receiver, amountToMint);\n  }\n\n  // Note: This contract should never hold ETH, if any is accidentally sent in then the DAO can return it\n  function withdrawEther(address payable receiver, uint256 amount) external onlyOwner {\n    _withdrawEther(receiver, amount);\n  }\n\n  // Note: This contract should never hold any tokens, if any are accidentally sent in then the DAO can return them\n  function withdrawErc20(address payable receiver, address tokenAddress, uint256 amount) external onlyOwner {\n    _withdrawERC20(receiver, tokenAddress, amount);\n  }\n\n  // Note: This contract should never hold any tokens, if any are accidentally sent in then the DAO can return them\n  function withdrawERC721(address payable receiver, address tokenAddress, uint256 tokenId) external onlyOwner {\n    _withdrawERC721(receiver, tokenAddress, tokenId);\n  }\n\n  modifier onlyMinter() {\n    require(msg.sender == minter, \"Ionx:E-113\");\n    _;\n  }\n}\n"
      },
      "contracts/v1/tokens/Lepton2.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\n// Lepton2.sol -- Part of the Charged Particles Protocol\n// Copyright (c) 2021 Firma Lux, Inc. <https://charged.fi>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\npragma solidity 0.6.12;\n\nimport \"../lib/ERC721Basic.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol\";\n\nimport \"../interfaces/ILepton.sol\";\nimport \"../lib/BlackholePrevention.sol\";\n\ncontract Lepton2 is ILepton, ERC721Basic, Ownable, ReentrancyGuard, BlackholePrevention {\n  using SafeMath for uint256;\n  using Address for address payable;\n\n  Classification[] internal _leptonTypes;\n\n  uint256 internal _typeIndex;\n  uint256 internal _maxSupply;\n  uint256 internal _maxMintPerTx;\n  uint256 internal _migratedCount;\n\n  bool internal _paused;\n  bool internal _migrationComplete;\n\n\n  /***********************************|\n  |          Initialization           |\n  |__________________________________*/\n\n  constructor() public ERC721Basic(\"Charged Particles - Lepton2\", \"LEPTON2\") {\n    _paused = true;\n    _migrationComplete = false;\n    _migratedCount = 0;\n  }\n\n\n  /***********************************|\n  |              Public               |\n  |__________________________________*/\n\n  function mintLepton() external payable override nonReentrant whenNotPaused returns (uint256 newTokenId) {\n    newTokenId = _mintLepton(msg.sender);\n  }\n\n  function batchMintLepton(uint256 count) external payable override nonReentrant whenNotPaused {\n    _batchMintLepton(msg.sender, count);\n  }\n\n  function totalSupply() public view returns (uint256) {\n    return _tokenCount;\n  }\n\n  function maxSupply() external view returns (uint256) {\n    return _maxSupply;\n  }\n\n  function getNextType() external view override returns (uint256) {\n    if (_typeIndex >= _leptonTypes.length) { return 0; }\n    return _typeIndex;\n  }\n\n  function getNextPrice() external view override returns (uint256) {\n    if (_typeIndex >= _leptonTypes.length) { return 0; }\n    return _leptonTypes[_typeIndex].price;\n  }\n\n  function getMultiplier(uint256 tokenId) external view override returns (uint256) {\n    require(_exists(tokenId), \"LPT:E-405\");\n    return _getLepton(tokenId).multiplier;\n  }\n\n  function getBonus(uint256 tokenId) external view override returns (uint256) {\n    require(_exists(tokenId), \"LPT:E-405\");\n    return _getLepton(tokenId).bonus;\n  }\n\n  function tokenURI(uint256 tokenId) public view override returns (string memory) {\n    require(_exists(tokenId), \"LPT:E-405\");\n    return _getLepton(tokenId).tokenUri;\n  }\n\n  /***********************************|\n  |          Only Admin/DAO           |\n  |__________________________________*/\n\n  function addLeptonType(\n    string calldata tokenUri,\n    uint256 price,\n    uint32 supply,\n    uint32 multiplier,\n    uint32 bonus\n  )\n    external\n    onlyOwner\n  {\n    _maxSupply = _maxSupply.add(uint256(supply));\n\n    Classification memory lepton = Classification({\n      tokenUri: tokenUri,\n      price: price,\n      supply: supply,\n      multiplier: multiplier,\n      bonus: bonus,\n      _upperBounds: uint128(_maxSupply)\n    });\n    _leptonTypes.push(lepton);\n\n    emit LeptonTypeAdded(tokenUri, price, supply, multiplier, bonus, _maxSupply);\n  }\n\n  function updateLeptonType(\n    uint256 leptonIndex,\n    string calldata tokenUri,\n    uint256 price,\n    uint32 supply,\n    uint32 multiplier,\n    uint32 bonus\n  )\n    external\n    onlyOwner\n  {\n    _leptonTypes[leptonIndex].tokenUri = tokenUri;\n    _leptonTypes[leptonIndex].price = price;\n    _leptonTypes[leptonIndex].supply = supply;\n    _leptonTypes[leptonIndex].multiplier = multiplier;\n    _leptonTypes[leptonIndex].bonus = bonus;\n\n    emit LeptonTypeUpdated(leptonIndex, tokenUri, price, supply, multiplier, bonus, _maxSupply);\n  }\n\n  function setMaxMintPerTx(uint256 maxAmount) external onlyOwner {\n    _maxMintPerTx = maxAmount;\n    emit MaxMintPerTxSet(maxAmount);\n  }\n\n  function setPausedState(bool state) external onlyOwner {\n    _paused = state;\n    emit PausedStateSet(state);\n  }\n\n\n  /***********************************|\n  |          Only Admin/DAO           |\n  |      (blackhole prevention)       |\n  |__________________________________*/\n\n  function withdrawEther(address payable receiver, uint256 amount) external onlyOwner {\n    _withdrawEther(receiver, amount);\n  }\n\n  function withdrawErc20(address payable receiver, address tokenAddress, uint256 amount) external onlyOwner {\n    _withdrawERC20(receiver, tokenAddress, amount);\n  }\n\n  function withdrawERC721(address payable receiver, address tokenAddress, uint256 tokenId) external onlyOwner {\n    _withdrawERC721(receiver, tokenAddress, tokenId);\n  }\n\n  function migrateAccounts(address oldLeptonContract, uint256 count) external onlyOwner whenNotMigrated {\n    uint256 oldSupply = IERC721Enumerable(oldLeptonContract).totalSupply();\n    require(oldSupply == 0 || oldSupply > _migratedCount, \"LPT:E-004\");\n\n    if (oldSupply > 0) {\n      uint256 endTokenId = _migratedCount.add(count);\n      if (endTokenId > oldSupply) {\n        count = count.sub(endTokenId.sub(oldSupply));\n      }\n\n      for (uint256 i = 1; i <= count; i++) {\n        uint256 tokenId = _migratedCount.add(i);\n        address tokenOwner = IERC721(oldLeptonContract).ownerOf(tokenId);\n        _mint(tokenOwner);\n      }\n      _migratedCount = _migratedCount.add(count);\n    }\n\n    if (oldSupply == _migratedCount) {\n      _finalizeMigration();\n    }\n  }\n\n  /***********************************|\n  |         Private Functions         |\n  |__________________________________*/\n\n  function _getLepton(uint256 tokenId) internal view returns (Classification memory) {\n    uint256 types = _leptonTypes.length;\n    for (uint256 i = 0; i < types; i++) {\n      Classification memory lepton = _leptonTypes[i];\n      if (tokenId <= lepton._upperBounds) {\n        return lepton;\n      }\n    }\n  }\n\n  function _mintLepton(address receiver) internal returns (uint256 newTokenId) {\n    require(_typeIndex < _leptonTypes.length, \"LPT:E-408\");\n\n    Classification memory lepton = _leptonTypes[_typeIndex];\n    require(msg.value >= lepton.price, \"LPT:E-414\");\n\n    newTokenId = _safeMint(receiver, \"\");\n\n    // Determine Next Type\n    if (newTokenId == lepton._upperBounds) {\n      _typeIndex = _typeIndex.add(1);\n    }\n\n    _refundOverpayment(lepton.price);\n  }\n\n  function _batchMintLepton(address receiver, uint256 count) internal {\n    require(_typeIndex < _leptonTypes.length, \"LPT:E-408\");\n    require(_maxMintPerTx == 0 || count <= _maxMintPerTx, \"LPT:E-429\");\n\n    Classification memory lepton = _leptonTypes[_typeIndex];\n\n    uint256 endTokenId = _tokenCount.add(count);\n    if (endTokenId > lepton._upperBounds) {\n      count = count.sub(endTokenId.sub(lepton._upperBounds));\n    }\n\n    uint256 salePrice = lepton.price.mul(count);\n    require(msg.value >= salePrice, \"LPT:E-414\");\n\n    _safeMintBatch(receiver, count, \"\");\n\n    // Determine Next Type\n    if (endTokenId >= lepton._upperBounds) {\n      _typeIndex = _typeIndex.add(1);\n    }\n\n    _refundOverpayment(salePrice);\n  }\n\n  function _refundOverpayment(uint256 threshold) internal {\n    uint256 overage = msg.value.sub(threshold);\n    if (overage > 0) {\n      payable(_msgSender()).sendValue(overage);\n    }\n  }\n\n  function _finalizeMigration() internal {\n    // Determine Next Type\n    _typeIndex = 0;\n    for (uint256 i = 0; i < _leptonTypes.length; i++) {\n      Classification memory lepton = _leptonTypes[i];\n      if (_migratedCount >= lepton._upperBounds) {\n        _typeIndex = i + 1;\n      }\n    }\n    _migrationComplete = true;\n  }\n\n\n  /***********************************|\n  |             Modifiers             |\n  |__________________________________*/\n\n  modifier whenNotMigrated() {\n    require(!_migrationComplete, \"LPT:E-004\");\n    _;\n  }\n\n  modifier whenNotPaused() {\n    require(!_paused, \"LPT:E-101\");\n    _;\n  }\n}"
      },
      "erc20permit/contracts/ERC20Permit.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/53516bc555a454862470e7860a9b5254db4d00f5/contracts/token/ERC20/ERC20Permit.sol\npragma solidity ^0.6.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"./IERC2612.sol\";\n\n/**\n * @author Georgios Konstantopoulos\n * @dev Extension of {ERC20} that allows token holders to use their tokens\n * without sending any transactions by setting {IERC20-allowance} with a\n * signature using the {permit} method, and then spend them via\n * {IERC20-transferFrom}.\n *\n * The {permit} signature mechanism conforms to the {IERC2612} interface.\n */\nabstract contract ERC20Permit is ERC20, IERC2612 {\n    mapping (address => uint256) public override nonces;\n\n    bytes32 public immutable PERMIT_TYPEHASH = keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n    bytes32 public immutable DOMAIN_SEPARATOR;\n\n    constructor(string memory name_, string memory symbol_) internal ERC20(name_, symbol_) {\n        uint256 chainId;\n        assembly {\n            chainId := chainid()\n        }\n\n        DOMAIN_SEPARATOR = keccak256(\n            abi.encode(\n                keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"),\n                keccak256(bytes(name_)),\n                keccak256(bytes(\"1\")),\n                chainId,\n                address(this)\n            )\n        );\n    }\n\n    /**\n     * @dev See {IERC2612-permit}.\n     *\n     * In cases where the free option is not a concern, deadline can simply be\n     * set to uint(-1), so it should be seen as an optional parameter\n     */\n    function permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override {\n        require(deadline >= block.timestamp, \"ERC20Permit: expired deadline\");\n\n        bytes32 hashStruct = keccak256(\n            abi.encode(\n                PERMIT_TYPEHASH,\n                owner,\n                spender,\n                amount,\n                nonces[owner]++,\n                deadline\n            )\n        );\n\n        bytes32 hash = keccak256(\n            abi.encodePacked(\n                '\\x19\\x01',\n                DOMAIN_SEPARATOR,\n                hashStruct\n            )\n        );\n\n        address signer = ecrecover(hash, v, r, s);\n        require(\n            signer != address(0) && signer == owner,\n            \"ERC20Permit: invalid signature\"\n        );\n\n        _approve(owner, spender, amount);\n    }\n}\n"
      },
      "erc20permit/contracts/IERC2612.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0-or-later\n// Code adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2237/\npragma solidity ^0.6.0;\n\n/**\n * @dev Interface of the ERC2612 standard as defined in the EIP.\n *\n * Adds the {permit} method, which can be used to change one's\n * {IERC20-allowance} without having to send a transaction, by signing a\n * message. This allows users to spend tokens without having to hold Ether.\n *\n * See https://eips.ethereum.org/EIPS/eip-2612.\n */\ninterface IERC2612 {\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over `owner`'s tokens,\n     * given `owner`'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     */\n    function permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;\n\n    /**\n     * @dev Returns the current ERC2612 nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "metadata": {
        "useLiteralContent": true
      },
      "libraries": {}
    }
  }}