Query the blockchain events filtering specifically for the OSEC reference
budget_events = contract.events.BudgetLogged().get_logs(
fromBlock=0,
toBlock="latest"
)
print(f"--- Searching Logs for Allotment: OSEC-2026-06248 ---")
for event in budget_events:
# Check if the text metadata contains your specific DBM/DPWH routing number
if "OSEC-2026-06248" in event['args']['pdfSource'] or "OSEC-2026-06248" in event['args']['expenseType']:
print(f"Transaction Found! Block: {event['blockNumber']}")
print(f"Tx Hash: {event['transactionHash'].hex()}")
print(f"Linked IPFS Folder Hash: ipfs://{event['args']['uri']}")
Query the blockchain events filtering specifically for the OSEC reference
budget_events = contract.events.BudgetLogged().get_logs(
fromBlock=0,
toBlock="latest"
)
print(f"--- Searching Logs for Allotment: OSEC-2026-06248 ---")
for event in budget_events:
# Check if the text metadata contains your specific DBM/DPWH routing number
if "OSEC-2026-06248" in event['args']['pdfSource'] or "OSEC-2026-06248" in event['args']['expenseType']:
print(f"Transaction Found! Block: {event['blockNumber']}")
print(f"Tx Hash: {event['transactionHash'].hex()}")
print(f"Linked IPFS Folder Hash: ipfs://{event['args']['uri']}")