-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayerzero.config.ts
More file actions
89 lines (83 loc) · 2.54 KB
/
layerzero.config.ts
File metadata and controls
89 lines (83 loc) · 2.54 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
import {ExecutorOptionType} from '@layerzerolabs/lz-v2-utilities';
import {OAppEnforcedOption, OmniPointHardhat} from '@layerzerolabs/toolbox-hardhat';
import {EndpointId} from '@layerzerolabs/lz-definitions';
import {generateConnectionsConfig} from '@layerzerolabs/metadata-tools';
export const baseContract: OmniPointHardhat = {
eid: EndpointId.BASE_V2_MAINNET,
contractName: 'VirtualOFTAdapter',
};
export const solanaContract: OmniPointHardhat = {
eid: EndpointId.SOLANA_V2_MAINNET,
address: 'AgrZJ5zTrQwkB13cEb7TDjLbe7PR577kTquEkNVemAXX', // 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 () {
const connections = await generateConnectionsConfig([
[baseContract, solanaContract, [['LayerZero Labs', 'Google'], []], [10, 32], [SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS]],
]);
return {
contracts: [
{
contract: baseContract,
// TODO: uncomment this when ready to transfer delegate - run wire:
// pnpm hardhat lz:oapp:wire --oapp-config layerzero.config.ts --solana-secret-key $SOLANA_PRIVATE_KEY --solana-program-id $SOLANA_PROGRAM_ID
// TODO: update owner with:
// pnpm hardhat lz:ownable:transfer-ownership --oapp-config layerzero.config.ts --solana-program-id $SOLANA_PROGRAM_ID --solana-secret-key $SOLANA_PRIVATE_KEY
// config: {
// delegate: '0xE220329659D41B2a9F26E83816B424bDAcF62567',
// owner: '0xE220329659D41B2a9F26E83816B424bDAcF62567'
// }
},
{
contract: solanaContract,
config: {
delegate: 'sFjjLFuyvHDXLsMVXC9gdPTsxZBhoixuE7S6FSijV2W',
owner: 'sFjjLFuyvHDXLsMVXC9gdPTsxZBhoixuE7S6FSijV2W'
}
}
],
connections,
};
}