<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def solidity_resolve_address(hex_code, library_symbol, library_address):
 """ Change the bytecode to use the given library address. Args: hex_code (bin):
 The bytecode encoded in hexadecimal. library_name (str):
 The library that will be resolved. library_address (str):
 The address of the library. Returns: bin: The bytecode encoded in hexadecimal with the library references resolved. """

    if library_address.startswith('0x'):
        raise ValueError('Address should not contain the 0x prefix')

    try:
        decode_hex(library_address)
    except TypeError:
        raise ValueError(
            'library_address contains invalid characters, it must be hex encoded.')

    if len(library_symbol) != 40 or len(library_address) != 40:
        raise ValueError('Address with wrong length')

    return hex_code.replace(library_symbol, library_address)