Skip to content

Commit

Permalink
chore(contracts): move away from infura key to full rpc url
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed Apr 30, 2024
1 parent eb75e40 commit bda20a1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
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
2 changes: 1 addition & 1 deletion contracts/tests/EASGatekeeper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("EAS Gatekeeper", () => {
params: [
{
forking: {
jsonRpcUrl: process.env.OP_RPC_URL || "https://optimism.drpc.org",
jsonRpcUrl: process.env.FORKING_URL || "https://optimism.drpc.org",
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion contracts/tests/HatsGatekeeper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("HatsProtocol Gatekeeper", () => {
params: [
{
forking: {
jsonRpcUrl: process.env.OP_RPC_URL || "https://optimism.drpc.org",
jsonRpcUrl: process.env.FORKING_URL || "https://optimism.drpc.org",
},
},
],
Expand Down

0 comments on commit bda20a1

Please sign in to comment.