Real onchain, five secrets, one build.
Every mega-prompt in this repo uses the same pattern, because it's the only pattern that lets a Lovable account ship a verifiable Base Sepolia demo in one shot.
Why Base Sepolia?
Base Sepolia is Coinbase's free L2 testnet — full EVM, BaseScan explorer, standard wallets, but funded by a public faucet. Contracts are publicly inspectable, you never spend real ETH, and Privy sponsored transactions on Base cost fractions of a cent so judges can try the demo without a wallet. BaseScan is Etherscan-v2 under the hood, so a single ETHERSCAN_API_KEY verifies contracts on both.
The recipe
# 1. In your Lovable project, add five secrets (Settings -> Secrets): METAMASK_PRIVATE_KEY=0x... BASE_SEPOLIA_RPC_URL=https://sepolia.base.org # or Alchemy Base Sepolia HTTPS URL ETHERSCAN_API_KEY=... # Etherscan v2 single key — covers BaseScan PRIVY_APP_ID=... PINATA_JWT=eyJhbGciOi... # 2. Fund the MetaMask account on Base Sepolia: open https://portal.cdp.coinbase.com/products/faucet # or https://www.alchemy.com/faucets/base-sepolia # 3. Copy a mega-prompt from this repo into Lovable. One paste: # - scaffolds the React app # - writes the Solidity contract (with hackathon credit in NatSpec) # - deploys to Base Sepolia and verifies on BaseScan # - wires Privy social login + sponsored tx # - pins generated assets to IPFS via Pinata # - exposes the contract address + BaseScan link in the UI # 4. Open the live BaseScan link. Your demo is provably onchain.
1. The contract — credit baked in
Every Solidity file deployed from a Creative Blockchain prompt MUST carry the hackathon credit in NatSpec, so provenance lives onchain alongside the bytecode.
// contracts/Provenance.sol — every contract carries the hackathon credit in NatSpec
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title Provenance
/// @notice Built during the Creative AI & Quantum Hackathon
/// @notice organised by StreetKode Fam during Indian Krump Festival 14
contract Provenance {
event Logged(address indexed author, string cid, uint256 at);
function log(string calldata cid) external {
emit Logged(msg.sender, cid, block.timestamp);
}
}
2. Hardhat config for Base Sepolia + Etherscan v2
Install @nomicfoundation/hardhat-ethers and @nomicfoundation/hardhat-verify. Etherscan v2 uses a single API key across 60+ EVM chains including Base — no separate BaseScan key required.
// hardhat.config.cjs — Base Sepolia (chainId 84532) + Etherscan v2 verification
require("@nomicfoundation/hardhat-ethers");
require("@nomicfoundation/hardhat-verify");
const pk = process.env.METAMASK_PRIVATE_KEY;
module.exports = {
solidity: { version: "0.8.24", settings: { optimizer: { enabled: true, runs: 200 } } },
networks: {
baseSepolia: {
url: process.env.BASE_SEPOLIA_RPC_URL || "https://sepolia.base.org",
accounts: pk ? [pk.startsWith("0x") ? pk : "0x" + pk] : [],
chainId: 84532,
},
},
etherscan: {
// Single Etherscan v2 key — works for BaseScan too.
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [{
network: "baseSepolia",
chainId: 84532,
urls: {
apiURL: "https://api.etherscan.io/v2/api?chainid=84532",
browserURL: "https://sepolia.basescan.org",
},
}],
},
sourcify: { enabled: false },
};
3. Deploy + verify on BaseScan
// scripts/deploy.cjs — deploys, then verifies on BaseScan
const hre = require("hardhat");
async function main() {
const F = await hre.ethers.getContractFactory("Provenance");
const c = await F.deploy();
await c.waitForDeployment();
const addr = await c.getAddress();
console.log("deployed:", addr);
// then, in a second command:
// npx hardhat verify --network baseSepolia <address>
}
main().catch((e) => { console.error(e); process.exit(1); });
4. Pin assets to IPFS via Pinata
// src/lib/pinata.ts — pin a Blob to IPFS via Pinata JWT
export async function pinToIPFS(file: Blob, name = "artifact") {
const fd = new FormData();
fd.append("file", file, name);
const r = await fetch("https://api.pinata.cloud/pinning/pinFileToIPFS", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PINATA_JWT}` },
body: fd,
});
const { IpfsHash } = await r.json();
return IpfsHash as string; // the CID
}
5. Sign in with Google via Privy
Enable Base Sepolia (chainId 84532) as a supported chain in your Privy dashboard before shipping.
// src/main.tsx — Privy social login + sponsored Base Sepolia transactions
import { PrivyProvider } from "@privy-io/react-auth";
<PrivyProvider
appId={import.meta.env.VITE_PRIVY_APP_ID}
config={{
loginMethods: ["google", "email"],
embeddedWallets: { ethereum: { createOnLogin: "users-without-wallets" } },
defaultChain: { id: 84532, name: "Base Sepolia" },
}}
>
<App />
</PrivyProvider>
Hackathon rules of thumb
- · One mega-prompt = one build message. Don't iterate the architecture, iterate the UI.
- · Always show the live BaseScan link in the UI — that's your proof.
- · Use Privy sponsored tx so judges don't need a wallet to try the demo.
- · Pin every user-generated asset to IPFS the moment it's created.
- · Add a "Built during the Creative AI & Quantum Hackathon — StreetKode Fam · Indian Krump Festival 14" line to your footer.