-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayerzero.config.ts
239 lines (233 loc) · 11.6 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
import { EndpointId } from '@layerzerolabs/lz-definitions'
import { ExecutorOptionType } from '@layerzerolabs/lz-v2-utilities'
import type { OAppOmniGraphHardhat, OmniPointHardhat } from '@layerzerolabs/toolbox-hardhat'
// 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.SEPOLIA_V2_TESTNET,
contractName: 'MyOFTMock',
}
const orderlyContract: OmniPointHardhat = {
eid: EndpointId.ORDERLY_V2_TESTNET,
contractName: 'MyOFTMock',
}
const solanaContract: OmniPointHardhat = {
eid: EndpointId.SOLANA_V2_TESTNET,
address: 'AHSXYVVQ9xmzZ45UxURcxjLCPqCVGn2qLnk6E7dwF4Dg', // NOTE: update this with the OFTStore address.
}
const config: OAppOmniGraphHardhat = {
contracts: [
{
contract: sepoliaContract,
},
{
contract: orderlyContract,
},
{
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: 200000,
value: 2500000,
},
],
},
},
{
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,
},
],
},
},
{
from: orderlyContract,
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: 200000,
value: 2500000,
},
],
},
},
{
from: solanaContract,
to: orderlyContract,
// 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