Skip to content

Commit

Permalink
🪚 OFT examples (#298)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Krak <[email protected]>
Co-authored-by: Jan Nanista <[email protected]>
  • Loading branch information
3 people authored Jan 31, 2024
1 parent 3b9fd07 commit 5bdbbf8
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 2 deletions.
28 changes: 27 additions & 1 deletion examples/oapp/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import '@nomiclabs/hardhat-ethers'
import '@layerzerolabs/toolbox-hardhat'
import { HardhatUserConfig } from 'hardhat/types'

import { EndpointId } from '@layerzerolabs/lz-definitions'

const MNEMONIC = process.env.MNEMONIC ?? ''

const config: HardhatUserConfig = {
solidity: {
compilers: [
Expand All @@ -18,7 +22,29 @@ const config: HardhatUserConfig = {
},
],
},

networks: {
sepolia: {
eid: EndpointId.ETHEREUM_V2_TESTNET,
url: 'https://rpc.sepolia.org/',
accounts: {
mnemonic: MNEMONIC,
},
},
fuji: {
eid: EndpointId.AVALANCHE_V2_TESTNET,
url: 'https://api.avax-test.network/',
accounts: {
mnemonic: MNEMONIC,
},
},
mumbai: {
eid: EndpointId.POLYGON_V2_TESTNET,
url: 'https://rpc-mumbai.matic.today',
accounts: {
mnemonic: MNEMONIC,
},
},
},
namedAccounts: {
deployer: {
default: 0, // wallet address of index[0], of the mnemonic in .env
Expand Down
84 changes: 84 additions & 0 deletions examples/oapp/layerzero.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { EndpointId } from '@layerzerolabs/lz-definitions'

const sepoliaContract = {
eid: EndpointId.ETHEREUM_V2_TESTNET,
contractName: 'MyOApp',
}

const fujiContract = {
eid: EndpointId.AVALANCHE_V2_TESTNET,
contractName: 'MyOApp',
}

const mumbaiContract = {
eid: EndpointId.POLYGON_V2_TESTNET,
contractName: 'MyOApp',
}

export default {
contracts: [
{
contract: fujiContract,
},
{
contract: sepoliaContract,
},
{
contract: mumbaiContract,
},
],
connections: [
{
from: fujiContract,
to: sepoliaContract,
config: {
sendConfig: {
executorConfig: {
maxMessageSize: 99,
executor: '0x71d7a02cDD38BEa35E42b53fF4a42a37638a0066',
},
ulnConfig: {
confirmations: BigInt(42),
requiredDVNs: [],
optionalDVNs: [
'0xe9dCF5771a48f8DC70337303AbB84032F8F5bE3E',
'0x0AD50201807B615a71a39c775089C9261A667780',
],
optionalDVNThreshold: 2,
},
},
receiveConfig: {
ulnConfig: {
confirmations: BigInt(42),
requiredDVNs: [],
optionalDVNs: [
'0x3Eb0093E079EF3F3FC58C41e13FF46c55dcb5D0a',
'0x0AD50201807B615a71a39c775089C9261A667780',
],
optionalDVNThreshold: 2,
},
},
},
},
{
from: fujiContract,
to: mumbaiContract,
},
{
from: sepoliaContract,
to: fujiContract,
},
{
from: sepoliaContract,
to: mumbaiContract,
},
{
from: mumbaiContract,
to: sepoliaContract,
},
{
from: mumbaiContract,
to: fujiContract,
},
],
}
28 changes: 27 additions & 1 deletion examples/oft/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import '@nomiclabs/hardhat-ethers'
import '@layerzerolabs/toolbox-hardhat'
import { HardhatUserConfig } from 'hardhat/types'

import { EndpointId } from '@layerzerolabs/lz-definitions'

const MNEMONIC = process.env.MNEMONIC ?? ''

const config: HardhatUserConfig = {
solidity: {
compilers: [
Expand All @@ -18,7 +22,29 @@ const config: HardhatUserConfig = {
},
],
},

networks: {
sepolia: {
eid: EndpointId.ETHEREUM_V2_TESTNET,
url: 'https://rpc.sepolia.org/',
accounts: {
mnemonic: MNEMONIC,
},
},
fuji: {
eid: EndpointId.AVALANCHE_V2_TESTNET,
url: 'https://api.avax-test.network/',
accounts: {
mnemonic: MNEMONIC,
},
},
mumbai: {
eid: EndpointId.POLYGON_V2_TESTNET,
url: 'https://rpc-mumbai.matic.today',
accounts: {
mnemonic: MNEMONIC,
},
},
},
namedAccounts: {
deployer: {
default: 0, // wallet address of index[0], of the mnemonic in .env
Expand Down
58 changes: 58 additions & 0 deletions examples/oft/layerzero.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
import { EndpointId } from '@layerzerolabs/lz-definitions'

const sepoliaContract = {
eid: EndpointId.ETHEREUM_V2_TESTNET,
contractName: 'MyOFT',
}

const fujiContract = {
eid: EndpointId.AVALANCHE_V2_TESTNET,
contractName: 'MyOFT',
}

const mumbaiContract = {
eid: EndpointId.POLYGON_V2_TESTNET,
contractName: 'MyOFT',
}

export default {
contracts: [
{
contract: fujiContract,
},
{
contract: sepoliaContract,
},
{
contract: mumbaiContract,
},
],
connections: [
{
from: fujiContract,
to: sepoliaContract,
config: {},
},
{
from: fujiContract,
to: mumbaiContract,
},
{
from: sepoliaContract,
to: fujiContract,
},
{
from: sepoliaContract,
to: mumbaiContract,
},
{
from: mumbaiContract,
to: sepoliaContract,
},
{
from: mumbaiContract,
to: fujiContract,
},
],
}

0 comments on commit 5bdbbf8

Please sign in to comment.