{
    "Function": "getMultiplier",
    "File": "contracts/legacy/MetaVault.sol",
    "Parent Contracts": [
        "contracts/legacy/IMetaVault.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "SafeMath"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "sub",
        "sub",
        "sub",
        "sub",
        "mul",
        "sub",
        "mul",
        "mul",
        "mul",
        "sub",
        "mul",
        "add",
        "mul",
        "add",
        "add",
        "mul",
        "add",
        "sub"
    ],
    "Low-Level Calls": [],
    "Code": "function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {\n        // start at the end of the epochs\n        for (uint8 epochId = 5; epochId >= 1; --epochId) {\n            // if _to (the current block number if called within this contract) is after the previous epoch ends\n            if (_to >= epochEndBlocks[epochId - 1]) {\n                // if the last reward block is after the previous epoch: return the number of blocks multiplied by this epochs multiplier\n                if (_from >= epochEndBlocks[epochId - 1]) return _to.sub(_from).mul(epochRewardMultiplers[epochId]);\n                // get the multiplier amount for the remaining reward of the current epoch\n                uint256 multiplier = _to.sub(epochEndBlocks[epochId - 1]).mul(epochRewardMultiplers[epochId]);\n                // if epoch is 1: return the remaining current epoch reward with the first epoch reward\n                if (epochId == 1) return multiplier.add(epochEndBlocks[0].sub(_from).mul(epochRewardMultiplers[0]));\n                // for all epochs in between the first and current epoch\n                for (epochId = epochId - 1; epochId >= 1; --epochId) {\n                    // if the last reward block is after the previous epoch: return the current remaining reward with the previous epoch\n                    if (_from >= epochEndBlocks[epochId - 1]) return multiplier.add(epochEndBlocks[epochId].sub(_from).mul(epochRewardMultiplers[epochId]));\n                    // accumulate the multipler with the reward from the epoch\n                    multiplier = multiplier.add(epochEndBlocks[epochId].sub(epochEndBlocks[epochId - 1]).mul(epochRewardMultiplers[epochId]));\n                }\n                // return the accumulated multiplier with the reward from the first epoch\n                return multiplier.add(epochEndBlocks[0].sub(_from).mul(epochRewardMultiplers[0]));\n            }\n        }\n        // return the reward amount between _from and _to in the first epoch\n        return _to.sub(_from).mul(epochRewardMultiplers[0]);\n    }"
}