BridgeState.sol 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // contracts/State.sol
  2. // SPDX-License-Identifier: Apache 2
  3. pragma solidity ^0.8.0;
  4. import "./BridgeStructs.sol";
  5. contract BridgeStorage {
  6. struct Provider {
  7. uint16 chainId;
  8. uint16 governanceChainId;
  9. bytes32 governanceContract;
  10. address WETH;
  11. }
  12. struct Asset {
  13. uint16 chainId;
  14. bytes32 assetAddress;
  15. }
  16. struct State {
  17. address payable wormhole;
  18. address tokenImplementation;
  19. Provider provider;
  20. // Mapping of consumed governance actions
  21. mapping(bytes32 => bool) consumedGovernanceActions;
  22. // Mapping of consumed token transfers
  23. mapping(bytes32 => bool) completedTransfers;
  24. // Mapping of initialized implementations
  25. mapping(address => bool) initializedImplementations;
  26. // Mapping of wrapped assets (chainID => nativeAddress => wrappedAddress)
  27. mapping(uint16 => mapping(bytes32 => address)) wrappedAssets;
  28. // Mapping to safely identify wrapped assets
  29. mapping(address => bool) isWrappedAsset;
  30. // Mapping of native assets to amount outstanding on other chains
  31. mapping(address => uint256) outstandingBridged;
  32. // Mapping of bridge contracts on other chains
  33. mapping(uint16 => bytes32) bridgeImplementations;
  34. }
  35. }
  36. contract BridgeState {
  37. BridgeStorage.State _state;
  38. }