-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayerzero.simple.config.ts
180 lines (162 loc) · 5.32 KB
/
layerzero.simple.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
import { EndpointId } from '@layerzerolabs/lz-definitions'
import { ExecutorOptionType } from '@layerzerolabs/lz-v2-utilities'
import { generateConnectionsConfig } from '@layerzerolabs/metadata-tools'
import { OAppEnforcedOption, OmniPointHardhat } from '@layerzerolabs/toolbox-hardhat'
export const baseContract: OmniPointHardhat = {
eid: EndpointId.BASE_V2_MAINNET,
contractName: 'OrbitERC20OFTAdapter',
}
export const ethereumContract: OmniPointHardhat = {
eid: EndpointId.ETHEREUM_V2_MAINNET,
contractName: 'DEGENOFT',
}
export const arbitrumContract: OmniPointHardhat = {
eid: EndpointId.ARBITRUM_V2_MAINNET,
contractName: 'DEGENOFT',
}
export const degenContract: OmniPointHardhat = {
eid: EndpointId.DEGEN_V2_MAINNET,
contractName: 'OrbitNativeOFTAdapter',
}
export const solanaContract: OmniPointHardhat = {
eid: EndpointId.SOLANA_V2_MAINNET,
address: 'EYdX37fyQr1RAEiCU8PkxbitmLKv2hfLcz1e56pPv8Wg', // your OFT Store address
}
const EVM_ENFORCED_OPTIONS: OAppEnforcedOption[] = [
{
msgType: 1,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 80000,
value: 0,
},
{
msgType: 2,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 80000,
value: 0,
},
{
msgType: 2,
optionType: ExecutorOptionType.COMPOSE,
index: 0,
gas: 80000,
value: 0,
},
]
const SOLANA_ENFORCED_OPTIONS: OAppEnforcedOption[] = [
{
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,
},
]
export default async function () {
// [srcContract, dstContract, [requiredDVNs, [optionalDVNs, threshold]], [srcToDstConfirmations, dstToSrcConfirmations]], [enforcedOptionsSrcToDst, enforcedOptionsDstToSrc]
const connections = await generateConnectionsConfig([
// base <-> ethereum
[
baseContract,
ethereumContract,
[['Stargate', 'LayerZero Labs'], []],
[10, 15], // confirmations for send and receive
[EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// base <-> arbitrum
[
baseContract,
arbitrumContract,
[['Stargate', 'LayerZero Labs'], []],
[10, 20], // confirmations for send and receive
[EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// base <-> degen
[
baseContract,
degenContract,
[['Stargate', 'LayerZero Labs', 'Nethermind'], []],
[10, 21], // confirmations for send and receive
[EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// ethereum <-> arbitrum
[
ethereumContract,
arbitrumContract,
[['Stargate', 'LayerZero Labs'], []],
[15, 20], // confirmations for send and receive
[EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// ethereum <-> degen
[
ethereumContract,
degenContract,
[['Stargate', 'LayerZero Labs', 'Nethermind'], []],
[15, 21], // confirmations for send and receive
[EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// arbitrum <-> degen
[
arbitrumContract,
degenContract,
[['Stargate', 'LayerZero Labs', 'Nethermind'], []],
[20, 21], // confirmations for send and receive
[EVM_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// base <-> solana
[
baseContract,
solanaContract,
[['Nethermind', 'LayerZero Labs'], []], // Solana DVNs and Base DVNs
[10, 32], // confirmations for send and receive
[SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// ethereum <-> solana
[
ethereumContract,
solanaContract,
[['Nethermind', 'LayerZero Labs'], []], // Solana DVNs and Ethereum DVNs
[15, 32], // confirmations for send and receive
[SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// arbitrum <-> solana
[
arbitrumContract,
solanaContract,
[['Nethermind', 'LayerZero Labs'], []], // Solana DVNs and Arbitrum DVNs
[20, 32], // confirmations for send and receive
[SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
// degen <-> solana
[
degenContract,
solanaContract,
[['Nethermind', 'LayerZero Labs'], []], // Solana DVNs and Degen DVNs
[21, 32], // confirmations for send and receive
[SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS],
],
])
return {
contracts: [
{ contract: baseContract },
{ contract: ethereumContract },
{ contract: arbitrumContract },
{ contract: degenContract },
{ contract: solanaContract },
],
connections,
}
}