黑客松進展
- Implemented Mantle Sepolia (chainId 5003) as a first-class supported network, so wallet connections and transactions run on Mantle, not on an arbitrary EVM chain.
- Built and integrated a Mantle smart contract (ConnectionRequest.sol) that records connection requests and acceptances on-chain via sendConnectionRequest and acceptConnectionRequest.
- Adopted a privacy-first on-chain model: only an opaque bytes32 contextHash is stored on Mantle; human-readable context (event/city/date/notes) stays off-chain in Supabase.
- Generated the contextHash using salted hashing (crypto.getRandomValues + ABI encoding + keccak256) to prevent dictionary attacks and metadata leakage.
- Wired the dApp to the contract using wagmi + viem (useWriteContract, waitForTransactionReceipt) to submit Mantle transactions and confirm them reliably.
- Enforced hard network gating: if the wallet isn’t on Mantle Sepolia, the app blocks on-chain actions and prompts the user to switch networks, avoiding invalid transactions and demo failures.
- Added a configurable minimum fee (anti-spam) on-chain (minFee, payable functions) and read it from the frontend (useReadContract) to keep the system resilient on public testnets.
- Persisted verifiability by storing the Mantle transaction hash in the database (mantle_tx_hash on trust_links) while keeping backward compatibility for older records.
- Made verification effortless by surfacing the Explorer link for each on-chain action in the UI, so judges/users can independently validate the Mantle transaction.
- Decoded Mantle event logs from transaction receipts (e.g., ConnectionRequestSent) to derive on-chain identifiers (like requestId) when needed, enabling a verifiable bridge between on-chain activity and off-chain records.