Skip to content

Instantly share code, notes, and snippets.

@technophile-04
Last active September 22, 2024 12:49
Show Gist options
  • Save technophile-04/c7cd219469eec9299d0e5e5f69d77c6d to your computer and use it in GitHub Desktop.
Save technophile-04/c7cd219469eec9299d0e5e5f69d77c6d to your computer and use it in GitHub Desktop.

Revisions

  1. technophile-04 revised this gist Mar 10, 2024. No changes.
  2. technophile-04 revised this gist Mar 10, 2024. 1 changed file with 32 additions and 13 deletions.
    45 changes: 32 additions & 13 deletions scaffold.config.ts
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,25 @@
    import * as chains from "wagmi/chains";
    import * as chains from "viem/chains";

    // Blast chain
    export const blast = {
    id: 81457,
    name: "Blast",
    network: "blast",
    nativeCurrency: { name: "Blast", symbol: "ETH", decimals: 18 },
    rpcUrls: {
    default: { http: ["https://rpc.blast.io"] },
    public: { http: ["https://rpc.blast.io"] },
    },
    blockExplorers: {
    default: { name: "Blastscan", url: "https://blastscan.io" },
    },
    contracts: {
    multicall3: {
    address: "0xcA11bde05977b3631167028862bE2a173976CA11",
    blockCreated: 212929,
    },
    },
    } as const satisfies chains.Chain;

    // Base chain
    export const base = {
    @@ -15,10 +36,6 @@ export const base = {
    },
    },
    blockExplorers: {
    blockscout: {
    name: "Basescout",
    url: "https://base.blockscout.com",
    },
    default: {
    name: "Basescan",
    url: "https://basescan.org",
    @@ -37,7 +54,7 @@ export const base = {
    } as const satisfies chains.Chain;

    export type ScaffoldConfig = {
    targetNetwork: chains.Chain;
    targetNetworks: readonly chains.Chain[];
    pollingInterval: number;
    alchemyApiKey: string;
    walletConnectProjectId: string;
    @@ -46,13 +63,11 @@ export type ScaffoldConfig = {
    };

    const scaffoldConfig = {
    // The network where your DApp lives in
    targetNetwork: base,
    // for base goerli testnet :
    // targetNetwork : chains.baseGoerli,
    // The networks on which your DApp is live
    targetNetworks: [base, blast],

    // The interval at which your front-end polls the RPC servers for new data
    // it has no effect on the local network
    // it has no effect if you only target the local network (default is 4000)
    pollingInterval: 30000,

    // This is ours Alchemy's default API key.
    @@ -76,13 +91,17 @@ const scaffoldConfig = {
    * 2. If user is not connected to any wallet: On reload, connect to burner wallet if burnerWallet.enabled is true && burnerWallet.onlyLocal is false
    */
    walletAutoConnect: true,
    } satisfies ScaffoldConfig;
    } as const satisfies ScaffoldConfig;

    export default scaffoldConfig;


    // In hardhat.config.ts under networks key
    /*
    blast : {
    url: "https://rpc.blast.io",
    accounts: [deployerPrivateKey]
    }
    base : {
    url: "https://mainnet.base.org",
    accounts: [deployerPrivateKey]
  3. technophile-04 revised this gist Aug 10, 2023. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions scaffold.config.ts
    Original file line number Diff line number Diff line change
    @@ -79,3 +79,17 @@ const scaffoldConfig = {
    } satisfies ScaffoldConfig;

    export default scaffoldConfig;

    // In hardhat.config.ts under networks key
    /*
    base : {
    url: "https://mainnet.base.org",
    accounts: [deployerPrivateKey]
    },
    baseGoerli : {
    url: "https://goerli.base.org",
    accounts: [deployerPrivateKey]
    }
    */
  4. technophile-04 created this gist Aug 10, 2023.
    81 changes: 81 additions & 0 deletions scaffold.config.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,81 @@
    import * as chains from "wagmi/chains";

    // Base chain
    export const base = {
    id: 8453,
    network: "base",
    name: "Base",
    nativeCurrency: { name: "Base", symbol: "ETH", decimals: 18 },
    rpcUrls: {
    default: {
    http: ["https://mainnet.base.org"],
    },
    public: {
    http: ["https://mainnet.base.org"],
    },
    },
    blockExplorers: {
    blockscout: {
    name: "Basescout",
    url: "https://base.blockscout.com",
    },
    default: {
    name: "Basescan",
    url: "https://basescan.org",
    },
    etherscan: {
    name: "Basescan",
    url: "https://basescan.org",
    },
    },
    contracts: {
    multicall3: {
    address: "0xca11bde05977b3631167028862be2a173976ca11",
    blockCreated: 5022,
    },
    },
    } as const satisfies chains.Chain;

    export type ScaffoldConfig = {
    targetNetwork: chains.Chain;
    pollingInterval: number;
    alchemyApiKey: string;
    walletConnectProjectId: string;
    onlyLocalBurnerWallet: boolean;
    walletAutoConnect: boolean;
    };

    const scaffoldConfig = {
    // The network where your DApp lives in
    targetNetwork: base,
    // for base goerli testnet :
    // targetNetwork : chains.baseGoerli,

    // The interval at which your front-end polls the RPC servers for new data
    // it has no effect on the local network
    pollingInterval: 30000,

    // This is ours Alchemy's default API key.
    // You can get your own at https://dashboard.alchemyapi.io
    // It's recommended to store it in an env variable:
    // .env.local for local testing, and in the Vercel/system env config for live apps.
    alchemyApiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF",

    // This is ours WalletConnect's default project ID.
    // You can get your own at https://cloud.walletconnect.com
    // It's recommended to store it in an env variable:
    // .env.local for local testing, and in the Vercel/system env config for live apps.
    walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID || "3a8170812b534d0ff9d794f19a901d64",

    // Only show the Burner Wallet when running on hardhat network
    onlyLocalBurnerWallet: true,

    /**
    * Auto connect:
    * 1. If the user was connected into a wallet before, on page reload reconnect automatically
    * 2. If user is not connected to any wallet: On reload, connect to burner wallet if burnerWallet.enabled is true && burnerWallet.onlyLocal is false
    */
    walletAutoConnect: true,
    } satisfies ScaffoldConfig;

    export default scaffoldConfig;