-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy pathlayerzero.config.ts
More file actions
126 lines (121 loc) · 6.08 KB
/
Copy pathlayerzero.config.ts
File metadata and controls
126 lines (121 loc) · 6.08 KB
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
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.
const sepoliaContract: OmniPointHardhat = {
eid: EndpointId.SEPOLIA_TESTNET, /// EndpointV1
contractName: 'MyEndpointV1OFTV2Mock', // Update this if trying out the other contracts
}
const solanaContract: OmniPointHardhat = {
eid: EndpointId.SOLANA_V2_TESTNET,
address: '', // NOTE: update this with the OFTStore address.
}
// The values here are for development purposes. E.g. confirmations are set to 1. For production, they should be reviewed and edited accordingly.
const config: OAppOmniGraphHardhat = {
contracts: [
{
contract: sepoliaContract,
},
{
contract: solanaContract,
},
],
connections: [
{
from: sepoliaContract,
to: solanaContract,
config: {
sendLibrary: '0x6862b19f6e42a810946B9C782E6ebE26Ad266C84', // SendULN301 on Ethereum Sepolia
receiveLibraryConfig: {
receiveLibrary: '0x5937A5fe272fbA38699A1b75B3439389EEFDb399', // ReceiveULN301 on Ethereum Sepolia
gracePeriod: BigInt(0),
},
sendConfig: {
executorConfig: {
maxMessageSize: 200,
executor: '0x718B92b5CB0a5552039B593faF724D182A881eDA',
},
ulnConfig: {
confirmations: BigInt(15),
requiredDVNs: ['0x8eebf8b423b73bfca51a1db4b7354aa0bfca9193'], // LayerZero Labs DVN
// optionalDVNs omitted → inherit the default. To pin "no optional DVNs"
// explicitly, set `optionalDVNs: []` (it now serializes to the NIL sentinel).
},
},
receiveConfig: {
ulnConfig: {
confirmations: BigInt(32),
requiredDVNs: ['0x8eebf8b423b73bfca51a1db4b7354aa0bfca9193'],
// optionalDVNs omitted → inherit the default. To pin "no optional DVNs"
// explicitly, set `optionalDVNs: []` (it now serializes to the NIL sentinel).
},
},
},
},
{
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(32),
// 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
],
// optionalDVNs omitted → inherit the default. To pin "no optional DVNs"
// explicitly, set `optionalDVNs: []` (it now serializes to the NIL sentinel),
// with `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(15),
// 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
],
// optionalDVNs omitted → inherit the default. To pin "no optional DVNs"
// explicitly, set `optionalDVNs: []` (it now serializes to the NIL sentinel),
// with `optionalDVNThreshold: 0`.
},
},
enforcedOptions: [
{
msgType: 1,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 200000,
},
{
msgType: 2,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 200000,
},
],
},
},
],
}
export default config