gnosis/eth/utils.py
def remove_swarm_metadata(code: bytes) -> bytes:
    """
    Remove swarm metadata from Solidity bytecode

    :param code:
    :return: Code without metadata
    """
    swarm = b"\xa1\x65bzzr0"
    position = code.rfind(swarm)
    if position == -1:
        raise ValueError("Swarm metadata not found in code %s" % code.hex())
    return code[:position]

    Remove swarm metadata from Solidity bytecode

    :param code:
    :return: Code without metadata
    
Remove swarm metadata from Solidity bytecode
Remove swarm metadata from Solidity bytecode
def remove_swarm_metadata(code: bytes) -> bytes:
    swarm = b"\xa1\x65bzzr0"
    position = code.rfind(swarm)
    if position == -1:
        raise ValueError("Swarm metadata not found in code %s" % code.hex())
    return code[:position]
def remove_swarm_metadata ( code : bytes ) -> bytes : swarm = b"\xa1\x65bzzr0" position = code . rfind ( swarm ) if position == - 1 : raise ValueError ( "Swarm metadata not found in code %s" % code . hex ( ) ) return code [ : position ]
Remove swarm metadata from Solidity bytecode
Remove swarm metadata from Solidity bytecode
"""
    Remove swarm metadata from Solidity bytecode

    :param code:
    :return: Code without metadata
    """
Code without metadata
Code without metadata
code
bytes
None