{
    "Function": "addSeries",
    "File": "contracts/Wand.sol",
    "Parent Contracts": [
        "contracts/constants/Constants.sol",
        "contracts/utils/access/AccessControl.sol"
    ],
    "High-Level Calls": [
        "IPoolFactory",
        "IFYTokenFactory",
        "IOwnable",
        "ICauldronGov",
        "ICauldronGov",
        "ICauldronGov",
        "ILadleGov",
        "ICauldronGov",
        "AccessControl",
        "IPoolFactory",
        "AccessControl",
        "AccessControl",
        "AccessControl",
        "AccessControl",
        "ILadleGov",
        "AccessControl"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "auth"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function addSeries(\n        bytes6 seriesId,\n        bytes6 baseId,\n        uint32 maturity,\n        bytes6[] memory ilkIds,\n        string memory name,\n        string memory symbol\n    ) external auth {\n        address base = cauldron.assets(baseId);\n        require(base != address(0), \"Base not found\");\n\n        IJoin baseJoin = ladle.joins(baseId);\n        require(address(baseJoin) != address(0), \"Join not found\");\n\n        IOracle oracle = cauldron.rateOracles(baseId);\n        require(address(oracle) != address(0), \"Chi oracle not found\");\n\n        AccessControl fyToken = AccessControl(fyTokenFactory.createFYToken(\n            baseId,\n            oracle,\n            baseJoin,\n            maturity,\n            name,     // Derive from base and maturity, perhaps\n            symbol    // Derive from base and maturity, perhaps\n        ));\n\n        // Allow the fyToken to pull from the base join for redemption\n        bytes4[] memory sigs = new bytes4[](1);\n        sigs[0] = EXIT;\n        AccessControl(address(baseJoin)).grantRoles(sigs, address(fyToken));\n\n        // Allow the ladle to issue and cancel fyToken\n        sigs = new bytes4[](2);\n        sigs[0] = MINT;\n        sigs[1] = BURN;\n        fyToken.grantRoles(sigs, address(ladle));\n\n        // Pass ownership of the fyToken to msg.sender\n        fyToken.grantRole(fyToken.ROOT(), msg.sender);\n        fyToken.renounceRole(fyToken.ROOT(), address(this));\n\n        // Add fyToken/series to the Cauldron and approve ilks for the series\n        cauldron.addSeries(seriesId, baseId, IFYToken(address(fyToken)));\n        cauldron.addIlks(seriesId, ilkIds);\n\n        // Create the pool for the base and fyToken\n        poolFactory.createPool(base, address(fyToken));\n        IOwnable pool = IOwnable(poolFactory.calculatePoolAddress(base, address(fyToken)));\n        \n\n        // Pass ownership of pool to msg.sender\n        pool.transferOwnership(msg.sender);\n\n        // Register pool in Ladle\n        ladle.addPool(seriesId, address(pool));\n    }"
}