Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions contracts/Endpoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ contract Endpoint is Ownable, ILayerZeroEndpoint {
require(latestVersion < 65535, "LayerZero: can not add new messaging library");
latestVersion++;
libraryLookup[latestVersion] = ILayerZeroMessagingLibrary(_newLayerZeroLibraryAddress);
function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override validVersion(_version) {
if (_version == DEFAULT_VERSION) {
require(defaultSendVersion == defaultReceiveVersion, "LayerZero: can not set Config during DEFAULT migration");
_version = defaultSendVersion;
}
require(_version != BLOCK_VERSION, "LayerZero: can not set config for BLOCK_VERSION");
libraryLookup[_version].setConfig(_chainId, msg.sender, _configType, _config);
}
emit NewLibraryVersionAdded(latestVersion);
}

Expand All @@ -174,6 +182,7 @@ contract Endpoint is Ownable, ILayerZeroEndpoint {
// User Application Calls - UA set/get Interface

function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override validVersion(_version) {
require(_config.length > 0, "LayerZero: config payload cannot be empty");
if (_version == DEFAULT_VERSION) {
require(defaultSendVersion == defaultReceiveVersion, "LayerZero: can not set Config during DEFAULT migration");
_version = defaultSendVersion;
Expand Down