-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeploy_mainnet.py
executable file
·50 lines (41 loc) · 1.22 KB
/
deploy_mainnet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# %% Imports
import logging
from asyncio import run
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from utils.constants import COMPILED_CONTRACTS_ARGENT
from utils.starknet import (
declare_v2,
deploy_v2,
dump_declarations,
dump_deployments,
get_declarations,
get_starknet_account,
)
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# %% Main
async def main():
# %% Declarations
account = await get_starknet_account()
logger.info(f"ℹ️ Using account {hex(account.address)} as deployer")
class_hash = {
contract["contract_name"]: await declare_v2(contract["contract_name"])
for contract in COMPILED_CONTRACTS_ARGENT
}
dump_declarations(class_hash)
# %% Deployments
class_hash = get_declarations()
print('class_hash', class_hash)
deployments = {}
deployments["resolver_delegation_ArgentResolverDelegation"] = await deploy_v2(
"resolver_delegation_ArgentResolverDelegation",
account.address, # admin
)
dump_deployments(deployments)
logger.info("✅ Configuration Complete")
# %% Run
if __name__ == "__main__":
run(main())