ReceiverState.sol 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // contracts/State.sol
  2. // SPDX-License-Identifier: Apache 2
  3. pragma solidity ^0.8.0;
  4. import "./ReceiverStructs.sol";
  5. contract ReceiverEvents {
  6. event LogGuardianSetChanged(
  7. uint32 oldGuardianIndex,
  8. uint32 newGuardianIndex
  9. );
  10. event LogMessagePublished(
  11. address emitter_address,
  12. uint32 nonce,
  13. bytes payload
  14. );
  15. }
  16. contract ReceiverStorage {
  17. struct WormholeState {
  18. ReceiverStructs.Provider provider;
  19. // Mapping of guardian_set_index => guardian set
  20. mapping(uint32 => ReceiverStructs.GuardianSet) guardianSets;
  21. // Current active guardian set index
  22. uint32 guardianSetIndex;
  23. // Period for which a guardian set stays active after it has been replaced
  24. uint32 guardianSetExpiry;
  25. // Mapping of consumed governance actions
  26. mapping(bytes32 => bool) consumedGovernanceActions;
  27. // Mapping of initialized implementations
  28. mapping(address => bool) initializedImplementations;
  29. }
  30. }
  31. contract ReceiverState {
  32. ReceiverStorage.WormholeState _state;
  33. }