Naz786's picture
Update app.py
87467e6 verified
import streamlit as st
from groq import Groq
st.set_page_config(page_title="Q-Audit – Qubic Smart Contract Auditor", page_icon="🛡️")
st.title("🛡️ Q-Audit – C++ Smart Contract Auditor for Qubic")
client = Groq(api_key="")
user_code = st.text_area("Paste your Qubic C++ Smart Contract Code:")
if st.button("🔍 Run AI Audit"):
if user_code.strip() == "":
st.warning("Please paste some code first.")
else:
with st.spinner("Analyzing with Groq AI..."):
prompt = f"Audit this C++ smart contract for bugs, risks, or improvements:\n\n{user_code}"
completion = client.chat.completions.create(
model="llama3-70b-8192",
messages=[{"role": "user", "content": prompt}],
temperature=0.5,
)
st.subheader("🧠 AI Feedback:")
st.write(completion.choices[0].message.content)
if st.button("📝 Save to Qubic"):
st.success("✅ (Mock) Code submitted to Qubic smart contract.")