Skip to main content
Version: Endpoint V1 Docs

Wire Up Configuration

Describes the available config options in the wireUpConfig.json

Wire Up Configuration

This config can be used to set the following on your UA contract:

  • function setFeeBp(uint16, bool, uint16)
  • function setDefaultFeeBp(uint16)
  • function setMinDstGas(uint16, uint16, uint)
  • function setUseCustomAdapterParams(bool)
  • function setTrustedRemote(uint16, bytes)

Available configuration options

To use the LayerZero wire up configuration please correctly fill in your wireUpConfig.json

{
"proxyContractConfig": {
"chain": "avalanche",
"name": "ProxyOFT"
},
"contractConfig": {
"name": "OFT"
},
"chainConfig": {
"avalanche": {
"defaultFeeBp": 2,
"useCustomAdapterParams": true,
"remoteNetworkConfig": {
"ethereum": {
"feeBpConfig": {
"feeBp": 5,
"enabled": true
},
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 2000000
}
},
"polygon": {
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
}
}
}
}
}

The proxyContractConfig is an optional setting, that defines the proxy chain and proxy contract name.

  • chain: An optional string, defines the proxy chain.
  • name: An optional string, defines the proxy contract name.
  • address: A optional string, defines the contract address. Used when deployments folder are not available. Uses standard LzApp/Nonblocking/OFT/ONFT abi calls such as:
    • function setFeeBp(uint16, bool, uint16)
    • function setDefaultFeeBp(uint16)
    • function setMinDstGas(uint16, uint16, uint)
    • function setUseCustomAdapterParams(bool)
    • function setTrustedRemote(uint16, bytes)

The contractConfig is a conditionally required setting, that defines the contract name.

  • name: A conditionally required string, defines the contract name. Used when all contract names are the same on all chains, excluding proxy.

The chainConfig: is required and defines the chain settings (default fees, useCustomAdapterParams) and the remote chain configs (minDstGas config based of packetType, and custom feeBP per chain)

  • name: A conditionally required string, defines the contract name. Used when contract names differ per chain.
  • address: A conditionally required string, defines the contract address. Used when deployments folder are not available. Uses standard LzApp/Nonblocking/OFT/ONFT abi calls.
  • defaultFeeBp: An optional number, defines the default fee bp for the chain. (Available in OFTV2 w/ fee.)
  • useCustomAdapterParams: An optional bool that defaults to false. Uses default 200k destination gas on all cross chain messages. When false adapter parameters must be empty. When useCustomAdapterParams is true the minDstGasLookup must be set for each packet type and each chain. This requires whoever calls the send function to provide the adapter params with a destination gas >= amount set for that packet type and that destination chain.

The remoteNetworkConfig is a required setting that defines the remote chain configs (minDstGas config based on packetType, and custom feeBP per chain)

  • minDstGasConfig: is an optional object that defines the minDstGas required based off packetType. So for example when the UA on Avalanche sends packet type 0 to Ethereum the minDstGas will be 100000. When the UA on Avalanche sends packet type 1 to Polygon the minDstGas will be 160000.

The feeBpConfig is an optional setting that defines custom feeBP per chain. (Note: setting custom fee per chain with enabled = TRUE, will triumph over default`FeeBp.)

  • feeBp: is an optional number, defines custom feeBP per chain.
  • enabled: is an optional bool, defines if custom feeBP per chain is enabled

Example wireUpConfigs

Example 1

{
"contractConfig" {
"name": "OFT"
},
"avalanche-testnet": {
"defaultFeeBp": 5,
"useCustomAdapterParams": true,
"remoteNetworkConfig": {
"arbitrum-goerli": {
"minDstGasConfig": {
"packetType_0": 2000000,
"packetType_1": 3200000
}
},
"bsc-testnet": {
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
}
}
}
}

This configuration is setting a defaultFeeBp of 5 for all transactions on fuji. This configuration is also setting the minDstGasLookup based on packet types. The minDstGasConfig has a length of 2 with the indexes representing the packet type. So for example when the UA on fuji sends packet type 0 to arbitrum-testnet the minDstGas will be 2000000. When the UA on fuji sends packet type 1 to bsc-testnet the minDstGas will be 160000.

Example 2

{
"proxyContractConfig": {
"chain": "avalanche-testnet",
"name": "ExampleProxyOFTV2"
}
"chainConfig": {
"arbitrum-testnet": {
"remoteNetworkConfig": {
"arbitrum-testnet": {
"feeBpConfig": {
"enabled": true,
"feeBp": 2
},
"minDstGasConfig": {
"packetType_0": 2000000,
"packetType_1": 3200000
}
},
"bsc-testnet": {
"feeBpConfig": {
"enabled": true,
"feeBp": 3
},
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
}
}
},
"bsc-testnet": {
"name": "BscOFTV2",
"remoteNetworkConfig": {
"arbitrum-testnet": {
"feeBpConfig": {
"feeBp": 5,
"enabled": true
},
"minDstGasConfig": {
"packetType_0": 2000000,
"packetType_1": 3200000
}
},
"avalanche-testnet": {
"feeBpConfig": {
"feeBp": 4,
"enabled": true
},
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
}
}
},
"arbitrum-testnet": {
"name": "ArbitrumOFTV2",
"remoteNetworkConfig": {
"bsc-testnet": {
"feeBpConfig": {
"feeBp": 1,
"enabled": true
},
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
},
"avalanche-testnet": {
"feeBpConfig": {
"feeBp": 2,
"enabled": true
},
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
}
}
}
}
}

This configuration uses name per chain because each chain has a different contract name. This configuration is setting a custom bp fee per pathway instead of a defaultFeeBp.

Example 3

{
"proxyContractConfig": {
"chain": "avalanche-testnet",
"address": "0x0000000000000000000000000000000000000000"
},
"chainConfig": {
"avalanche-testnet": {
"defaultFeeBp": 0,
"useCustomAdapterParams": true,
"remoteNetworkConfig": {
"bsc-testnet": {
"feeBpConfig": {
"enabled": false,
"feeBp": 0
},
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
}
}
},
"bsc-testnet": {
"address": "0x0000000000000000000000000000000000000000",
"defaultFeeBp": 0,
"useCustomAdapterParams": true,
"remoteNetworkConfig": {
"avalanche-testnet": {
"feeBpConfig": {
"feeBp": 0,
"enabled": false
},
"minDstGasConfig": {
"packetType_0": 100000,
"packetType_1": 160000
}
}
}
}
}
}

This configuration uses address per chain and relys on the contracts containing the following ABI's:

  • function setTrustedRemote(uint16, bytes)
  • function setUseCustomAdapterParams(bool)
  • function setMinDstGas(uint16, uint16, uint)
  • function setDefaultFeeBp(uint16)
  • function setFeeBp(uint16, bool, uint16)