{
    "Function": "_burnShares",
    "File": "contracts/mocks/stETHMock.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol"
    ],
    "High-Level Calls": [
        "SafeMath",
        "SafeMath"
    ],
    "Internal Calls": [
        "_getTotalShares",
        "require(bool,string)",
        "getPooledEthByShares",
        "getPooledEthByShares",
        "require(bool,string)"
    ],
    "Library Calls": [
        "sub",
        "sub"
    ],
    "Low-Level Calls": [],
    "Code": "function _burnShares(\n        address _account,\n        uint256 _sharesAmount\n    ) internal returns (uint256 newTotalShares) {\n        require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n        uint256 accountShares = shares[_account];\n        require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n        uint256 preRebaseTokenAmount = getPooledEthByShares(_sharesAmount);\n\n        newTotalShares = _getTotalShares().sub(_sharesAmount);\n        totalShares = newTotalShares;\n\n        shares[_account] = accountShares.sub(_sharesAmount);\n\n        uint256 postRebaseTokenAmount = getPooledEthByShares(_sharesAmount);\n\n        emit SharesBurnt(\n            _account,\n            preRebaseTokenAmount,\n            postRebaseTokenAmount,\n            _sharesAmount\n        );\n\n        // Notice: we're not emitting a Transfer event to the zero address here since shares burn\n        // works by redistributing the amount of tokens corresponding to the burned shares between\n        // all other token holders. The total supply of the token doesn't change as the result.\n        // This is equivalent to performing a send from `address` to each other token holder address,\n        // but we cannot reflect this as it would require sending an unbounded number of events.\n\n        // We're emitting `SharesBurnt` event to provide an explicit rebase log record nonetheless.\n    }"
}