// Contract: ElderGateway
// Target function: function lock(address[] calldata nfts, uint256[][] calldata tokenIds) external
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

interface INFT {
    function transferFrom(
        address _from,
        address _to,
        uint256 _tokenId
    ) external;
}

contract ElderGateway {

    /**
    * @dev Details of locked NFT
    * @param user owner of tokenId
    * @param blockNo block.number when locked
    */
    struct Details {
        address user;
        uint256 blockNo;
    }

    /**
    * @dev mapping holds below values:
    * collectionAddress => tokenId => Details  
    */
    mapping(address => mapping(uint256 => Details)) public lockedData;

    /** 
    * @dev Emits event after nft is successfully locked
    * @param user address which locked nfts (owner of tokens)
    * @param nft collection address
    * @param tokenIds list of tokenIds from `nft` collection
    */
    event Locked(address indexed user, address indexed nft, uint256[] tokenIds);

    /** 
    * @dev Emits event after nft is successfully unlocked
    * @param user address which unlocked nfts (owner of tokens)
    * @param nft collection address
    * @param tokenIds list of tokenIds from `nft` collection
    */
    event Unlocked(address indexed user, address indexed nft, uint256[] tokenIds);