{
    "Function": "removeActiveReward",
    "File": "contracts/RewardFactory.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function removeActiveReward(address _reward, uint256 _pid) external returns (bool) {\n        require(rewardAccess[msg.sender] == true, \"!auth\");\n        if (_reward == address(0)) {\n            return true;\n        }\n\n        uint256[] storage activeList = rewardActiveList[_reward];\n        uint256 pid = _pid + 1; //offset by 1 so that we can use 0 as empty\n\n        uint256 length = activeList.length;\n        for (uint256 i = 0; i < length; i++) {\n            if (activeList[i] == pid) {\n                if (i != length - 1) {\n                    activeList[i] = activeList[length - 1];\n                }\n                activeList.pop();\n                break;\n            }\n        }\n        return true;\n    }"
}