Skip to main content
Version: Endpoint V2

Wiring Pathways

Wiring your contracts will set the peer address for your OApp or OFT and initialize the desired configuration in your layerzero.config.ts. If unfamiliar with this concept, review the OApp Quickstart.

The CLI Tool makes this one step easier by enabling you to wire and configure your contract pathways with a single command:

$ npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts

Before wiring your contracts, you should review your layerzero.config.ts to ensure that you have specified accurately the configuration you want to set.

Checking setPeers

To check if your contracts have correctly been set to communicate with one another, you can run:

npx hardhat lz:oapp:peers:get --oapp-config layerzero.config.ts

Checking Pathway config

To confirm your OApp's configuration has been set as intended, you can run:

$ npx hardhat lz:oapp:config:get --oapp-config layerzero.config.ts

Checking Pathway executor

To see your OApp's configured executor, you can run:

npx hardhat lz:oapp:config:get:executor --oapp-config layerzero.config.ts

Checking Pathway enforcedOptions

To see your OApp's configured execution gas has been set as intended, you can run:

npx hardhat lz:oapp:enforced-opts:get --oapp-config layerzero.config.ts

Checking Pathway defaults

To see what the default configuration is for any pathway, run:

npx hardhat lz:oapp:config:get --oapp-config layerzero.config.ts

Wiring Contracts via Multisig

If your contracts are owned by a gnosis multisig wallet, you must define the multisig's safeUrl and safeAddress per chain in your hardhat.config.ts file to enable the submission of wire transactions for multisig approval.

Step 1: Configure your gnosis

In your hardhat config, add safeConfig to your networks, with your specific safeUrl and safeAddress mapped accordingly:

// hardhat.config.ts

networks: {
// Include configurations for other networks as needed
fuji: {
/* ... */
// Network-specific settings
safeConfig: {
safeUrl: 'http://something',
safeAddress: 'address'
}
}
}

Step 2: Use your safe config

When wiring, pass the --safe flag in your wire command.

$ npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts --safe

This command initiates the wiring process under the multisig setup, pushing transactions to the specified multisig wallet for necessary approvals.

note

Ensure your development tools are up to date to utilize this feature, as it relies on the latest versions of the required dependencies.