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 Polygon Amoy demo in one shot.
Why Polygon Amoy?
Polygon Amoy is Coinbase's free L2 testnet — full EVM, PolygonScan explorer, standard wallets, but funded by a public faucet. Contracts are publicly inspectable, you never spend real POL, and Privy sponsored transactions on Base cost fractions of a cent so judges can try the demo without a wallet. PolygonScan 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... POLYGON_AMOY_RPC_URL=https://rpc-amoy.polygon.technology # or Alchemy Polygon Amoy HTTPS URL ETHERSCAN_API_KEY=... # Etherscan v2 single key — covers PolygonScan PRIVY_APP_ID=... PINATA_JWT=eyJhbGciOi... # 2. Fund the MetaMask account on Polygon Amoy: open https://faucet.polygon.technology/ # or https://www.alchemy.com/faucets/polygon-amoy # 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 Polygon Amoy and verifies on PolygonScan # - wires Privy social login + sponsored tx # - pins generated assets to IPFS via Pinata # - exposes the contract address + PolygonScan link in the UI # 4. Open the live PolygonScan 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 Polygon Amoy + 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 PolygonScan key required.
// hardhat.config.cjs — Polygon Amoy (chainId 80002) + 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: {
polygonAmoy: {
url: process.env.POLYGON_AMOY_RPC_URL || "https://rpc-amoy.polygon.technology",
accounts: pk ? [pk.startsWith("0x") ? pk : "0x" + pk] : [],
chainId: 80002,
},
},
etherscan: {
// Single Etherscan v2 key — works for PolygonScan too.
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [{
network: "polygonAmoy",
chainId: 80002,
urls: {
apiURL: "https://api.etherscan.io/v2/api?chainid=80002",
browserURL: "https://amoy.polygonscan.com",
},
}],
},
sourcify: { enabled: false },
};
3. Deploy + verify on PolygonScan
// scripts/deploy.cjs — deploys, then verifies on PolygonScan
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 polygonAmoy <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 Polygon Amoy (chainId 80002) as a supported chain in your Privy dashboard before shipping.
// src/main.tsx — Privy social login + sponsored Polygon Amoy 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: 80002, name: "Polygon Amoy" },
}}
>
<App />
</PrivyProvider>
Hackathon rules of thumb
- · One mega-prompt = one build message. Don't iterate the architecture, iterate the UI.
- · Always show the live PolygonScan 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.