{
    "Function": "notifyRewardAmount",
    "File": "contracts/contracts/Bribe.sol",
    "Parent Contracts": [
        "contracts/contracts/interfaces/IBribe.sol"
    ],
    "High-Level Calls": [
        "IGauge"
    ],
    "Internal Calls": [
        "getEpochStart",
        "_safeTransferFrom",
        "require(bool,string)",
        "lock",
        "require(bool)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function notifyRewardAmount(address token, uint amount) external lock {\n      require(amount > 0);\n      if (!isReward[token]) {\n        require(rewards.length < MAX_REWARD_TOKENS, \"too many rewards tokens\");\n      }\n      // bribes kick in at the start of next bribe period\n      uint adjustedTstamp = getEpochStart(block.timestamp);\n      uint epochRewards = tokenRewardsPerEpoch[token][adjustedTstamp];\n\n      _safeTransferFrom(token, msg.sender, address(this), amount);\n      tokenRewardsPerEpoch[token][adjustedTstamp] = epochRewards + amount;\n\n      if (!isReward[token]) {\n          isReward[token] = true;\n          rewards.push(token);\n          IGauge(gauge).addBribeRewardToken(token);\n      }\n\n      emit NotifyReward(msg.sender, token, adjustedTstamp, amount);\n  }"
}