```\n    function topUp(\n        address source,\n        uint256[] memory indices\n    ) external onlyRole(EXECUTOR_ROLE) {\n        for (uint i = 0; i < indices.length; i++) {\n            // get staking contract and config\n            StakingRewards staking = stakingContracts[i];\n            StakingConfig memory config = stakingConfigs[staking];\n\n            // will revert if block.timestamp <= periodFinish\n            staking.setRewardsDuration(config.rewardsDuration);\n\n            // pull tokens from owner of this contract to fund the staking contract\n            rewardToken.transferFrom(\n                source,\n                address(staking),\n                config.rewardAmount\n            );\n\n            // start periods\n            staking.notifyRewardAmount(config.rewardAmount);\n\n            emit ToppedUp(staking, config);\n        }\n    }\n```\n