State.sol 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // contracts/State.sol
  2. // SPDX-License-Identifier: Apache 2
  3. pragma solidity ^0.8.0;
  4. import "./Structs.sol";
  5. contract Events {
  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 Storage {
  17. struct WormholeState {
  18. Structs.Provider provider;
  19. // Mapping of guardian_set_index => guardian set
  20. mapping(uint32 => Structs.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. // Sequence numbers per emitter
  26. mapping(address => uint64) sequences;
  27. // Mapping of consumed governance actions
  28. mapping(bytes32 => bool) consumedGovernanceActions;
  29. // Mapping of initialized implementations
  30. mapping(address => bool) initializedImplementations;
  31. uint256 messageFee;
  32. }
  33. }
  34. contract State {
  35. Storage.WormholeState _state;
  36. }