Skip to content

Commit

Permalink
adding more comments around optional configs
Browse files Browse the repository at this point in the history
  • Loading branch information
sirarthurmoney committed Feb 14, 2024
1 parent 317d949 commit 5b11062
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/toolbox-hardhat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ module.exports = config;

To use the `lz:oapp:wire` task you must first fill out your `layerzero.config` file.

To set up your config, you have to export an object from layerzero.config

This object can have entries like `contracts` and `connections`. For example:

#### TypeScript (layerzero.config.ts)

```typescript
Expand Down Expand Up @@ -128,18 +132,24 @@ const graph: OAppOmniGraphHardhat = {
],
connections: [
{
// Sets the peer `from -> to`
from: fujiContract,
to: sepoliaContract,
// Optional Configuration
config: {
// Optional Send Library
sendLibrary: "0x0000000000000000000000000000000000000000",
// Optional Receive Library Configuration
receiveLibraryConfig: {
receiveLibrary: "0x0000000000000000000000000000000000000000",
gracePeriod: BigInt(0),
},
// Optional Receive Library Timeout Configuration
receiveLibraryTimeoutConfig: {
lib: "0x0000000000000000000000000000000000000000",
expiry: BigInt(0),
},
// Optional Send Configuration
sendConfig: {
executorConfig: {
maxMessageSize: 99,
Expand All @@ -155,6 +165,7 @@ const graph: OAppOmniGraphHardhat = {
optionalDVNThreshold: 2,
},
},
// Optional Receive Configuration
receiveConfig: {
ulnConfig: {
confirmations: BigInt(42),
Expand All @@ -166,6 +177,7 @@ const graph: OAppOmniGraphHardhat = {
optionalDVNThreshold: 2,
},
},
// Optional Enforced Options Configuration
enforcedOptions: [
{
msgType: 1,
Expand Down Expand Up @@ -201,6 +213,8 @@ const graph: OAppOmniGraphHardhat = {
export default graph;
```

## LayerZero configuration

- The `sepoliaContract` and `fujiContract` are defining LayerZero OApp Contracts to wire.<br><br>

- `contracts`: A conditionally required array of LayerZero Contracts.
Expand All @@ -211,8 +225,8 @@ export default graph;
- `address`: The contract address. An optional parameter. It should be provided if the contracts are not located in the deployments folder.<br><br>

- `connections`: A conditionally required array of LayerZero Connections defining the configuration between two LayerZero contracts.
- `from`: A LayerZero Contract, defines the `from` contract.
- `to`: A LayerZero Contract, defines the `to` contract.
- `from`: A LayerZero Contract, defines the `from` contract. This sets the peer `from -> to`
- `to`: A LayerZero Contract, defines the `to` contract. This sets the peer `from -> to`
- `config`: An optional LayerZero Config, defines a configuration between two contracts.
- `sendLibrary`: An optional string, defines the Send Library Address.
- `receiveLibraryConfig`: An optional LayerZero Receive Library Config, defines the receiveLibrary and gracePeriod.
Expand Down

0 comments on commit 5b11062

Please sign in to comment.