Skip to content

Commit

Permalink
CERT-6998 Add ZKSync chain (#8)
Browse files Browse the repository at this point in the history
* CERT-6998 Add ZKSync chain

* Auto change version.

---------

Co-authored-by: nivcertora <nivcertora@users.noreply.github.com>
  • Loading branch information
nivcertora and nivcertora authored Aug 27, 2024
1 parent a2a9f90 commit 4f7d5c5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ProposalTools/API/chainlink_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class ChainLinkAPI(metaclass=Singleton):
Chain.MET: "https://reference-data-directory.vercel.app/feeds-ethereum-mainnet-andromeda-1.json",
Chain.OPT: "https://reference-data-directory.vercel.app/feeds-ethereum-mainnet-optimism-1.json",
Chain.POLY: "https://reference-data-directory.vercel.app/feeds-matic-mainnet.json",
Chain.SCR: "https://reference-data-directory.vercel.app/feeds-ethereum-mainnet-scroll-1.json"
Chain.SCR: "https://reference-data-directory.vercel.app/feeds-ethereum-mainnet-scroll-1.json",
Chain.ZK: "https://reference-data-directory.vercel.app/feeds-ethereum-mainnet-zksync-1.json"
}

def __init__(self) -> None:
Expand Down
5 changes: 4 additions & 1 deletion ProposalTools/API/contract_source_code_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class ContractSourceCodeAPI():
Chain.POLY: APIinfo(base_url="https://api.polygonscan.com/api",
api_key=lambda: os.getenv('POLYSCAN_API_KEY')),
Chain.SCR: APIinfo(base_url="https://api.scrollscan.com/api",
api_key=lambda: os.getenv('SCRSCAN_API_KEY'))
api_key=lambda: os.getenv('SCRSCAN_API_KEY')),
Chain.ZK: APIinfo(base_url="https://api-era.zksync.network/api",
api_key=lambda: os.getenv('ZKSCAN_API_KEY'))

}

def __init__(self, chain: Chain) -> None:
Expand Down
3 changes: 2 additions & 1 deletion ProposalTools/Utils/chain_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ class Chain(StrEnum):
MET = 'MET'
OPT = 'OPT'
POLY = 'POLY'
SCR = 'SCR'
SCR = 'SCR'
ZK = 'ZK'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Before using ProposalTools, you need to configure the following environment vari
- **OPTSCAN_API_KEY:** API key for OptScan (Optimism).
- **POLYSCAN_API_KEY:** API key for PolygonScan (Polygon).
- **SCRSCAN_API_KEY:** API key for ScrollScan (Scroll).
- **ZKSCAN_API_KEY:** API key for ZKScan (ZKsync).

You can set these environment variables in your shell:

Expand All @@ -53,6 +54,7 @@ export METSCAN_API_KEY="your_metscan_api_key"
export OPTSCAN_API_KEY="your_optscan_api_key"
export POLYSCAN_API_KEY="your_polyscan_api_key"
export SCRSCAN_API_KEY="your_scrscan_api_key"
export ZKSCAN_API_KEY="your_zkscan_api_key"
```

Replace `your_etherscan_api_key`, `your_arbiscan_api_key`, etc., with the actual API keys provided by the respective blockchain explorers.
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240827.110744.858862
20240827.140931.710128

0 comments on commit 4f7d5c5

Please sign in to comment.