-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy pathmove.layerzero.config.ts
More file actions
162 lines (155 loc) · 7.42 KB
/
Copy pathmove.layerzero.config.ts
File metadata and controls
162 lines (155 loc) · 7.42 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
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
import { EndpointId } from '@layerzerolabs/lz-definitions'
import { ExecutorOptionType } from '@layerzerolabs/lz-v2-utilities'
import type { OAppOmniGraphHardhat, OmniPointHardhat } from '@layerzerolabs/toolbox-hardhat'
// TODO: This example uses a single LayerZero Labs DVN in `requiredDVNs` for clarity.
// Production OApps must use at least 2 DVNs. Before mainnet, add a non-LayerZero-Labs
// DVN to each `requiredDVNs` array below. See:
// - DVN providers: https://docs.layerzero.network/v2/deployments/dvn-addresses
// - Migration guide: https://docs.layerzero.network/v2/get-started/migrating-from-single-dvn
enum MsgType {
SEND = 1,
SEND_AND_CALL = 2,
}
const bscContract: OmniPointHardhat = {
eid: EndpointId.ARBSEP_V2_TESTNET,
contractName: 'MyOFT',
}
const initiaContract: OmniPointHardhat = {
eid: EndpointId.INITIA_V2_TESTNET,
contractName: 'MyOFT',
}
const config: OAppOmniGraphHardhat = {
contracts: [
{
contract: bscContract,
config: {
owner: '',
delegate: '',
},
},
{
contract: initiaContract,
config: {
delegate: '',
owner: '',
},
},
],
connections: [
{
from: initiaContract,
to: bscContract,
config: {
enforcedOptions: [
{
msgType: MsgType.SEND,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 80_000, // gas limit in wei for EndpointV2.lzReceive
value: 0, // msg.value in wei for EndpointV2.lzReceive
},
{
msgType: MsgType.SEND_AND_CALL,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 80_000, // gas limit in wei for EndpointV2.lzReceive
value: 0, // msg.value in wei for EndpointV2.lzReceive
},
],
sendLibrary: '0x3e1b182c40965a986133798e1da76302ef327de2c32c58110361587560285e88',
receiveLibraryConfig: {
// Required Receive Library Address on Initia
receiveLibrary: '0x3e1b182c40965a986133798e1da76302ef327de2c32c58110361587560285e88',
// Optional Grace Period for Switching Receive Library Address on Initia
gracePeriod: BigInt(0),
},
// Optional Receive Library Timeout for when the Old Receive Library Address will no longer be valid on Initia
// receiveLibraryTimeoutConfig: {
// lib: '0x3e1b182c40965a986133798e1da76302ef327de2c32c58110361587560285e88',
// expiry: BigInt(1000000000),
// },
sendConfig: {
executorConfig: {
maxMessageSize: 10_000,
// The configured Executor address on Initia
executor: '0x798c194c8740dde76a0e3f46f444f7ee974765abb2a9db98be03a0ee89ce050c',
},
ulnConfig: {
// The number of block confirmations to wait on Initia 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: ['0x3f12330ba9e26a604e2149b4b67c0710d32fcbc3de0bea76dd43dbb6b747bc8c'],
// 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(5),
// 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: ['0x3f12330ba9e26a604e2149b4b67c0710d32fcbc3de0bea76dd43dbb6b747bc8c'],
// The address of the `optionalDVNs` you expect to receive verifications from on the `from` chain.
// The destination tx will wait until the configured threshold of `optionalDVNs` verify the message.
optionalDVNs: [],
// The number of `optionalDVNs` that need to successfully verify the message for it to be considered Verified.
optionalDVNThreshold: 0,
},
},
},
},
{
from: bscContract,
to: initiaContract,
config: {
enforcedOptions: [
{
msgType: MsgType.SEND,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 5_000, // gas limit in wei for EndpointV2.lzReceive
value: 0, // msg.value in wei for EndpointV2.lzReceive
},
{
msgType: MsgType.SEND_AND_CALL,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 5_000, // gas limit in wei for EndpointV2.lzCompose
value: 0, // msg.value in wei for EndpointV2.lzCompose
},
],
sendLibrary: '0x55f16c442907e86D764AFdc2a07C2de3BdAc8BB7',
receiveLibraryConfig: {
receiveLibrary: '0x188d4bbCeD671A7aA2b5055937F79510A32e9683',
gracePeriod: BigInt(0),
},
// receiveLibraryTimeoutConfig: {
// lib: '0x188d4bbCeD671A7aA2b5055937F79510A32e9683',
// expiry: BigInt(67323472),
// },
sendConfig: {
executorConfig: {
maxMessageSize: 10_000,
executor: '0x31894b190a8bAbd9A067Ce59fde0BfCFD2B18470',
},
ulnConfig: {
confirmations: BigInt(5),
requiredDVNs: ['0x0eE552262f7B562eFcED6DD4A7e2878AB897d405'],
optionalDVNThreshold: 0,
},
},
receiveConfig: {
ulnConfig: {
confirmations: BigInt(10),
requiredDVNs: ['0x0eE552262f7B562eFcED6DD4A7e2878AB897d405'],
optionalDVNThreshold: 0,
},
},
},
},
],
}
export default config