contract Remote is Ownable, IERC20 {
    
    IERC20 internal _remoteToken;
    address internal _remoteContractAddress;

    /**
    @dev approveSpenderOnVault
    This is only needed if you put the funds in the Vault contract address, and then need to withdraw them
    Avoid this, by not putting funds in there that you need to get back.
    @param spender The address that will be used to withdraw from the Vault.
    @param value The amount of tokens to approve.
    @return success
     */
    function approveSpenderOnVault (address spender, uint256 value) 
        external onlyOwner returns (bool success) {
            // NOTE Approve the spender on the Vault address
            _remoteToken.approve(spender, value);     
            success = true;
        }

   /** 
    @dev remoteTransferFrom This allows the admin to withdraw tokens from the contract, using an 
    allowance that has been previously set. 
    @param from address to take the tokens from (allowance)
    @param to the recipient to give the tokens to
    @param value the amount in tokens to send
    @return bool
    */
    function remoteTransferFrom (address from, address to, uint256 value) external onlyOwner returns (bool) {
        return _remoteTransferFrom(from, to, value);
    }

    /**
    @dev setRemoteContractAddress
    @param remoteContractAddress The remote contract's address
    @return success
     */
    function setRemoteContractAddress (address remoteContractAddress)
        external onlyOwner returns (bool success) {
            _remoteContractAddress = remoteContractAddress;        
            _remoteToken = IERC20(_remoteContractAddress);
            success = true;
        }

    function remoteBalanceOf(address owner) external view returns (uint256) {
        return _remoteToken.balanceOf(owner);
    }

    function remoteTotalSupply() external view returns (uint256) {
        return _remoteToken.totalSupply();
    }

    /** */
    function remoteAllowance (address owner, address spender) external view returns (uint256) {
        return _remoteToken.allowance(owner, spender);
    }

    /**
    @dev remoteBalanceOfVault Return tokens from the balance of the Vault contract.
    This should be zero. Tokens should come from allowance, not balanceOf.
    @return balance
     */
    function remoteBalanceOfVault () external view onlyOwner 
        returns(uint256 balance) {
            balance = _remoteToken.balanceOf(address(this));
        }

    /**
    @dev remoteAllowanceOnMyAddress Check contracts allowance on the users address.
    @return allowance
     */
    function remoteAllowanceOnMyAddress () public view
        returns(uint256 allowance) {
            allowance = _remoteToken.allowance(msg.sender, address(this));
        } 

    /** 
    @dev _remoteTransferFrom This allows contract to withdraw tokens from an address, using an 
    allowance that has been previously set. 
    @param from address to take the tokens from (allowance)
    @param to the recipient to give the tokens to
    @param value the amount in tokens to send
    @return bool
    */
    function _remoteTransferFrom (address from, address to, uint256 value) internal returns (bool) {
        return _remoteToken.transferFrom(from, to, value);
    }

}
function remoteTransferFrom (address from, address to, uint256 value) external onlyOwner returns (bool) {
    return _remoteTransferFrom(from, to, value);
}

/** 
 @dev remoteTransferFrom This allows the admin to withdraw tokens from the contract, using an 
 allowance that has been previously set. 
 @param from address to take the tokens from (allowance)
 @param to the recipient to give the tokens to
 @param value the amount in tokens to send
 @return bool
 */