Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
Expand Down
4 changes: 2 additions & 2 deletions src/decibel/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def _create_deployment(package: str) -> Deployment:
)


_MAINNET_PACKAGE = "0xe6683d451db246750f180fb78d9b5e0a855dacba64ddf5810dffdaeb221e46bf"
_MAINNET_PACKAGE = "0x50ead22afd6ffd9769e3b3d6e0e64a2a350d68e8b102c4e72e33d0b8cfdfdb06"
_MAINNET_USDC = "0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b"
_NETNA_PACKAGE = "0xb8a5788314451ce4d2fbbad32e1bad88d4184b73943b7fe5166eab93cf1a5a95"
_TESTNET_PACKAGE = "0x952535c3049e52f195f26798c2f1340d7dd5100edbe0f464e520a974d16fbe9f"
_TESTNET_PACKAGE = "0xe7da2794b1d8af76532ed95f38bfdf1136abfd8ea3a240189971988a83101b7f"
_LOCAL_PACKAGE = "0xb8a5788314451ce4d2fbbad32e1bad88d4184b73943b7fe5166eab93cf1a5a95"
_DOCKER_PACKAGE = "0xb8a5788314451ce4d2fbbad32e1bad88d4184b73943b7fe5166eab93cf1a5a95"

Expand Down
5 changes: 4 additions & 1 deletion src/decibel/abi/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

CHAIN_ID_NETNA = 208
CHAIN_ID_TESTNET = 2
CHAIN_ID_MAINNET = 1


@lru_cache(maxsize=4)
Expand All @@ -31,7 +32,9 @@ def _load_abi_json(filename: str) -> ABIData:


def get_abi_data(chain_id: int | None) -> ABIData:
if chain_id == CHAIN_ID_NETNA:
if chain_id == CHAIN_ID_MAINNET:
return _load_abi_json("mainnet.json")
elif chain_id == CHAIN_ID_NETNA:
return _load_abi_json("netna.json")
elif chain_id == CHAIN_ID_TESTNET:
return _load_abi_json("testnet.json")
Expand Down
8 changes: 5 additions & 3 deletions src/decibel/abi/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from aptos_sdk.account_address import AccountAddress
from aptos_sdk.async_client import RestClient

from decibel._constants import NAMED_CONFIGS, NETNA_CONFIG, TESTNET_CONFIG, DecibelConfig
from decibel._constants import MAINNET_CONFIG, NAMED_CONFIGS, NETNA_CONFIG, TESTNET_CONFIG, DecibelConfig

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -42,6 +42,8 @@ def get_abi_filename(config: DecibelConfig) -> str:
return "netna.json"
elif config == TESTNET_CONFIG:
return "testnet.json"
elif config == MAINNET_CONFIG:
return "mainnet.json"
else:
return f"{config.network.value}.json"

Expand Down Expand Up @@ -167,14 +169,14 @@ def cli() -> None:
"networks",
nargs="*",
default=["netna"],
help="Networks to fetch ABIs for (netna, testnet, all). Default: netna",
help="Networks to fetch ABIs for (netna, testnet, mainnet, all). Default: netna",
)

args = parser.parse_args()

networks: list[str] = args.networks
if "all" in networks:
networks = ["netna", "testnet"]
networks = ["netna", "testnet", "mainnet"]

asyncio.run(main(networks))

Expand Down
Loading