Skip to content

Commit

Permalink
chore(merkle_feeds): upgrade contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolveArt committed Aug 8, 2024
1 parent 32c296b commit 36334d5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deployments/sepolia/declarations.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"pragma_Oracle": "0x5e269051bec902aa2bd421d348e023c3893c4ff93de6c5f4b8964cd67cc3fc5",
"pragma_Oracle": "0x230f20832d73433a0ef69663545aabb607a3bbc0ff0a5f75e5d9716730e4141",
"pragma_Ownable": "0x7b50a7a9bbb75d08248135003f1c87f0d44ba23018dc0ca480ac37a901531f3",
"pragma_PublisherRegistry": "0x306288971002bd7906e3a607d504dfb28dcbdc7655a115984e567dce3b67e8f",
"pragma_SummaryStats": "0x3b5bf1c2f918de14620b3c63e2c6543cf0a138df258bce3d03e3fb0b7d2183a",
Expand Down
4 changes: 2 additions & 2 deletions deployments/sepolia/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"tx": "0x64f5b3cd696f93beb8f834b9fdc5b660fac342655708b75ae353eb7b956ca04"
},
"pragma_SummaryStats": {
"address": "0x54563a0537b3ae0ba91032d674a6d468f30a59dc4deb8f0dce4e642b94be15c",
"tx": "0x1c753020f5b99852025defa05313b4b82c5cbeb989bb9f700b7a63453f21781"
"address": "0x15df5075251c103ad1e2b22328e426ad145d2003fc7f80c66c4820649fef1e7",
"tx": "0x670e04f51ebfae0f4bd342259e9181f05abed610aa361495eaefc5e3a1bcf32"
},
"pragma_Randomness": {
"address": "0x60c69136b39319547a4df303b6b3a26fab8b2d78de90b6bd215ce82e9cb515c",
Expand Down
4 changes: 2 additions & 2 deletions pragma-deployer/pragma_deployer/upgrade_pragma.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ async def main(port: Optional[int]) -> None:

declarations = get_declarations()
cur_class_hash = declarations["pragma_Oracle"]
logger.info(f"ℹ️ Current implementation hash: {cur_class_hash}")
logger.info(f"ℹ️ Current implementation hash: {hex(cur_class_hash)}")

new_implementation_hash = await declare_v2("pragma_Oracle", port=port)
logger.info(f"ℹ️ New implementation hash: {new_implementation_hash}")
logger.info(f"ℹ️ New implementation hash: {hex(new_implementation_hash)}")

tx_hash = await invoke(
"pragma_Oracle", "upgrade", [new_implementation_hash], port=port
Expand Down
8 changes: 5 additions & 3 deletions pragma-deployer/pragma_deployer/utils/starknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ async def declare_v2(contract_name, port=None):
max_fee=MAX_FEE,
)

# # Send Declare v2 transaction
# Send Declare v2 transaction
resp = await account.client.declare(transaction=sign_declare_v2)

logger.info(f"✅ {contract_name} class hash: {hex(resp.class_hash)}")
logger.info(f"✅ {contract_name} class hash {hex(resp.class_hash)} at tx {hex(resp.transaction_hash)}")
return resp.class_hash


Expand All @@ -231,6 +231,8 @@ async def deploy_v2(contract_name, *args, port=None):
max_fee=MAX_FEE,
)

logger.info(f"Transaction hash: {hex(deploy_result.hash)}")

await deploy_result.wait_for_acceptance()

logger.info(
Expand Down Expand Up @@ -260,11 +262,11 @@ async def invoke(contract_name, function_name, inputs, address=None, port=None):
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",
hex(response.transaction_hash),
)
await account.client.wait_for_tx(response.transaction_hash)
return response.transaction_hash


Expand Down

0 comments on commit 36334d5

Please sign in to comment.