-
-
Notifications
You must be signed in to change notification settings - Fork 1
chore(backend): deploy to sepolia #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
58269f6
e7ee86b
fad7a0d
16608f1
1052543
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"SponsorshipQueueModule#SponsorshipQueue": "0xDd2A7CAF07E9ebf7560E524454607f0270348ecf", | ||
"DistributionQueueModule#DistributionQueue": "0x3bd4EFE520FFE291B36C5bDE3c34028A0CFe9513", | ||
"DistributionVerifierModule#DistributionVerifier": "0xf09f4cadbB3CFDFd92B1717853ccFBAe3B57B73B" | ||
"SponsorshipQueueModule#SponsorshipQueue": "0x646A5550af30f5340AF218C9aE375A4C7Bb740BF", | ||
"DistributionQueueModule#DistributionQueue": "0xD7744d3Cc62748fcDc8f53e202C804488D9e85A8", | ||
"DistributionVerifierModule#DistributionVerifier": "0xC3313d6BB50C081AE07B6B097700eC2ED0568377", | ||
"QueueHandlerModule#QueueHandler": "0x0B96769D277D8b7EaED38d2e269101615fB3e237" | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,8 +10,6 @@ export default function DistributionDetails() { | |||||||||
const router = useRouter(); | ||||||||||
const queueNumber = Number(router.query.queueNumber); | ||||||||||
console.debug("queueNumber:", queueNumber); | ||||||||||
const queueIndex = queueNumber - 1; | ||||||||||
console.debug("queueIndex:", queueIndex); | ||||||||||
|
||||||||||
return ( | ||||||||||
<> | ||||||||||
|
@@ -30,7 +28,7 @@ export default function DistributionDetails() { | |||||||||
</h1> | ||||||||||
|
||||||||||
<div className="mt-8 p-4 text-2xl bg-zinc-50 dark:bg-zinc-900 rounded-lg"> | ||||||||||
<DistributionSummary queueIndex={queueIndex} /> | ||||||||||
<DistributionSummary queueNumber={queueNumber} /> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainGuard rendering and validate route param before hitting the chain Passing Apply this minimal guard at the call site: - <DistributionSummary queueNumber={queueNumber} />
+ {Number.isInteger(queueNumber) && queueNumber >= 1 ? (
+ <DistributionSummary queueNumber={queueNumber} />
+ ) : null} Optional follow‑up (helps our mission’s reliability): run this to ensure no stale Eliminating off‑by‑one pitfalls here keeps the Distributions UI trustworthy—important as elimu.ai's mission is to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months. 🏁 Script executed: #!/bin/bash
# Find any remaining queueIndex usages
rg -n --type=ts --type=tsx -C1 '\bqueueIndex\b' Length of output: 27 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "1) locate files named [queueNumber].tsx"
find . -type f -name '[queueNumber].tsx' -print || true
echo "----"
echo "2) if found, print first 200 lines"
for f in $(find . -type f -name '[queueNumber].tsx' -print); do
echo ">>> $f"
sed -n '1,200p' "$f"
done
echo "----"
echo "3) search for queueIndex occurrences (no --type flags)"
rg -n -C1 '\bqueueIndex\b' || true
echo "----"
echo "4) search for DistributionSummary usages"
rg -n -C3 'DistributionSummary' || true
echo "----"
echo "5) list files in frontend/src/pages/distributions (if present)"
ls -la frontend/src/pages/distributions 2>/dev/null || true Length of output: 3717 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== pages/distributions/[queueNumber].tsx ==="
sed -n '1,240p' frontend/src/pages/distributions/[queueNumber].tsx || true
echo
echo "=== components/DistributionSummary.tsx ==="
sed -n '1,240p' frontend/src/components/DistributionSummary.tsx || true
echo
echo "=== search for queueIndex occurrences ==="
rg -n '\bqueueIndex\b' -S || true
echo
echo "=== search for queueNumber occurrences ==="
rg -n '\bqueueNumber\b' -S || true
echo
echo "=== search for router.query references ==="
rg -n "router\.query" -S || true
echo
echo "=== search for parseInt or Number around queueNumber ==="
rg -n -C1 "parseInt|Number\(" -S || true Length of output: 9672 Guard route param before calling DistributionSummary router.query can be undefined on initial render; Number(router.query.queueNumber) can be NaN — validate before passing to DistributionSummary (it calls useReadContract with args: [queueNumber]). - <DistributionSummary queueNumber={queueNumber} />
+ {Number.isInteger(queueNumber) && queueNumber >= 1 ? (
+ <DistributionSummary queueNumber={queueNumber} />
+ ) : null} Also apply the same guard in frontend/src/pages/sponsorships/[queueNumber].tsx. elimu.ai's mission is to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||
</div> | ||||||||||
</main> | ||||||||||
<MainFooter /> | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix off‑by‑one: contract index vs. human display is inconsistent (likely wrong item fetched).
The page now passes a 1‑based queueNumber from the route, but:
This will read the wrong queue entry on-chain and display an incorrect number. Align to a single convention: treat props as 1‑based for UX, convert to 0‑based only for the contract call.
Apply:
Context: Getting this right is key for trust—elimu.ai's mission is to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.
Also applies to: 40-41
🤖 Prompt for AI Agents