From ab785a1ea92a8174409d0467524b2820e2d7a379 Mon Sep 17 00:00:00 2001 From: Thomas Marchand Date: Thu, 16 Nov 2023 14:05:04 +0300 Subject: [PATCH] fix: deployment --- scripts/deploy.py | 15 ++++++++++++++- scripts/utils/starknet.py | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/deploy.py b/scripts/deploy.py index d323d78..1ea5945 100644 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -1,7 +1,7 @@ # %% Imports import logging from asyncio import run - +from dotenv import load_dotenv from utils.constants import COMPILED_CONTRACTS, ETH_TOKEN_ADDRESS from utils.starknet import ( deploy_v2, @@ -10,11 +10,22 @@ get_starknet_account, dump_deployments, ) +import os logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) +load_dotenv() +NETWORK = os.getenv("STARKNET_NETWORK", "devnet") +# https://api.starknet.id/uri?id= +MAINNET_CONST = [0x68747470733A2F2F6170692E737461726B6E65742E69642F7572693F69643D] +# https://goerli.api.starknet.id/uri?id=" +GOERLI_CONST = [ + 0x68747470733A2F2F676F65726C692E6170692E737461726B6E65742E69642F, + 0x7572693F69643D, +] + # %% Main async def main(): @@ -31,6 +42,8 @@ async def main(): deployments = {} deployments["naming_Identity"] = await deploy_v2( "naming_Identity", + account.address, + (MAINNET_CONST if NETWORK == "mainnet" else GOERLI_CONST), ) identity_addr = deployments["naming_Identity"]["address"] diff --git a/scripts/utils/starknet.py b/scripts/utils/starknet.py index 84f876a..7b02e71 100644 --- a/scripts/utils/starknet.py +++ b/scripts/utils/starknet.py @@ -130,11 +130,11 @@ def get_tx_url(tx_hash: int) -> str: def get_sierra_artifact(contract_name): - return BUILD_DIR / f"{contract_name}.sierra.json" + return BUILD_DIR / f"{contract_name}.contract_class.json" def get_casm_artifact(contract_name): - return BUILD_DIR / f"{contract_name}.casm.json" + return BUILD_DIR / f"{contract_name}.compiled_contract_class.json" def get_abi(contract_name):