build strategy · onchain

Real onchain, four 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 Tempo Moderato demo in one shot.

Why Tempo Moderato and not mainnet?

Tempo Moderato is Tempo's public testnet — same EVM (Osaka), same Tempo Explorer, same wallets — but funded by a free stablecoin faucet. Every contract you deploy is publicly inspectable and source-verified via Sourcify, and your demo can't accidentally drain a user. Move to Tempo Mainnet (chainId 4217, RPC https://rpc.tempo.xyz) after the hackathon by swapping the RPC and chainId.

Need paid APIs or agent flows?

For flows that require paying third-party APIs, agent-to-agent payments, or MPP / x402 authorization on top of Tempo settlement, fork the DanceTempo pattern — it wires mppx + Tempo into any Lovable app.

DanceTempo reference on GitHub ↗

The recipe

recipe
# 1. In your Lovable project, add four secrets (Settings -> Secrets).
#    LOVABLE_API_KEY is provisioned automatically — no action needed.
METAMASK_PRIVATE_KEY=0x...
TEMPO_RPC_URL=https://rpc.moderato.tempo.xyz
PRIVY_APP_ID=...
PINATA_JWT=eyJhbGciOi...           # only if the idea pins media

# 2. Fund the MetaMask account on Tempo Moderato:
open https://tempofaucet.lovable.app/    # use the Tempo testnet faucet

# 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 Tempo Moderato and verifies via Sourcify
#    - wires Privy social login + sponsored tx (no ETH gas — Tempo pays in stablecoins)
#    - pins generated assets to IPFS via Pinata (if needed)
#    - routes AI calls through Lovable AI Gateway (server-side)
#    - exposes the contract address + Tempo Explorer link in the UI

# 4. Open the live Tempo Explorer link. Your demo is provably onchain.

1. The contract — credit baked in

Every Solidity file deployed from a Creative Tempo prompt MUST carry the hackathon credit in NatSpec, so provenance lives onchain alongside the bytecode.

contracts/Provenance.sol
// 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 — Tempo + Sourcify

Tempo verifies via Sourcify at contracts.tempo.xyz. No Etherscan API key is required — that whole line item disappears from the setup.

hardhat.config.cjs
// hardhat.config.cjs — Tempo Moderato + Sourcify verifier
require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-verify");

module.exports = {
  solidity: { version: "0.8.24", settings: { optimizer: { enabled: true, runs: 200 } } },
  networks: {
    tempo: {
      url: process.env.TEMPO_RPC_URL || "https://rpc.moderato.tempo.xyz",
      accounts: [process.env.METAMASK_PRIVATE_KEY.startsWith("0x")
        ? process.env.METAMASK_PRIVATE_KEY
        : "0x" + process.env.METAMASK_PRIVATE_KEY],
      chainId: 42431,
    },
  },
  sourcify: {                                      // Tempo verifier — no API key needed
    enabled: true,
    apiUrl: "https://contracts.tempo.xyz",
    browserUrl: "https://explore.testnet.tempo.xyz",
  },
  etherscan: { enabled: false },
};

3. Deploy + verify on the Tempo Explorer

deploy & verify
# Deploy then verify — one shot on Tempo Moderato
npx hardhat run scripts/deploy.cjs --network tempo
# After deploy prints the address:
npx hardhat verify --network tempo <address>
# Sourcify returns "exact_match" and source appears on the Tempo Explorer:
#   https://explore.testnet.tempo.xyz/address/<address>

4. Pin assets to IPFS via Pinata

src/lib/pinata.ts
// 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 ${import.meta.env.VITE_PINATA_JWT}` },
    body: fd,
  });
  const { IpfsHash } = await r.json();
  return IpfsHash as string; // the CID
}

5. Sign in with Google via Privy

src/main.tsx
// src/main.tsx — Privy social login + sponsored tx on Tempo Moderato
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: 42431,
      name: "Tempo Moderato",
      nativeCurrency: { name: "USD", symbol: "USD", decimals: 6 },
      rpcUrls: { default: { http: [import.meta.env.VITE_TEMPO_RPC_URL] } },
    },
  }}
>
  <App />
</PrivyProvider>

Hackathon rules of thumb

  • · One mega-prompt = one build message. Don't iterate the architecture, iterate the UI.
  • · Always show the live Tempo Explorer link in the UI — that's your proof.
  • · Use Privy sponsored tx so judges don't need a wallet — Tempo pays gas in stablecoins.
  • · Route AI through Lovable AI Gateway with LOVABLE_API_KEY inside a server function. Never in the browser.
  • · 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.