{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/dex/pool/VaderPoolFactory.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "contracts/shared/ProtocolConstants.sol",
        "contracts/interfaces/dex/pool/IVaderPoolFactory.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract VaderPoolFactory is IVaderPoolFactory, ProtocolConstants, Ownable {\r\n    /* ========== STATE VARIABLES ========== */\r\n\r\n    // Denotes whether the queue system is active on new pairs, disabled by default\r\n    bool public queueActive;\r\n\r\n    // Native Asset of the system\r\n    address public override nativeAsset;\r\n\r\n    // Token A -> Token B -> Pool mapping\r\n    mapping(address => mapping(address => IVaderPool)) public override getPool;\r\n\r\n    // A list of all pools\r\n    IVaderPool[] public allPools;\r\n\r\n    /* ========== VIEWS ========== */\r\n\r\n    /* ========== MUTATIVE FUNCTIONS ========== */\r\n\r\n    /*\r\n     * @dev Allows creation of a Vader pool of native and foreign assets.\r\n     *\r\n     * Populates the {getPool} mapping with the newly created Vader pool and\r\n     * pushes this pool to {allPools} array.\r\n     *\r\n     * Requirements:\r\n     * - Native and foreign assets cannot be the same.\r\n     * - Foreign asset cannot be the zero address.\r\n     * - The pool against the specified foreign asset does not already exist.\r\n     **/\r\n    // NOTE: Between deployment & initialization may be corrupted but chance small\r\n    function createPool(address tokenA, address tokenB)\r\n        external\r\n        override\r\n        returns (IVaderPool pool)\r\n    {\r\n        (address token0, address token1) = tokenA == nativeAsset\r\n            ? (tokenA, tokenB)\r\n            : tokenB == nativeAsset\r\n            ? (tokenB, tokenA)\r\n            : (_ZERO_ADDRESS, _ZERO_ADDRESS);\r\n\r\n        require(\r\n            token0 != token1,\r\n            \"VaderPoolFactory::createPool: Identical Tokens\"\r\n        );\r\n\r\n        require(\r\n            token1 != _ZERO_ADDRESS,\r\n            \"VaderPoolFactory::createPool: Inexistent Token\"\r\n        );\r\n\r\n        require(\r\n            getPool[token0][token1] == IVaderPool(_ZERO_ADDRESS),\r\n            \"VaderPoolFactory::createPool: Pair Exists\"\r\n        ); // single check is sufficient\r\n\r\n        pool = new VaderPool(\r\n            queueActive,\r\n            IERC20Extended(token0),\r\n            IERC20Extended(token1)\r\n        );\r\n        getPool[token0][token1] = pool;\r\n        getPool[token1][token0] = pool; // populate mapping in the reverse direction\r\n        allPools.push(pool);\r\n        emit PoolCreated(token0, token1, pool, allPools.length);\r\n    }\r\n\r\n    /* ========== RESTRICTED FUNCTIONS ========== */\r\n\r\n    /*\r\n     * @dev Allows initializing of the factory contract by owner by setting the\r\n     * address of native asset for all the Vader pool and also transferring the\r\n     * contract's ownership to {_dao}.\r\n     *\r\n     * Requirements:\r\n     * - Only onwer can call this function.\r\n     **/\r\n    function initialize(address _nativeAsset, address _dao) external onlyOwner {\r\n        require(\r\n            _nativeAsset != _ZERO_ADDRESS && _dao != _ZERO_ADDRESS,\r\n            \"VaderPoolFactory::initialize: Incorrect Arguments\"\r\n        );\r\n\r\n        nativeAsset = _nativeAsset;\r\n        transferOwnership(_dao);\r\n    }\r\n\r\n    /*\r\n     * @dev Allows toggling of queue system of a pool.\r\n     *\r\n     * Requirements:\r\n     * - This function can only be called when DAO is active.\r\n     **/\r\n    function toggleQueue(address token0, address token1) external onlyDAO {\r\n        getPool[token0][token1].toggleQueue();\r\n    }\r\n\r\n    /* ========== INTERNAL FUNCTIONS ========== */\r\n\r\n    /* ========== PRIVATE FUNCTIONS ========== */\r\n\r\n    /**\r\n     * @dev Ensures only the DAO is able to invoke a particular function by validating that\r\n     * the owner is the msg.sender, equivalent to the DAO address, and that the native asset\r\n     * has been set\r\n     */\r\n    function _onlyDAO() private view {\r\n        require(\r\n            nativeAsset != _ZERO_ADDRESS && owner() == _msgSender(),\r\n            \"BasePool::_onlyDAO: Insufficient Privileges\"\r\n        );\r\n    }\r\n\r\n    /* ========== MODIFIERS ========== */\r\n\r\n    /**\r\n     * @dev Throws if invoked by anyone else other than the DAO\r\n     */\r\n    modifier onlyDAO() {\r\n        _onlyDAO();\r\n        _;\r\n    }\r\n}"
}