CustomConsistencyLevel.sol 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: Apache 2
  2. pragma solidity ^0.8.0;
  3. import "./interfaces/ICustomConsistencyLevel.sol";
  4. string constant customConsistencyLevelVersion = "CustomConsistencyLevel-0.0.1";
  5. /// @title CustomConsistencyLevel
  6. /// @author Wormhole Project Contributors.
  7. /// @notice The CustomConsistencyLevel contract is an immutable contract that tracks custom consistency level configurations per integrator (emitter address).
  8. contract CustomConsistencyLevel is ICustomConsistencyLevel {
  9. string public constant VERSION = customConsistencyLevelVersion;
  10. mapping(address => bytes32) private _configurations;
  11. // ==================== External Interface ===============================================
  12. /// @inheritdoc ICustomConsistencyLevel
  13. function configure(
  14. bytes32 config
  15. ) external override {
  16. _configurations[msg.sender] = config;
  17. emit ConfigSet(msg.sender, config);
  18. }
  19. /// @inheritdoc ICustomConsistencyLevel
  20. function getConfiguration(
  21. address emitterAddress
  22. ) external view override returns (bytes32) {
  23. return _configurations[emitterAddress];
  24. }
  25. }