forked from 0xPolygon/kurtosis-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_l2_contracts.star
26 lines (22 loc) · 963 Bytes
/
deploy_l2_contracts.star
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
service_package = import_module("./lib/service.star")
def run(plan, args):
l2_rpc_url = service_package.get_l2_rpc_url(plan, args)
# When funding accounts and deploying the contracts on l2, the
# zkevm-contracts service is reused to reduce startup time. Since the l2
# doesn't exist at the time the service is added to kurtosis, the
# `l2_rpc_url` can't be templated. Therefore, the `l2_rpc_url` is exported
# as an environment variable before running the `run-l2-contract-setup.sh`.
plan.exec(
description="Deploying contracts on L2",
service_name="contracts" + args["deployment_suffix"],
recipe=ExecRecipe(
command=[
"/bin/sh",
"-c",
"export l2_rpc_url={0} && chmod +x {1} && {1}".format(
l2_rpc_url.http,
"/opt/contract-deploy/run-l2-contract-setup.sh",
),
]
),
)