Skip to content

Commit c678fbb

Browse files
committed
docs: added script to retrieve Celer cBridge token addresses
1 parent e20f025 commit c678fbb

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

docs/_fetch-cbridge-tokens.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Retrieves all of the celer cBridge tokens to/from Oasis Sapphire mainnet
4+
"""
5+
import json
6+
from urllib.request import urlopen
7+
8+
def format_result(data):
9+
chains = {}
10+
for c in data["chains"]:
11+
chains[c["id"]] = c
12+
for p in data['pegged_pair_configs']:
13+
org_chain = chains[p['org_chain_id']]
14+
pegged_chain = chains[p['pegged_chain_id']]
15+
if p['org_chain_id'] in [0x5afe,0x5aff] or p['pegged_chain_id'] in [0x5afe,0x5aff]:
16+
src_url = org_chain['explore_url'] + 'address/' + p["org_token"]["token"]["address"]
17+
dest_url = pegged_chain['explore_url'] + 'address/' + p["pegged_token"]["token"]["address"]
18+
print(f'| {org_chain["name"]} ({org_chain["id"]}) | {p["org_token"]["token"]["symbol"]} | [`{p["org_token"]["token"]["address"]}`]({src_url}) | {pegged_chain["name"]} ({pegged_chain["id"]}) | [`{p["pegged_token"]["token"]["address"]}`]({dest_url}) |')
19+
20+
print('# Celer cBridge Tokens (Mainnet)')
21+
print("""<!-- NOTE: this is generated using `_fetch-cbridge-tokens.py` -->
22+
<!-- WARNING: please don't manually update the table! -->
23+
| Source Chain | Token Name | Source Address | Dest. Chain | Dest Address |
24+
| ------------ | ---------- | -------------- | ----------- | ------------ |""")
25+
with urlopen('https://cbridge-prod2.celer.app/v1/getTransferConfigs') as h:
26+
data = json.load(h)
27+
format_result(data)
28+
29+
print()
30+
print('# Testnet cBridge Tokens')
31+
print("""<!-- NOTE: this is generated using `_fetch-cbridge-tokens.py` -->
32+
<!-- WARNING: please don't manually update the table! -->
33+
| Source Chain | Token Name | Source Address | Dest. Chain | Dest Address |
34+
| ------------ | ---------- | -------------- | ----------- | ------------ |""")
35+
with urlopen('https://cbridge-v2-test.celer.network/v1/getTransferConfigs') as h:
36+
data = json.load(h)
37+
format_result(data)

docs/addresses.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,26 @@ description: List of Standard Contract Addresses
1717
[wrose-source]: https://github.com/oasisprotocol/sapphire-paratime/blob/main/contracts/contracts/WrappedROSE.sol
1818
[wrose-verify-mainnet]: https://sourcify.dev/#/lookup/0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3
1919
[wrose-verify-testnet]: https://sourcify.dev/#/lookup/0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94
20+
21+
# Celer cBridge Tokens (Mainnet)
22+
<!-- NOTE: this is generated using `_fetch-cbridge-tokens.py` -->
23+
<!-- WARNING: please don't manually update the table! -->
24+
| Source Chain | Token Name | Source Address | Dest. Chain | Dest Address |
25+
| ------------ | ---------- | -------------- | ----------- | ------------ |
26+
| Ethereum Mainnet (1) | OCEAN | [`0x967da4048cD07aB37855c090aAF366e4ce1b9F48`](https://etherscan.io/address/0x967da4048cD07aB37855c090aAF366e4ce1b9F48) | Oasis Sapphire (23294) | [`0x39d22B78A7651A76Ffbde2aaAB5FD92666Aca520`](https://explorer.oasis.io/mainnet/sapphire/address/0x39d22B78A7651A76Ffbde2aaAB5FD92666Aca520) |
27+
| Ethereum Mainnet (1) | USDC | [`0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) | Oasis Sapphire (23294) | [`0x2c2E3812742Ab2DA53a728A09F5DE670Aba584b6`](https://explorer.oasis.io/mainnet/sapphire/address/0x2c2E3812742Ab2DA53a728A09F5DE670Aba584b6) |
28+
| Ethereum Mainnet (1) | USDT | [`0xdAC17F958D2ee523a2206206994597C13D831ec7`](https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7) | Oasis Sapphire (23294) | [`0xE48151964556381B33f93E05E36381Fd53Ec053E`](https://explorer.oasis.io/mainnet/sapphire/address/0xE48151964556381B33f93E05E36381Fd53Ec053E) |
29+
| Ethereum Mainnet (1) | WBTC | [`0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599`](https://etherscan.io/address/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599) | Oasis Sapphire (23294) | [`0xE9533976C590200E32d95C53f06AE12d292cFc47`](https://explorer.oasis.io/mainnet/sapphire/address/0xE9533976C590200E32d95C53f06AE12d292cFc47) |
30+
| Ethereum Mainnet (1) | WETH | [`0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`](https://etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2) | Oasis Sapphire (23294) | [`0xfc6b18d694F2D137dB762B152736Ba098F9808d9`](https://explorer.oasis.io/mainnet/sapphire/address/0xfc6b18d694F2D137dB762B152736Ba098F9808d9) |
31+
| BNB Chain (56) | BNB | [`0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c`](https://bscscan.com/address/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) | Oasis Sapphire (23294) | [`0xe95E3a9f1a45B5EDa71781448F6047d7B7e31cbF`](https://explorer.oasis.io/mainnet/sapphire/address/0xe95E3a9f1a45B5EDa71781448F6047d7B7e31cbF) |
32+
| Polygon PoS (137) | MATIC | [`0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270`](https://polygonscan.com/address/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270) | Oasis Sapphire (23294) | [`0xa349005a68FA33e8DACAAa850c45175bbcD49B19`](https://explorer.oasis.io/mainnet/sapphire/address/0xa349005a68FA33e8DACAAa850c45175bbcD49B19) |
33+
| Oasis Sapphire (23294) | wROSE | [`0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3`](https://explorer.oasis.io/mainnet/sapphire/address/0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3) | BNB Chain (56) | [`0xF00600eBC7633462BC4F9C61eA2cE99F5AAEBd4a`](https://bscscan.com/address/0xF00600eBC7633462BC4F9C61eA2cE99F5AAEBd4a) |
34+
35+
# Testnet cBridge Tokens
36+
<!-- NOTE: this is generated using `_fetch-cbridge-tokens.py` -->
37+
<!-- WARNING: please don't manually update the table! -->
38+
| Source Chain | Token Name | Source Address | Dest. Chain | Dest Address |
39+
| ------------ | ---------- | -------------- | ----------- | ------------ |
40+
| Goerli (5) | USDT | [`0xf4B2cbc3bA04c478F0dC824f4806aC39982Dce73`](https://goerli.etherscan.io/address/0xf4B2cbc3bA04c478F0dC824f4806aC39982Dce73) | Oasis Sapphire Testnet (23295) | [`0xa55C7E1274bE5db2275a0BDd055f81e8263b7954`](https://testnet.explorer.sapphire.oasis.dev/address/0xa55C7E1274bE5db2275a0BDd055f81e8263b7954) |
41+
| Oasis Sapphire Testnet (23295) | wROSE | [`0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94`](https://testnet.explorer.sapphire.oasis.dev/address/0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94) | BSC Testnet (97) | [`0x26a6f43BaEDD1767c283e2555A9E1236E5aE3A55`](https://testnet.bscscan.com/address/0x26a6f43BaEDD1767c283e2555A9E1236E5aE3A55) |
42+
| Oasis Sapphire Testnet (23295) | wROSE | [`0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94`](https://testnet.explorer.sapphire.oasis.dev/address/0xB759a0fbc1dA517aF257D5Cf039aB4D86dFB3b94) | Polygon Mumbai (80001) | [`0xE9533976C590200E32d95C53f06AE12d292cFc47`](https://mumbai.polygonscan.com/address/0xE9533976C590200E32d95C53f06AE12d292cFc47) |

0 commit comments

Comments
 (0)