From d82e9641ea3677ea1f7627721a15e7633cb955b6 Mon Sep 17 00:00:00 2001 From: 0xevolve Date: Mon, 15 Apr 2024 12:49:22 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 7 ++-- deployments/sepolia/declarations.json | 2 +- scripts/add_pairs.py | 20 ++++++------ scripts/register_publishers.py | 46 +-------------------------- scripts/utils/constants.py | 9 ++---- scripts/utils/starknet.py | 7 ++-- 6 files changed, 20 insertions(+), 71 deletions(-) diff --git a/.env.example b/.env.example index 90c145c8..6b54e172 100644 --- a/.env.example +++ b/.env.example @@ -8,11 +8,8 @@ STARKNET_NETWORK=devnet MAINNET_ACCOUNT_ADDRESS= MAINNET_PRIVATE_KEY= -TESTNET_ACCOUNT_ADDRESS= -TESTNET_PRIVATE_KEY= - -TESTNET2_ACCOUNT_ADDRESS= -TESTNET2_PRIVATE_KEY= +SEPOLIA_ACCOUNT_ADDRESS= +SEPOLIA_PRIVATE_KEY= DEVNET_ACCOUNT_ADDRESS= DEVNET_PRIVATE_KEY= diff --git a/deployments/sepolia/declarations.json b/deployments/sepolia/declarations.json index 6887d929..bccd7f84 100644 --- a/deployments/sepolia/declarations.json +++ b/deployments/sepolia/declarations.json @@ -1,5 +1,5 @@ { - "pragma_Oracle": "0x25abeffbd83906d362db31c461a2c72b71a9b106d3c29fa054bf2d23949ae26", + "pragma_Oracle": "0x1e36e19e57bd8956e59c4ae0604de92e0bbf648efbf697467c2bfb2de92a953", "pragma_Ownable": "0x7b50a7a9bbb75d08248135003f1c87f0d44ba23018dc0ca480ac37a901531f3", "pragma_PublisherRegistry": "0x306288971002bd7906e3a607d504dfb28dcbdc7655a115984e567dce3b67e8f", "pragma_SummaryStats": "0x3b5bf1c2f918de14620b3c63e2c6543cf0a138df258bce3d03e3fb0b7d2183a", diff --git a/scripts/add_pairs.py b/scripts/add_pairs.py index 978c2c64..969845bd 100644 --- a/scripts/add_pairs.py +++ b/scripts/add_pairs.py @@ -32,21 +32,21 @@ load_dotenv() currencies_to_add = [ - # Currency( - # "STRK", - # 18, - # False, - # 0x04718F5A0FC34CC1AF16A1CDEE98FFB20C31F5CD61D6AB07201858F4287C938D, - # 0xCA14007EFF0DB1F8135F4C25B34DE49AB0D42766, - # ) + Currency( + "DPI", + 18, + False, + 0, + 0x1494CA1F11D487C2BBE4543E90080AEBA4BA3C2B, + ) ] pairs_to_add = [ - # Pair("STRK/USD", "STRK", "USD"), + Pair("DPI/USD", "DPI", "USD"), ] pairs_to_update = [ - Pair("WSTETH/ETH", "WSTETH", "ETH"), - Pair("WSTETH/USD", "WSTETH", "USD"), + # Pair("WSTETH/ETH", "WSTETH", "ETH"), + # Pair("WSTETH/USD", "WSTETH", "USD"), ] diff --git a/scripts/register_publishers.py b/scripts/register_publishers.py index a6bda0e9..edf94cec 100644 --- a/scripts/register_publishers.py +++ b/scripts/register_publishers.py @@ -49,6 +49,7 @@ "BINANCE", "HUOBI", "BYBIT", + "INDEXCOOP", ] DEX_SOURCES = [ @@ -62,51 +63,6 @@ network = "sepolia" -# TODO: load data from JSON/YAML -""" -TESTNET -""" -if network == "testnet": - publishers = [ - "PRAGMA", - "EQUILIBRIUM", - "ARGENT", - "GEMINI", - "SKYNET_TRADING", - "FOURLEAF", - "NETHERMIND", - "FLOWDESK", - "CRYPTOMENTUM", - "AVNU", - "SPACESHARD", - ] - publishers_sources = [ - THIRD_PARTY_SOURCES, - THIRD_PARTY_SOURCES, - THIRD_PARTY_SOURCES, - ["GEMINI"], - ["SKYNET_TRADING", "SKYNET"], - ["FOURLEAF"], - THIRD_PARTY_SOURCES, - ["FLOWDESK"], - ["CRYPTOMENTUM"], - ["AVNU"] + DEX_SOURCES, - THIRD_PARTY_SOURCES, - ] - publisher_address = [ - 0x0624EBFB99865079BD58CFCFB925B6F5CE940D6F6E41E118B8A72B7163FB435C, - 0xCF357FA043A29F7EA06736CC253D8D6D8A208C03B92FFB4B50074F8470818B, - 0x01DAA5CB5F56D96832990DDF4EB9D4F09BA72AFF39AF13028AF67DCE9934A74C, - 0x17A6F7E8196C9A7AFF90B7CC4BF98842894ECC2B9CC1A3703A1AAB948FCE208, - 0x1D8E01188C4C8984FB19F00156491787E64FD2DE1C3CE4EB9571924C540CF3B, - 0x4E2863FD0FF85803EEF98CE5DD8272AB21C6595537269A2CD855A10EBCC18CC, - 0x022641362F12D72103F3BADFBDC8E1A77FCA91EB1F3835638EEC55EBCAEAAFFD, - 0x0264CD871A4B5A6B441EB2862B3785E01C4CB82A133E3A65A01827BB8DF4B871, - 0x5B1400D876CAAA7BA7858DF28FAA73A16318AB8551397D83016FB33CB590B28, - 0x052D8E9778D026588A51595E30B0F45609B4F771EECF0E335CDEFED1D84A9D89, - 0x0271E25BF6EF39B48AB319456C7DB88767F0B38D53E1285C5B3E901C60CD878C, - ] - admin_address = 0x02356B628D108863BAF8644C945D97BAD70190AF5957031F4852D00D0F690A77 """ MAINNET diff --git a/scripts/utils/constants.py b/scripts/utils/constants.py index 4eb4f29d..9580236c 100644 --- a/scripts/utils/constants.py +++ b/scripts/utils/constants.py @@ -22,12 +22,7 @@ NETWORKS = { "mainnet": { "name": "mainnet", - "rpc_url": f"https://free-rpc.nethermind.io/mainnet-juno", - }, - "testnet": { - "name": "testnet", - "explorer_url": "https://testnet.starkscan.co", - "rpc_url": f"https://starknet-testnet.public.blastapi.io", + "rpc_url": f"https://starknet-mainnet.public.blastapi.io/rpc/v0_6", }, "devnet": { "name": "devnet", @@ -37,7 +32,7 @@ "sepolia": { "name": "sepolia", "explorer_url": "https://sepolia.starkscan.co/", - "rpc_url": "https://free-rpc.nethermind.io/sepolia-juno", + "rpc_url": "https://starknet-sepolia.public.blastapi.io/rpc/v0_6", }, "katana": { "name": "katana", diff --git a/scripts/utils/starknet.py b/scripts/utils/starknet.py index 1c837fbe..0e511c74 100644 --- a/scripts/utils/starknet.py +++ b/scripts/utils/starknet.py @@ -232,7 +232,6 @@ async def deploy_v2(contract_name, *args, port=None): ) await deploy_result.wait_for_acceptance() - print("deploy_result", deploy_result) logger.info( f"✅ {contract_name} deployed at: {hex(deploy_result.deployed_contract.address)}" @@ -256,9 +255,11 @@ async def invoke(contract_name, function_name, inputs, address=None, port=None): selector=get_selector_from_name(function_name), calldata=inputs, ) - print("call", call) logger.info(f"ℹī¸ Invoking {contract_name}.{function_name}({json.dumps(inputs)})") - response = await account.execute(calls=call, max_fee=MAX_FEE) + response = await account.execute( + calls=call, + max_fee=MAX_FEE, + ) await account.client.wait_for_tx(response.transaction_hash) logger.info( f"✅ {contract_name}.{function_name} invoked at tx: %s",