{
    "Function": "_alterBeneficiary",
    "File": "src/UniStaker.sol",
    "Parent Contracts": [
        "lib/openzeppelin-contracts/contracts/utils/Nonces.sol",
        "lib/openzeppelin-contracts/contracts/utils/cryptography/EIP712.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol",
        "lib/openzeppelin-contracts/contracts/utils/Multicall.sol",
        "src/interfaces/INotifiableRewardReceiver.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "_checkpointReward",
        "_checkpointGlobalReward",
        "_checkpointReward",
        "_revertIfAddressZero"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _alterBeneficiary(\n    Deposit storage deposit,\n    DepositIdentifier _depositId,\n    address _newBeneficiary\n  ) internal {\n    _revertIfAddressZero(_newBeneficiary);\n    _checkpointGlobalReward();\n    _checkpointReward(deposit.beneficiary);\n    earningPower[deposit.beneficiary] -= deposit.balance;\n\n    _checkpointReward(_newBeneficiary);\n    emit BeneficiaryAltered(_depositId, deposit.beneficiary, _newBeneficiary);\n    deposit.beneficiary = _newBeneficiary;\n    earningPower[_newBeneficiary] += deposit.balance;\n  }"
}