{
    "Function": "addPool",
    "File": "contracts/Booster.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IRewardFactory",
        "IStashFactory",
        "IRewardFactory",
        "IStaker",
        "ITokenFactory"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function addPool(\n        address _lptoken,\n        address _gauge,\n        uint256 _stashVersion\n    ) external returns (bool) {\n        require(msg.sender == poolManager && !isShutdown, \"!add\");\n        require(_gauge != address(0) && _lptoken != address(0), \"!param\");\n\n        //the next pool's pid\n        uint256 pid = poolInfo.length;\n\n        //create a tokenized deposit\n        address token = ITokenFactory(tokenFactory).CreateDepositToken(_lptoken);\n        //create a reward contract for veAsset rewards\n        address newRewardPool = IRewardFactory(rewardFactory).CreateVeAssetRewards(pid, token);\n\n        //create a stash to handle extra incentives\n        address stash = IStashFactory(stashFactory).CreateStash(\n            pid,\n            veAsset,\n            _gauge,\n            staker,\n            _stashVersion\n        );\n\n        //add the new pool\n        poolInfo.push(\n            PoolInfo({\n                lptoken: _lptoken,\n                token: token,\n                gauge: _gauge,\n                veAssetRewards: newRewardPool,\n                stash: stash,\n                shutdown: false\n            })\n        );\n        gaugeMap[_gauge] = true;\n\n        //give stashes access to rewardfactory and voteproxy\n        //   voteproxy so it can grab the incentive tokens off the contract after claiming rewards\n        //   reward factory so that stashes can make new extra reward contracts if a new incentive is added to the gauge\n        if (stash != address(0)) {\n            poolInfo[pid].stash = stash;\n            IStaker(staker).setStashAccess(stash, true);\n            IRewardFactory(rewardFactory).setAccess(stash, true);\n        }\n        emit PoolAdded(_lptoken, _gauge, token, newRewardPool);\n\n        return true;\n    }"
}