Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
30b2da8
Add functionality to check and deploy LayerZero endpoint and ULN302 l…
devin-ai-integration[bot] May 18, 2025
f40058c
Merge branch 'dev' into devin/1747591106-deploy-layerzero-contracts
devin-ai-integration[bot] May 18, 2025
7bff062
Add support for deploying LayerZero endpoint and ULN302 libraries for…
devin-ai-integration[bot] May 18, 2025
0efeb7b
Fix Starlark syntax error in input_parser.star
devin-ai-integration[bot] May 18, 2025
d61255f
Fix Starlark syntax errors in contract deployer files
devin-ai-integration[bot] May 18, 2025
77e0357
Fix Starlark struct attribute errors in contract deployer files
devin-ai-integration[bot] May 18, 2025
300107f
Fix struct immutability issue in main.star
devin-ai-integration[bot] May 18, 2025
169a096
Fix RPC validation in input_parser.star to handle empty responses
devin-ai-integration[bot] May 18, 2025
3948dd7
Skip chain ID verification for local networks with empty responses
devin-ai-integration[bot] May 18, 2025
64d7ab2
Improve local network detection for RPC verification
devin-ai-integration[bot] May 18, 2025
36503a9
Fix shell command syntax in endpoint contract deployer
devin-ai-integration[bot] May 18, 2025
9460330
Fix shell command syntax in send lib deployer
devin-ai-integration[bot] May 18, 2025
ccecadb
Fix shell command syntax in receive lib deployer
devin-ai-integration[bot] May 18, 2025
693c166
Rename messagelib/contract_deployer.star to receive_lib_deployer.star…
devin-ai-integration[bot] May 18, 2025
bc8efcd
Remove unused files in messagelib-contracts directory
devin-ai-integration[bot] May 18, 2025
ef3ef92
Rename Deploy.sol to DeployReceiveLib.sol for consistency
devin-ai-integration[bot] May 18, 2025
24b6368
Remove old Deploy.sol file
devin-ai-integration[bot] May 18, 2025
fbab53a
Remove DVN fee parameters from input parser and YAML files
devin-ai-integration[bot] May 18, 2025
85d78e7
Remove exec_fee parameters from input parser and YAML files
devin-ai-integration[bot] May 18, 2025
8933eb9
Remove address server, fix executor and syntax
tiljrd May 18, 2025
7429dfd
Add param schema
tiljrd May 20, 2025
2dcab30
Use correct contract deployment status checking
tiljrd May 21, 2025
9092c04
Correctly deploy endpoint
tiljrd May 21, 2025
e8c8f4a
Correctly deploy messagelib
tiljrd May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ networks:
connections:
- from: ethereum
to: arbitrum
exec_fee: "10000000000000000" # in wei
dvn_fee: "0" # in wei
# exec_fee and dvn_fee are no longer required as they're set dynamically
```

For simplicity, you can also specify a `type` for each network which will automatically use known values for
Expand Down Expand Up @@ -81,9 +80,12 @@ To retrieve logs from any service, you can run:
kurtosis service logs <enclave-name> <service-name>
```

## Features
1. Automatic deployment of LayerZero Endpoint and MessageLib contracts for networks that don't have them
2. Support for chains that LayerZero doesn't currently support

## Coming Soon
1. Running fully local deployments including all the required forked networks
2. Support for chains that LayerZero doesn't currently support (automatic cdeployment of Endpoint and MessageLib)

## License

Expand All @@ -96,4 +98,4 @@ For issues, feature requests, or contributions, please open an issue or submit a
[docker-installation]: https://docs.docker.com/get-docker/
[kurtosis-cli-installation]: https://docs.kurtosis.com/install
[kurtosis-repo]: https://github.com/kurtosis-tech/kurtosis
[package-reference]: https://docs.kurtosis.com/advanced-concepts/packages
[package-reference]: https://docs.kurtosis.com/advanced-concepts/packages
39 changes: 34 additions & 5 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,46 @@ executor_contract_deployer = import_module("./src/executor/contract_deployer.sta
executor_deployer = import_module("./src/executor/executor_launcher.star")
dvn_contract_deployer = import_module("./src/DVN/contract_deployer.star")
dvn_deployer = import_module("./src/DVN/dvn_launcher.star")
address_server = import_module("./src/address-server/server_launcher.star")
redis = import_module("github.com/kurtosis-tech/redis-package/main.star")
input_parser = import_module("./src/package_io/input_parser.star")

endpoint_deployer = import_module("./src/endpoint/contract_deployer.star")
send_lib_deployer = import_module("./src/messagelib/send_lib_deployer.star")
receive_lib_deployer = import_module("./src/messagelib/receive_lib_deployer.star")

def run(plan, args):

# Check input params
networks = input_parser.input_parser(plan, args)
connections = args["connections"]

# Check and deploy LayerZero endpoint and ULN302 libraries if needed
updated_networks = []
for network in networks:
# Check and deploy endpoint if needed
endpoint_address = endpoint_deployer.deploy_contract(plan, network)

# Check and deploy send library if needed
send_lib_address = send_lib_deployer.deploy_contract(plan, network, endpoint_address)

# Check and deploy receive library if needed
receive_lib_address = receive_lib_deployer.deploy_contract(plan, network, endpoint_address)

# Create updated network with new addresses
updated_network = struct(
name = network.name,
chain_id = network.chain_id,
rpc = network.rpc,
private_key = network.private_key,
eid = network.eid,
endpoint = endpoint_address,
trusted_send_lib = send_lib_address,
trusted_receive_lib = receive_lib_address
)
updated_networks.append(updated_network)

# Replace the networks list with the updated networks
networks = updated_networks

# Deploy DVN contract
dvn_addresses = dvn_contract_deployer.deploy_contract(plan, networks, connections)
Expand Down Expand Up @@ -87,10 +118,8 @@ def run(plan, args):
redis_url = executor_redis_url,
)

