{
    "Function": "unlock",
    "File": "contracts/lock/JPEGLock.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "SafeERC20"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "nonReentrant",
        "require(bool,string)"
    ],
    "Library Calls": [
        "safeTransfer"
    ],
    "Low-Level Calls": [],
    "Code": "function unlock(uint256 _nftIndex) external nonReentrant {\n        LockPosition memory position = positions[_nftIndex];\n        require(position.owner == msg.sender, \"unauthorized\");\n        require(position.unlockAt <= block.timestamp, \"locked\");\n\n        delete positions[_nftIndex];\n\n        jpeg.safeTransfer(msg.sender, position.lockAmount);\n\n        emit Unlock(msg.sender, _nftIndex, position.lockAmount);\n    }"
}