IWormhole.sol 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // contracts/Messages.sol
  2. // SPDX-License-Identifier: Apache 2
  3. pragma solidity ^0.8.0;
  4. import "../Structs.sol";
  5. interface IWormhole is Structs {
  6. event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel);
  7. function publishMessage(
  8. uint32 nonce,
  9. bytes memory payload,
  10. uint8 consistencyLevel
  11. ) external payable returns (uint64 sequence);
  12. function parseAndVerifyVM(bytes calldata encodedVM) external view returns (Structs.VM memory vm, bool valid, string memory reason);
  13. function verifyVM(Structs.VM memory vm) external view returns (bool valid, string memory reason);
  14. function verifySignatures(bytes32 hash, Structs.Signature[] memory signatures, Structs.GuardianSet memory guardianSet) external pure returns (bool valid, string memory reason) ;
  15. function parseVM(bytes memory encodedVM) external pure returns (Structs.VM memory vm);
  16. function getGuardianSet(uint32 index) external view returns (Structs.GuardianSet memory) ;
  17. function getCurrentGuardianSetIndex() external view returns (uint32) ;
  18. function getGuardianSetExpiry() external view returns (uint32) ;
  19. function governanceActionIsConsumed(bytes32 hash) external view returns (bool) ;
  20. function isInitialized(address impl) external view returns (bool) ;
  21. function chainId() external view returns (uint16) ;
  22. function governanceChainId() external view returns (uint16);
  23. function governanceContract() external view returns (bytes32);
  24. function messageFee() external view returns (uint256) ;
  25. }