# Add server to serve contract addresses for front-end
address_server.add_server(plan, dvn_addresses, executor_addresses)

return struct(
dvn_addresses = dvn_addresses,
executor_addresses = executor_addresses,
)
networks = networks,
)
2 changes: 0 additions & 2 deletions network_custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ networks:
connections:
- from: ethereum
to: arbitrum
exec_fee: "10000000000000000"
dvn_fee: "0"
2 changes: 0 additions & 2 deletions network_remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ networks:
connections:
- from: ethereum
to: arbitrum
exec_fee: "100000000000000"
dvn_fee: "0"
15 changes: 15 additions & 0 deletions network_test_empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
networks:
- name: "local1"
chain_id: "31337"
rpc: "http://127.0.0.1:8545"
private_key: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
- name: "local2"
chain_id: "31338"
rpc: "http://127.0.0.1:8546"
private_key: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"

connections:
- from: "local1"
to: "local2"
- from: "local2"
to: "local1"
66 changes: 66 additions & 0 deletions schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: v1
type: object
fields:
- key: networks
type: array
item:
type: object
fields:
- key: name
type: string
required: true
doc: An arbitrary network name
- key: type
type: enum
required: true
doc: The network type to automatically use known contract addresses
values:
- ethereum_mainnet
- arbitrum_mainnet
- base_mainnet
- optimism_mainnet
- polygon_mainnet
- bnb_mainnet
- avalanche_mainnet
- ethereum_sepolia
- ethereum_holesky
- arbitrum_sepolia
- base_sepolia
- optimism_sepolia
- key: chain_id
type: string
required: true
doc: The chain ID of the network
- key: rpc
type: string
required: true
doc: The RPC endpoint for the network. Cannot be localhost.
- key: private_key
type: string
required: true
doc: A prefunded private key to deploy contracts and execute cross-chain transactions
- key: endpoint
type: string
doc: The address of the deployed endpoint contract
- key: trusted_send_lib
type: string
doc: The address of the deployed ULN302 send library
- key: trusted_receive_lib
type: string
doc: The address of the deployed ULN302 receive library
- key: eid
type: string
doc: The endpoint id of this chain as specified on LayerZero docs or in the deployed endpoint contract
- key: connections
type: array
item:
type: object
fields:
- key: from
type: string
required: true
doc: The name of the source chain. Must be specified in the networks array.
- key: to
type: string
required: true
doc: The name of the destination chain. Must be specified in the networks array.
6 changes: 1 addition & 5 deletions src/DVN/contract_deployer.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def deploy_contract(plan, networks, connections):
active = net.name

dst_eids = []
fees = []
for conn in connections:
if conn["from"] == active:
# Find the target network matching the connection's "to" field
Expand All @@ -17,12 +16,10 @@ def deploy_contract(plan, networks, connections):
break
if target_net != None:
dst_eids.append(target_net.eid)
fees.append(conn["dvn_fee"])
else:
fail("No network found for connection 'to' value: " + conn["to"])

dst_eids_str = ",".join(dst_eids)
fees_str = ",".join(fees)

env_vars = {
"NETWORK": active,
Expand All @@ -33,7 +30,6 @@ def deploy_contract(plan, networks, connections):
"EID": net.eid,
"PRIVATE_KEY": net.private_key,
"DST_EIDS": dst_eids_str,
"FEES": fees_str,
}
# The forge command uses the active network's RPC URL via --fork-url.
cmd = ("forge script script/Deploy.sol:DeployDVNContract --broadcast --json --skip-simulation --via-ir --fork-url " + net.rpc + " | grep 'contract_address' | jq -r '.contract_address' | tr -d '\n'")
Expand All @@ -49,4 +45,4 @@ def deploy_contract(plan, networks, connections):
plan.print(address)
deployed_addresses.append(address)

return deployed_addresses
return deployed_addresses
21 changes: 0 additions & 21 deletions src/address-server/Dockerfile

This file was deleted.

Loading