-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayerzero.config.ts
134 lines (129 loc) · 5.75 KB
/
layerzero.config.ts
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import { EndpointId } from "@layerzerolabs/lz-definitions";
import type {
OAppOmniGraphHardhat,
OmniPointHardhat,
} from "@layerzerolabs/toolbox-hardhat";
import { oftStore } from "./deployments/solana-testnet/OFT.json";
// Note: Do not use address for EVM OmniPointHardhat contracts. Contracts are loaded using hardhat-deploy.
// If you do use an address, ensure artifacts exists.
const sepoliaContract: OmniPointHardhat = {
eid: EndpointId.ARBSEP_V2_TESTNET,
contractName: "MOROFT_SIMPLE",
};
const solanaContract: OmniPointHardhat = {
eid: EndpointId.SOLANA_V2_TESTNET,
address: oftStore, // NOTE: update this with the OFTStore address.
};
const config: OAppOmniGraphHardhat = {
contracts: [
{
contract: sepoliaContract,
},
{
contract: solanaContract,
},
],
connections: [
{
from: sepoliaContract,
to: solanaContract,
// NOTE: Here are some default settings that have been found to work well sending to Solana.
// You need to either enable these enforcedOptions or pass in extraOptions when calling send().
// Having neither will cause a revert when calling send().
// We suggest performing additional profiling to ensure they are correct for your use case.
// config: {
// enforcedOptions: [
// {
// msgType: 1,
// optionType: ExecutorOptionType.LZ_RECEIVE,
// gas: 200000,
// value: 2500000,
// },
// {
// msgType: 2,
// optionType: ExecutorOptionType.LZ_RECEIVE,
// gas: 200000,
// value: 2500000,
// },
// {
// // Solana options use (gas == compute units, value == lamports)
// msgType: 2,
// optionType: ExecutorOptionType.COMPOSE,
// index: 0,
// gas: 0,
// value: 0,
// },
// ],
// },
},
{
from: solanaContract,
to: sepoliaContract,
// TODO Here are some default settings that have been found to work well sending to Sepolia.
// You need to either enable these enforcedOptions or pass in extraOptions when calling send().
// Having neither will cause a revert when calling send().
// We suggest performing additional profiling to ensure they are correct for your use case.
// config: {
// sendLibrary: '7a4WjyR8VZ7yZz5XJAKm39BUGn5iT9CKcv2pmG9tdXVH',
// receiveLibraryConfig: {
// receiveLibrary: '7a4WjyR8VZ7yZz5XJAKm39BUGn5iT9CKcv2pmG9tdXVH',
// gracePeriod: BigInt(0),
// },
// // Optional Send Configuration
// // @dev Controls how the `from` chain sends messages to the `to` chain.
// sendConfig: {
// executorConfig: {
// maxMessageSize: 10000,
// // The configured Executor address. Note, this is the executor PDA not the program ID.
// executor: 'AwrbHeCyniXaQhiJZkLhgWdUCteeWSGaSN1sTfLiY7xK',
// },
// ulnConfig: {
// // // The number of block confirmations to wait before emitting the message from the source chain.
// confirmations: BigInt(10),
// // The address of the DVNs you will pay to verify a sent message on the source chain ).
// // The destination tx will wait until ALL `requiredDVNs` verify the message.
// requiredDVNs: [
// '4VDjp6XQaxoZf5RGwiPU9NR1EXSZn2TP4ATMmiSzLfhb', // LayerZero
// ],
// // The address of the DVNs you will pay to verify a sent message on the source chain ).
// // The destination tx will wait until the configured threshold of `optionalDVNs` verify a message.
// optionalDVNs: [],
// // The number of `optionalDVNs` that need to successfully verify the message for it to be considered Verified.
// optionalDVNThreshold: 0,
// },
// },
// // Optional Receive Configuration
// // @dev Controls how the `from` chain receives messages from the `to` chain.
// receiveConfig: {
// ulnConfig: {
// // The number of block confirmations to expect from the `to` chain.
// confirmations: BigInt(2),
// // The address of the DVNs your `receiveConfig` expects to receive verifications from on the `from` chain ).
// // The `from` chain's OApp will wait until the configured threshold of `requiredDVNs` verify the message.
// requiredDVNs: [
// '4VDjp6XQaxoZf5RGwiPU9NR1EXSZn2TP4ATMmiSzLfhb', // LayerZero
// ],
// // The address of the DVNs you will pay to verify a sent message on the source chain ).
// // The destination tx will wait until the configured threshold of `optionalDVNs` verify a message.
// optionalDVNs: [],
// // The number of `optionalDVNs` that need to successfully verify the message for it to be considered Verified.
// optionalDVNThreshold: 0,
// },
// },
// enforcedOptions: [
// {
// msgType: 1,
// optionType: ExecutorOptionType.LZ_RECEIVE,
// gas: 200000,
// },
// {
// msgType: 2,
// optionType: ExecutorOptionType.LZ_RECEIVE,
// gas: 200000,
// },
// ],
// },
},
],
};
export default config;