{
    "Function": "unlockTokens",
    "File": "contracts/yield/AaveYield.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/utils/ReentrancyGuard.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol",
        "contracts/interfaces/IYield.sol"
    ],
    "High-Level Calls": [
        "SafeERC20"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "_withdrawERC",
        "nonReentrant",
        "require(bool,string)",
        "onlySavingsAccount",
        "_withdrawETH"
    ],
    "Library Calls": [
        "safeTransfer"
    ],
    "Low-Level Calls": [
        "call"
    ],
    "Code": "function unlockTokens(address asset, uint256 amount) external override onlySavingsAccount nonReentrant returns (uint256 received) {\n        require(amount != 0, 'Invest: amount');\n\n        if (asset == address(0)) {\n            received = _withdrawETH(amount);\n            (bool success, ) = savingsAccount.call{value: received}('');\n            require(success, 'Transfer failed');\n        } else {\n            received = _withdrawERC(asset, amount);\n            IERC20(asset).safeTransfer(savingsAccount, received);\n        }\n\n        emit UnlockedTokens(asset, received);\n    }"
}