{
    "Function": "unlock",
    "File": "contracts/PoolTemplate.sol",
    "Parent Contracts": [
        "contracts/interfaces/IUniversalMarket.sol",
        "contracts/interfaces/IPoolTemplate.sol",
        "contracts/InsureDAOERC20.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "IParameters"
    ],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function unlock(uint256 _id) public {\n        require(\n            insurances[_id].status == true &&\n                marketStatus == MarketStatus.Trading &&\n                insurances[_id].endTime + parameters.getGrace(msg.sender) <\n                block.timestamp,\n            \"ERROR: UNLOCK_BAD_COINDITIONS\"\n        );\n        insurances[_id].status == false;\n\n        lockedAmount = lockedAmount - insurances[_id].amount;\n\n        emit Unlocked(_id, insurances[_id].amount);\n    }"
}