LayerZero UA Configuration
To configure zkLightClient as the oracle using LayerZero UA, your application needs to modify the default oracle of the L0 Endpoint.
You can use the following code in ILayerZeroEndpoint
to set the zkLightClient oracle.
// Remember to call this piece of code in ILayerZeroEndpoint on both the sender chain and receiver chain to set up zkLightClient as the oracle.
/**
* @param dstChainId - the destination chain identifier
* @param zkLightClient - the ZkLightClient address
*/
function setOracle(uint16 dstChainId, address zkLightClient) external {
uint256 TYPE_ORACLE = 6;
ILayerZeroEndpoint(lzEndpointAddress).setConfig(
ILayerZeroEndpoint(lzEndpointAddress).getSendVersion(address(this)),
dstChainId,
TYPE_ORACLE,
abi.encode(zkLightClient)
);
}
For more information, check out the tutorial here.
Last updated