diff --git a/CHANGELOG.md b/CHANGELOG.md index 4286efaf3..f38daf693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # create-eth +## 0.0.61 + +### Patch Changes + +- ab052e3: alchemy defaults + ## 0.0.60 ### Patch Changes diff --git a/package.json b/package.json index cf0d6d1d4..2b91fff79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-eth", - "version": "0.0.60", + "version": "0.0.61", "description": "Create a Scaffold-ETH-2 app", "repository": { "type": "git", diff --git a/templates/base/packages/nextjs/scaffold.config.ts.template.mjs b/templates/base/packages/nextjs/scaffold.config.ts.template.mjs index 430cd56fd..22920768c 100644 --- a/templates/base/packages/nextjs/scaffold.config.ts.template.mjs +++ b/templates/base/packages/nextjs/scaffold.config.ts.template.mjs @@ -19,10 +19,11 @@ const scaffoldConfig = { // it has no effect if you only target the local network (default is 4000) pollingInterval: 30000, - // You can get your Alchemy's default API key at https://dashboard.alchemyapi.io + // 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 || "", + 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 diff --git a/templates/base/packages/nextjs/services/web3/wagmiConfig.tsx b/templates/base/packages/nextjs/services/web3/wagmiConfig.tsx index f3eed0940..30fc4f9da 100644 --- a/templates/base/packages/nextjs/services/web3/wagmiConfig.tsx +++ b/templates/base/packages/nextjs/services/web3/wagmiConfig.tsx @@ -18,7 +18,7 @@ export const wagmiConfig = createConfig({ ssr: true, client({ chain }) { const alchemyHttpUrl = getAlchemyHttpUrl(chain.id); - const rpcFallbacks = alchemyHttpUrl ? [http(alchemyHttpUrl), http()] : [http()]; + const rpcFallbacks = alchemyHttpUrl ? [http(), http(alchemyHttpUrl)] : [http()]; return createClient({ chain, diff --git a/templates/solidity-frameworks/foundry/packages/foundry/.env.example b/templates/solidity-frameworks/foundry/packages/foundry/.env.example index bf10f5c48..626a685b1 100644 --- a/templates/solidity-frameworks/foundry/packages/foundry/.env.example +++ b/templates/solidity-frameworks/foundry/packages/foundry/.env.example @@ -10,8 +10,9 @@ # which comes with anvil chain to deploy contract. # NOTE: You don't need to manually change the value of DEPLOYER_PRIVATE_KEY, it should # be auto filled when run `yarn generate`. -# Although `.env` is ignored by git, it's still important that you don't paste your -# actual account private key and use the generated one. + +# Alchemy rpc URL is used while deploying the contracts to some testnets/mainnets, checkout `foundry.toml` for it's use. +ALCHEMY_API_KEY=oKxs-03sij-U_N0iOlrSsZFr29-IqbuF # Etherscan API key is used to verify the contract on etherscan. ETHERSCAN_API_KEY=DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW # Default account for localhost / use "scaffold-eth-custom" if you wish to use a generated account or imported account diff --git a/templates/solidity-frameworks/foundry/packages/foundry/foundry.toml b/templates/solidity-frameworks/foundry/packages/foundry/foundry.toml index e21cbf8cc..bd4de0621 100644 --- a/templates/solidity-frameworks/foundry/packages/foundry/foundry.toml +++ b/templates/solidity-frameworks/foundry/packages/foundry/foundry.toml @@ -8,14 +8,14 @@ fs_permissions = [{ access = "read-write", path = "./"}] default_network = "http://127.0.0.1:8545" localhost = "http://127.0.0.1:8545" -mainnet = "https://cloudflare-eth.com" -sepolia = "https://rpc2.sepolia.org" -arbitrum = "https://arb1.arbitrum.io/rpc" -arbitrumSepolia = "https://sepolia-rollup.arbitrum.io/rpc" -optimism = "https://mainnet.optimism.io" -optimismSepolia = "https://sepolia.optimism.io" -polygon = "https://polygon-rpc.com" -polygonMumbai = "https://rpc.ankr.com/polygon_mumbai" +mainnet = "https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_API_KEY}" +sepolia = "https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +arbitrum = "https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +arbitrumSepolia = "https://arb-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +optimism = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +optimismSepolia = "https://opt-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +polygon = "https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +polygonMumbai = "https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}" polygonZkEvm = "https://zkevm-rpc.com" polygonZkEvmTestnet = "https://rpc.public.zkevm-test.net" gnosis = "https://rpc.gnosischain.com" diff --git a/templates/solidity-frameworks/hardhat/packages/hardhat/.env.example b/templates/solidity-frameworks/hardhat/packages/hardhat/.env.example index 38117830b..a9ccb0860 100644 --- a/templates/solidity-frameworks/hardhat/packages/hardhat/.env.example +++ b/templates/solidity-frameworks/hardhat/packages/hardhat/.env.example @@ -6,6 +6,6 @@ # but we recommend getting your own API Keys for Production Apps. # To access the values stored in this .env file you can use: process.env.VARIABLENAME -FORKING_URL= +ALCHEMY_API_KEY= DEPLOYER_PRIVATE_KEY= ETHERSCAN_API_KEY= diff --git a/templates/solidity-frameworks/hardhat/packages/hardhat/hardhat.config.ts.template.mjs b/templates/solidity-frameworks/hardhat/packages/hardhat/hardhat.config.ts.template.mjs index d69f830f4..e4aadc336 100644 --- a/templates/solidity-frameworks/hardhat/packages/hardhat/hardhat.config.ts.template.mjs +++ b/templates/solidity-frameworks/hardhat/packages/hardhat/hardhat.config.ts.template.mjs @@ -30,13 +30,14 @@ import "hardhat-deploy"; import "hardhat-deploy-ethers"; ${imports.filter(Boolean).join("\n")} +// If not set, it uses ours Alchemy's default API key. +// You can get your own at https://dashboard.alchemyapi.io +const providerApiKey = process.env.ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF"; // If not set, it uses the hardhat account 0 private key. const deployerPrivateKey = process.env.DEPLOYER_PRIVATE_KEY ?? "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; // If not set, it uses ours Etherscan default API key. const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW"; -// forking rpc url -const forkingURL = process.env.FORKING_URL || ""; const config: HardhatUserConfig = { solidity: { @@ -55,48 +56,48 @@ const config: HardhatUserConfig = { // If the network you are looking for is not here you can add new network settings hardhat: { forking: { - url: forkingURL, + url: \`https://eth-mainnet.alchemyapi.io/v2/\${providerApiKey}\`, enabled: process.env.MAINNET_FORKING_ENABLED === "true", }, }, mainnet: { - url: \`https://cloudflare-eth.com\`, + url: \`https://eth-mainnet.alchemyapi.io/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, sepolia: { - url: \`https://rpc2.sepolia.org\`, + url: \`https://eth-sepolia.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, arbitrum: { - url: \`https://arb1.arbitrum.io/rpc\`, + url: \`https://arb-mainnet.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, arbitrumSepolia: { - url: \`https://sepolia-rollup.arbitrum.io/rpc\`, + url: \`https://arb-sepolia.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, optimism: { - url: \`https://mainnet.optimism.io\`, + url: \`https://opt-mainnet.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, optimismSepolia: { - url: \`https://sepolia.optimism.io\`, + url: \`https://opt-sepolia.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, polygon: { - url: \`https://polygon-rpc.com\`, + url: \`https://polygon-mainnet.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, polygonMumbai: { - url: \`https://rpc.ankr.com/polygon_mumbai\`, + url: \`https://polygon-mumbai.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, polygonZkEvm: { - url: \`https://zkevm-rpc.com\`, + url: \`https://polygonzkevm-mainnet.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, polygonZkEvmTestnet: { - url: \`https://rpc.public.zkevm-test.net\`, + url: \`https://polygonzkevm-testnet.g.alchemy.com/v2/\${providerApiKey}\`, accounts: [deployerPrivateKey], }, gnosis: {