def contract_origin_search(p, contract_hash, verbose=0):
    start = 0
    end = p.shell.head.header()['level']
    contract = p.contract(contract_hash)
    found = (- 1)
    data = None
    while (found == (- 1)):
        anchor = int(((end + start) / 2))
        try:
            data = contract.storage(anchor)
            try:
                data = contract.storage((anchor - 1))
                end = anchor
            except Exception:
                found = anchor
        except Exception:
            start = anchor
    if verbose:
        print('Ntf origin:', contract_hash, found, data, '\n')
    return (found, data)
def contract_origin_search(p, contract_hash, verbose=0):
    start = 0
    end = p.shell.head.header()['level']
    contract = p.contract(contract_hash)
    found = (- 1)
    data = None
    while (found == (- 1)):
        anchor = int(((end + start) / 2))
        try:
            data = contract.storage(anchor)
            try:
                data = contract.storage((anchor - 1))
                end = anchor
            except Exception:
                found = anchor
        except Exception:
            start = anchor
    if verbose:
        print('Ntf origin:', contract_hash, found, data, '\n')
    return (found, data)