Skip to content

Instantly share code, notes, and snippets.

@pmatsinopoulos
Created July 9, 2024 12:43
Show Gist options
  • Save pmatsinopoulos/20ad81ee37a7f3c7009e73c7f86a8694 to your computer and use it in GitHub Desktop.
Save pmatsinopoulos/20ad81ee37a7f3c7009e73c7f86a8694 to your computer and use it in GitHub Desktop.
Hardhat configuration to connect to optimism via Alchemy
import { HardhatUserConfig, vars } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
const ALCHEMY_API_KEY = vars.get("ALCHEMY_API_KEY");
const ACCOUNT_PRIVATE_KEY = vars.get("ACCOUNT_PRIVATE_KEY")
const config: HardhatUserConfig = {
solidity: "0.8.24",
networks: {
optimism: {
url: `https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: [ACCOUNT_PRIVATE_KEY],
},
},
};
export default config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment