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 29, 2024
1 parent eb75e40 commit 23d369f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
12 changes: 9 additions & 3 deletions contracts/.env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
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 live networks
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=
6 changes: 3 additions & 3 deletions contracts/tasks/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ 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 RPC_URL = process.env.RPC_URL ?? "";

return {
[ESupportedChains.Sepolia]: `https://sepolia.infura.io/v3/${INFURA_KEY}`,
[ESupportedChains.OptimismSepolia]: `https://optimism-sepolia.infura.io/v3/${INFURA_KEY}`,
[ESupportedChains.Sepolia]: RPC_URL,
[ESupportedChains.OptimismSepolia]: 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 23d369f

Please sign in to comment.