Submission Deadline
@@ -745,7 +745,7 @@ export default function InteractionClient() {
)}
{/* Project Submission */}
- {status === 'active' && (
+ {status === 'accepting-submissions' && (
diff --git a/app/createHackathon/page.tsx b/app/createHackathon/page.tsx
index 9307421..936698b 100644
--- a/app/createHackathon/page.tsx
+++ b/app/createHackathon/page.tsx
@@ -48,6 +48,7 @@ export default function CreateHackathon() {
const [timezoneMode, setTimezoneMode] = useState
('local')
const [prizePoolType, setPrizePoolType] = useState<'eth' | 'token'>('eth')
+ const [tokenSymbol, setTokenSymbol] = useState('')
const [judges, setJudges] = useState([
{ address: '', name: '', tokens: '' }
@@ -88,6 +89,33 @@ export default function CreateHackathon() {
}
})
+ // Fetch token symbol
+ const { data: fetchedTokenSymbol } = useReadContract({
+ address: formData.tokenAddress as `0x${string}`,
+ abi: [
+ {
+ "inputs": [],
+ "name": "symbol",
+ "outputs": [{"internalType": "string", "name": "", "type": "string"}],
+ "stateMutability": "view",
+ "type": "function"
+ }
+ ] as const,
+ functionName: 'symbol',
+ query: {
+ enabled: prizePoolType === 'token' && isAddress(formData.tokenAddress)
+ }
+ })
+
+ // Update token symbol when fetched
+ useEffect(() => {
+ if (fetchedTokenSymbol) {
+ setTokenSymbol(String(fetchedTokenSymbol))
+ } else {
+ setTokenSymbol('')
+ }
+ }, [fetchedTokenSymbol])
+
// Smart contract has been fixed!
// Factory now transfers tokens directly from user to the created Hackathon contract
@@ -250,6 +278,7 @@ export default function CreateHackathon() {
}
// Check judges
+ const judgeAddresses = new Set()
for (let i = 0; i < judges.length; i++) {
const judge = judges[i]
if (!judge.address || !judge.name || !judge.tokens) {
@@ -262,6 +291,14 @@ export default function CreateHackathon() {
return false
}
+ // Check for duplicate addresses
+ const normalizedAddress = judge.address.toLowerCase()
+ if (judgeAddresses.has(normalizedAddress)) {
+ setValidationError(`Duplicate judge address found. Each judge must have a unique wallet address.`)
+ return false
+ }
+ judgeAddresses.add(normalizedAddress)
+
const tokens = parseInt(judge.tokens)
if (isNaN(tokens) || tokens <= 0) {
setValidationError(`Invalid token amount for judge ${i + 1}`)
@@ -399,34 +436,31 @@ export default function CreateHackathon() {