Skip to content

Commit 7bbee42

Browse files
authored
feat: bump scripts (#142)
* feat: bump starknet.py * feat: upgrade contract
1 parent b5d56be commit 7bbee42

File tree

14 files changed

+848
-253
lines changed

14 files changed

+848
-253
lines changed

deployments/mainnet/declarations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"pragma_Oracle": "0x1cc1ca67aba8b62b6b310fa2c8a18773b1787465712eaa87c6db0b4c297278e",
2+
"pragma_Oracle": "0x51301fec671d8f523d0afd030164c74660db428de8136873b1de9583c3f5412",
33
"pragma_Ownable": "0x7b50a7a9bbb75d08248135003f1c87f0d44ba23018dc0ca480ac37a901531f3",
44
"pragma_PublisherRegistry": "0x306288971002bd7906e3a607d504dfb28dcbdc7655a115984e567dce3b67e8f",
55
"pragma_SummaryStats": "0x3b5bf1c2f918de14620b3c63e2c6543cf0a138df258bce3d03e3fb0b7d2183a",

pragma-deployer/poetry.lock

Lines changed: 661 additions & 175 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pragma-deployer/pragma_deployer/add_pairs.py

Lines changed: 135 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
0x28d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a,
3333
0x0000000000000000000000000000000000000000,
3434
)
35+
RETH = Currency(
36+
"RETH",
37+
18,
38+
0,
39+
0x0319111a5037cbec2b3e638cc34a3474e2d2608299f3e62866e9cc683208c610,
40+
0xae78736cd615f374d3085123a210448e74fc6393,
41+
)
3542
USD = Currency("USD", 8, 1, 0, 0)
3643
XSTRK = Currency(
3744
"XSTRK",
@@ -40,25 +47,113 @@
4047
0x028d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a,
4148
0x0000000000000000000000000000000000000000,
4249
)
43-
CONVERSION_XSTRK = Currency(
44-
"CONVERSION_XSTRK",
50+
DOG = Currency(
51+
"DOG",
52+
5,
53+
0,
54+
0x0,
55+
0x0000000000000000000000000000000000000000,
56+
)
57+
CONVERSION_SSTRK = Currency(
58+
"CONVERSION_SSTRK",
4559
18,
4660
0,
4761
0x0000000000000000000000000000000000000000,
4862
0x0000000000000000000000000000000000000000,
4963
)
50-
pair = Pair(CONVERSION_XSTRK, USD)
51-
64+
XWBTC = Currency(
65+
"CONVERSION_XWBTC",
66+
8,
67+
0,
68+
0x6a567e68c805323525fe1649adb80b03cddf92c23d2629a6779f54192dffc13,
69+
0x0000000000000000000000000000000000000000,
70+
)
71+
XTBTC = Currency(
72+
"CONVERSION_XTBTC",
73+
18,
74+
0,
75+
0x43a35c1425a0125ef8c171f1a75c6f31ef8648edcc8324b55ce1917db3f9b91,
76+
0x0000000000000000000000000000000000000000,
77+
)
78+
XLBTC = Currency(
79+
"CONVERSION_XLBTC",
80+
8,
81+
0,
82+
0x7dd3c80de9fcc5545f0cb83678826819c79619ed7992cc06ff81fc67cd2efe0,
83+
0x0000000000000000000000000000000000000000,
84+
)
85+
XSBTC = Currency(
86+
"CONVERSION_XSBTC",
87+
18,
88+
0,
89+
0x580f3dc564a7b82f21d40d404b3842d490ae7205e6ac07b1b7af2b4a5183dc9,
90+
0x0000000000000000000000000000000000000000,
91+
)
5292

53-
CURRENCIES_TO_ADD = [CONVERSION_XSTRK]
93+
# New currencies
94+
MRE7BTC = Currency(
95+
"MRE7BTC",
96+
18,
97+
0,
98+
0x0, # Replace with actual starknet_address if available
99+
0x0000000000000000000000000000000000000000,
100+
)
101+
MRE7YIELD = Currency(
102+
"MRE7YIELD",
103+
18,
104+
0,
105+
0x0, # Replace with actual starknet_address if available
106+
0x0000000000000000000000000000000000000000,
107+
)
108+
LBTC = Currency(
109+
"LBTC",
110+
8,
111+
0,
112+
0x0, # Replace with actual starknet_address if available
113+
0x0000000000000000000000000000000000000000,
114+
)
115+
UNIBTC = Currency(
116+
"UNIBTC",
117+
8,
118+
0,
119+
0x0, # Replace with actual starknet_address if available
120+
0x0000000000000000000000000000000000000000,
121+
)
54122

55-
PAIRS_TO_ADD = [pair]
123+
# BTC LST pairs
124+
xwbtc_usd_pair = Pair(XWBTC, USD)
125+
xtbtc_usd_pair = Pair(XTBTC, USD)
126+
xlbtc_usd_pair = Pair(XLBTC, USD)
127+
xsbtc_usd_pair = Pair(XSBTC, USD)
128+
129+
# New pairs
130+
mre7btc_usd_pair = Pair(MRE7BTC, USD)
131+
mre7yield_usd_pair = Pair(MRE7YIELD, USD)
132+
lbtc_usd_pair = Pair(LBTC, USD)
133+
unibtc_usd_pair = Pair(UNIBTC, USD)
134+
135+
CURRENCIES_TO_ADD = [XWBTC, XTBTC, XLBTC, XSBTC]
136+
137+
PAIRS_TO_ADD = [
138+
xwbtc_usd_pair,
139+
xtbtc_usd_pair,
140+
xlbtc_usd_pair,
141+
xsbtc_usd_pair,
142+
]
56143

57144
PAIRS_TO_UPDATE = [
58-
# {
59-
# "pair_id": "1629317993172502401860",
60-
# "pair": ["1629317993172502401860", USD.id, XSTRK.id]
61-
# }
145+
{
146+
"pair_id": 384270964630611589151504336040458606883082949444,
147+
"pair": [384270964630611589151504336040458606883082949444, XWBTC.id, USD.id],
148+
},
149+
{
150+
"pair_id": 384270964630611589151504336040242434100969165636,
151+
"pair": [384270964630611589151504336040242434100969165636, XTBTC.id, USD.id],
152+
},
153+
{
154+
"pair_id": 384270964630611589151504336039665973348665742148,
155+
"pair": [384270964630611589151504336039665973348665742148, XLBTC.id, USD.id],
156+
},
62157
# Pair(XSTRK, USD),
63158
# Pair("SSTRK/USD", "SSTRK", "USD"),
64159
# Pair("WSTETH/USD", "WSTETH", "USD"),
@@ -70,16 +165,17 @@ async def main(port: Optional[int]) -> None:
70165
Main function to add currencies and pairs, and update pairs.
71166
"""
72167
# Add Currencies
73-
for currency in CURRENCIES_TO_ADD:
74-
tx_hash = await invoke(
75-
"pragma_Oracle",
76-
"add_currency",
77-
currency.serialize(),
78-
port=port,
79-
)
80-
logger.info(f"Added currency {currency} with tx hash {hex(tx_hash)}")
81-
82-
# Update Pairs
168+
# for currency in CURRENCIES_TO_ADD:
169+
# tx_hash = await invoke(
170+
# "pragma_Oracle",
171+
# "add_currency",
172+
# currency.serialize(),
173+
# port=port,
174+
# )
175+
# await asyncio.sleep(1)
176+
# logger.info(f"Added currency {currency} with tx hash {hex(tx_hash)}")
177+
178+
# # Update Pairs
83179
for pair in PAIRS_TO_UPDATE:
84180
tx_hash = await invoke(
85181
"pragma_Oracle",
@@ -89,15 +185,25 @@ async def main(port: Optional[int]) -> None:
89185
)
90186
logger.info(f"Updated pair {pair} with tx hash {hex(tx_hash)}")
91187

92-
# Add Pairs
93-
for pair in PAIRS_TO_ADD:
94-
tx_hash = await invoke(
95-
"pragma_Oracle",
96-
"add_pair",
97-
pair.serialize(),
98-
port=port,
99-
)
100-
logger.info(f"Added pair {pair} with tx hash {hex(tx_hash)}")
188+
# # Add Pairs
189+
# for pair in PAIRS_TO_ADD[2:]:
190+
# tx_hash = await invoke(
191+
# "pragma_Oracle",
192+
# "add_pair",
193+
# (pair.id, pair.quote_currency.id, pair.base_currency.id),
194+
# port=port,
195+
# )
196+
# await asyncio.sleep(1)
197+
# logger.info(f"Added pair {pair} with tx hash {hex(tx_hash)}")
198+
199+
# for pair in PAIRS_TO_ADD:
200+
# tx_hash = await invoke(
201+
# "pragma_Oracle",
202+
# "add_registered_conversion_rate_pair",
203+
# [pair.id],
204+
# port=port,
205+
# )
206+
# logger.info(f"Added conversion rate pair {pair} with tx hash {hex(tx_hash)}")
101207

102208

103209
@click.command()

pragma-deployer/pragma_deployer/deploy_mock_pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
NETWORK,
1414
)
1515
from pragma_deployer.utils.starknet import (
16-
declare_v2,
16+
declare_v3,
1717
dump_declarations,
1818
dump_deployments,
1919
get_deployments,
@@ -38,7 +38,7 @@ async def main(port: Optional[int]) -> None:
3838

3939
# Declaration
4040
class_hash = {
41-
contract["contract_name"]: await declare_v2(contract["contract_name"], port)
41+
contract["contract_name"]: await declare_v3(contract["contract_name"], port)
4242
for contract in COMPILED_CONTRACTS
4343
}
4444
dump_declarations(class_hash)

pragma-deployer/pragma_deployer/deploy_pragma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
dump_declarations,
1818
dump_deployments,
1919
get_starknet_account,
20-
declare_v2,
20+
declare_v3,
2121
deploy_v2,
2222
)
2323

@@ -36,7 +36,7 @@ async def main(port: Optional[int]) -> None:
3636
logger.info(f"ℹ️ Using account {hex(account.address)} as deployer")
3737

3838
class_hash = {
39-
contract["contract_name"]: await declare_v2(contract["contract_name"], port)
39+
contract["contract_name"]: await declare_v3(contract["contract_name"], port)
4040
for contract in COMPILED_CONTRACTS
4141
}
4242
dump_declarations(class_hash)

pragma-deployer/pragma_deployer/deploy_randomness.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
get_deployments,
1919
get_starknet_account,
2020
deploy_v2,
21-
declare_v2,
21+
declare_v3,
2222
dump_declarations,
2323
)
2424

@@ -39,7 +39,7 @@ async def main(port: Optional[int]) -> None:
3939

4040
if port is not None:
4141
class_hash = {
42-
contract["contract_name"]: await declare_v2(
42+
contract["contract_name"]: await declare_v3(
4343
contract["contract_name"], port=port
4444
)
4545
for contract in COMPILED_CONTRACTS

pragma-deployer/pragma_deployer/deploy_randomness_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
get_deployments,
1818
get_starknet_account,
1919
deploy_v2,
20-
declare_v2,
20+
declare_v3,
2121
dump_declarations,
2222
)
2323

@@ -37,7 +37,7 @@ async def main(port: Optional[int]) -> None:
3737

3838
if port is not None:
3939
class_hash = {
40-
contract["contract_name"]: await declare_v2(
40+
contract["contract_name"]: await declare_v3(
4141
contract["contract_name"], port=port
4242
)
4343
for contract in COMPILED_CONTRACTS

pragma-deployer/pragma_deployer/deploy_summary_stats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
NETWORK,
1414
)
1515
from pragma_deployer.utils.starknet import (
16-
declare_v2,
16+
declare_v3,
1717
dump_declarations,
1818
dump_deployments,
1919
get_deployments,
@@ -38,7 +38,7 @@ async def main(port: Optional[int]) -> None:
3838

3939
# Declaration
4040
class_hash = {
41-
contract["contract_name"]: await declare_v2(contract["contract_name"], port)
41+
contract["contract_name"]: await declare_v3(contract["contract_name"], port)
4242
for contract in COMPILED_CONTRACTS
4343
}
4444
dump_declarations(class_hash)

pragma-deployer/pragma_deployer/register_publishers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
"UPBIT",
4949
"LBANK",
5050
"BITGET",
51+
"RE7_ONCHAIN",
52+
"CHAINLINK",
53+
"REDSTONE"
5154
]
5255

5356
DEX_SOURCES = ["MYSWAP", "MYSWAPV2", "EKUBO", "SITHSWAP", "JEDISWAP", "10KSWAP"]

pragma-deployer/pragma_deployer/register_tokenized_vault.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,30 @@
2323

2424
# Tokens to register
2525
TOKENS_TO_REGISTER = [
26+
# {
27+
# "name": "XSTRK",
28+
# "address": 0x28d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a,
29+
# },
30+
# BTC LST tokens
31+
{
32+
"name": "CONVERSION_XWBTC",
33+
"underlying_token": "BTC",
34+
"address": 0x6a567e68c805323525fe1649adb80b03cddf92c23d2629a6779f54192dffc13,
35+
},
36+
{
37+
"name": "CONVERSION_XTBTC",
38+
"underlying_token": "BTC",
39+
"address": 0x43a35c1425a0125ef8c171f1a75c6f31ef8648edcc8324b55ce1917db3f9b91,
40+
},
41+
{
42+
"name": "CONVERSION_XLBTC",
43+
"underlying_token": "BTC",
44+
"address": 0x7dd3c80de9fcc5545f0cb83678826819c79619ed7992cc06ff81fc67cd2efe0,
45+
},
2646
{
27-
"name": "XSTRK",
28-
"address": 0x28d709c875c0ceac3dce7065bec5328186dc89fe254527084d1689910954b0a,
47+
"name": "CONVERSION_XSBTC",
48+
"underlying_token": "BTC",
49+
"address": 0x580f3dc564a7b82f21d40d404b3842d490ae7205e6ac07b1b7af2b4a5183dc9,
2950
},
3051
# {
3152
# "name": "SSTRK",
@@ -47,7 +68,7 @@ async def main(port: Optional[int]) -> None:
4768
tx_hash = await invoke(
4869
"pragma_Oracle",
4970
"register_tokenized_vault",
50-
[token["name"], token["address"]],
71+
[token["name"], token["underlying_token"], token["address"]],
5172
port=port,
5273
)
5374
logger.info(f"Registered tokenized vault {token['name']} with tx {hex(tx_hash)}")

0 commit comments

Comments
 (0)