Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(contracts): move away from infura key to full rpc url #1411

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions contracts/.env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
MNEMONIC=
# api key for eth mainnet etherscan
ETH_ETHERSCAN_API_KEY=
# api key for optimism mainnet etherscan
OPTIMISM_ETHERSCAN_API_KEY=
INFURA_KEY=
OP_RPC_URL=
GAS_PRICE=
# RPC url to talk to optimism mainnet
SEPOLIA_RPC_URL=
# RPC url to talk to optimism sepolia
OP_SEPOLIA_RPC_URL=
# Forking url for testing
FORKING_URL=
# Gas price to use for transactions
GAS_PRICE=
# Block number to fork from
FORKING_BLOCK_NUM=
# Hardhat logging level (true/false)
HARDHAT_LOGGING=
9 changes: 5 additions & 4 deletions contracts/tasks/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const GWEI = 1e9;
export const STATE_TREE_ARITY = 5;

/**
* Convert gas price from gwei to wei
* Convert gas price from gweguari to wei
*
* @param value - gas price in gwei
* @returns gas price in wei
Expand All @@ -46,11 +46,12 @@ export const NETWORKS_DEFAULT_GAS: Record<ESupportedChains, number | "auto"> = {
* @returns {Record<ESupportedChains, string>} rpc urls for supported networks
*/
export const getNetworkRpcUrls = (): Record<ESupportedChains, string> => {
const INFURA_KEY = process.env.INFURA_KEY ?? "";
const SEPOLIA_RPC_URL = process.env.SEPOLIA_RPC_URL ?? "";
const OP_SEPOLIA_RPC_URL = process.env.OP_SEPOLIA_RPC_URL ?? "";

return {
[ESupportedChains.Sepolia]: `https://sepolia.infura.io/v3/${INFURA_KEY}`,
[ESupportedChains.OptimismSepolia]: `https://optimism-sepolia.infura.io/v3/${INFURA_KEY}`,
[ESupportedChains.Sepolia]: SEPOLIA_RPC_URL,
[ESupportedChains.OptimismSepolia]: OP_SEPOLIA_RPC_URL,
[ESupportedChains.Coverage]: "http://localhost:8555",
[ESupportedChains.Hardhat]: "http://localhost:8545",
};
Expand Down
Loading