Skip to content

Commit

Permalink
Merge pull request #168
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Dec 9, 2024
2 parents 16e6a9e + 0b54e12 commit 2d79359
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .changeset/dirty-pillows-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"create-eth": patch
---

- **Optimism and base networks verification (https://github.com/scaffold-eth/scaffold-eth-2/pull/996)**
- **move 99_deployScript as hardhat task (https://github.com/scaffold-eth/scaffold-eth-2/pull/1005)**
- **feat: use current yarn version in vercel on deploy via cli (https://github.com/scaffold-eth/scaffold-eth-2/pull/1007)**
9 changes: 5 additions & 4 deletions templates/base/packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"lint": "next lint",
"format": "prettier --write . '!(node_modules|.next|contracts)/**/*'",
"check-types": "tsc --noEmit --incremental",
"vercel": "vercel",
"vercel:yolo": "vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true"
"vercel": "vercel --build-env YARN_ENABLE_IMMUTABLE_INSTALLS=false --build-env ENABLE_EXPERIMENTAL_COREPACK=1",
"vercel:yolo": "vercel --build-env YARN_ENABLE_IMMUTABLE_INSTALLS=false --build-env ENABLE_EXPERIMENTAL_COREPACK=1 --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true"
},
"dependencies": {
"@heroicons/react": "~2.1.5",
Expand Down Expand Up @@ -51,6 +51,7 @@
"tailwindcss": "~3.4.11",
"type-fest": "~4.26.1",
"typescript": "<5.6.0",
"vercel": "~37.4.2"
}
"vercel": "~39.1.3"
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# To access the values stored in this .env file you can use: process.env.VARIABLENAME
ALCHEMY_API_KEY=
DEPLOYER_PRIVATE_KEY=
ETHERSCAN_API_KEY=
ETHERSCAN_MAINNET_API_KEY=
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import "solidity-coverage";
import "@nomicfoundation/hardhat-verify";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
import { task } from "hardhat/config";
import generateTsAbis from "./scripts/generateTsAbis";
${imports.filter(Boolean).join("\n")}
// If not set, it uses ours Alchemy's default API key.
Expand All @@ -36,8 +38,10 @@ const providerApiKey = process.env.ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr2
// 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";
// If not set, it uses our block explorers default API keys.
const etherscanApiKey = process.env.ETHERSCAN_MAINNET_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW";
const etherscanOptimisticApiKey = process.env.ETHERSCAN_OPTIMISTIC_API_KEY || "RM62RDISS1RH448ZY379NX625ASG1N633R";
const basescanApiKey = process.env.BASESCAN_API_KEY || "ZZZEIPMT1MNJ8526VV2Y744CA7TNZR64G6";
const config: HardhatUserConfig = {
solidity: {
Expand Down Expand Up @@ -79,10 +83,22 @@ const config: HardhatUserConfig = {
optimism: {
url: \`https://opt-mainnet.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
verify: {
etherscan: {
apiUrl: "https://api-optimistic.etherscan.io",
apiKey: etherscanOptimisticApiKey,
},
},
},
optimismSepolia: {
url: \`https://opt-sepolia.g.alchemy.com/v2/\${providerApiKey}\`,
accounts: [deployerPrivateKey],
verify: {
etherscan: {
apiUrl: "https://api-sepolia-optimistic.etherscan.io",
apiKey: etherscanOptimisticApiKey,
},
},
},
polygon: {
url: \`https://polygon-mainnet.g.alchemy.com/v2/\${providerApiKey}\`,
Expand Down Expand Up @@ -111,10 +127,22 @@ const config: HardhatUserConfig = {
base: {
url: "https://mainnet.base.org",
accounts: [deployerPrivateKey],
verify: {
etherscan: {
apiUrl: "https://api.basescan.org",
apiKey: basescanApiKey,
},
},
},
baseSepolia: {
url: "https://sepolia.base.org",
accounts: [deployerPrivateKey],
verify: {
etherscan: {
apiUrl: "https://api-sepolia.basescan.org",
apiKey: basescanApiKey,
},
},
},
scrollSepolia: {
url: "https://sepolia-rpc.scroll.io",
Expand Down Expand Up @@ -156,6 +184,14 @@ const config: HardhatUserConfig = {
},
};
// Extend the deploy task
task("deploy").setAction(async (args, hre, runSuper) => {
// Run the original deploy task
await runSuper(args);
// Force run the generateTsAbis script
await generateTsAbis(hre);
});
export default config;`
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function getContractDataFromDeployments() {
const { abi, address, metadata } = JSON.parse(
fs.readFileSync(`${DEPLOYMENTS_DIR}/${chainName}/${contractName}.json`).toString(),
);
const inheritedFunctions = getInheritedFunctions(JSON.parse(metadata).sources, contractName);
const inheritedFunctions = metadata ? getInheritedFunctions(JSON.parse(metadata).sources, contractName) : {};
contracts[contractName] = { address, abi, inheritedFunctions };
}
output[chainId] = contracts;
Expand Down Expand Up @@ -125,9 +125,3 @@ const generateTsAbis: DeployFunction = async function () {
};

export default generateTsAbis;

// Tags are useful if you have multiple deploy files and only want to run one of them.
// e.g. yarn deploy --tags generateTsAbis
generateTsAbis.tags = ["generateTsAbis"];

generateTsAbis.runAtTheEnd = true;

0 comments on commit 2d79359

Please sign in to comment.