contract AccessLiquidity is CompoundResolver {
    event LogPoolBorrow(address indexed user, address[] tknAddr, uint[] amt);
    event LogPoolPayback(address indexed user, address[] tknAddr);

    /**
     * @dev borrow tokens and use them on DSA.
     * @param tokens Array of tokens.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
     * @param amounts Array of tokens amount.
    */
    function accessLiquidity(address[] calldata tokens, uint[] calldata amounts) external isDSA {
        require(tokens.length == amounts.length, "length-not-equal");
        borrowAndSend(tokens, amounts);
        emit LogPoolBorrow(
            msg.sender,
            tokens,
            amounts
        );
    }
   
    /**
     * @dev Payback borrowed tokens.
     * @param tokens Array of tokens.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
    */
    function returnLiquidity(address[] calldata tokens) external payable isDSA {
        payback(tokens);
        emit LogPoolPayback(msg.sender, tokens);
    }
    
    function isOk() public view returns(bool ok) {
        ok = true;
        for (uint i = 0; i < tokensAllowed.length; i++) {
            uint tknBorrowed = borrowedToken[tokensAllowed[i]];
            if(tknBorrowed > 0){
                ok = false;
                break;
            }
        }
        if(checkOldPool && ok) {
            bool isOldPoolOk = oldInstaPoolContract.isOk();
            ok = isOldPoolOk;
        }
    }
}
function accessLiquidity(address[] calldata tokens, uint[] calldata amounts) external isDSA {
    require(tokens.length == amounts.length, "length-not-equal");
    borrowAndSend(tokens, amounts);
    emit LogPoolBorrow(
        msg.sender,
        tokens,
        amounts
    );
}

/**
 * @dev borrow tokens and use them on DSA.
 * @param tokens Array of tokens.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
 * @param amounts Array of tokens amount.
 */