BridgeSetters.sol 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // contracts/Setters.sol
  2. // SPDX-License-Identifier: Apache 2
  3. pragma solidity ^0.8.0;
  4. import "./BridgeState.sol";
  5. contract BridgeSetters is BridgeState {
  6. function setInitialized(address implementatiom) internal {
  7. _state.initializedImplementations[implementatiom] = true;
  8. }
  9. function setGovernanceActionConsumed(bytes32 hash) internal {
  10. _state.consumedGovernanceActions[hash] = true;
  11. }
  12. function setTransferCompleted(bytes32 hash) internal {
  13. _state.completedTransfers[hash] = true;
  14. }
  15. function setChainId(uint16 chainId) internal {
  16. _state.provider.chainId = chainId;
  17. }
  18. function setGovernanceChainId(uint16 chainId) internal {
  19. _state.provider.governanceChainId = chainId;
  20. }
  21. function setGovernanceContract(bytes32 governanceContract) internal {
  22. _state.provider.governanceContract = governanceContract;
  23. }
  24. function setBridgeImplementation(uint16 chainId, bytes32 bridgeContract) internal {
  25. _state.bridgeImplementations[chainId] = bridgeContract;
  26. }
  27. function setTokenImplementation(address impl) internal {
  28. _state.tokenImplementation = impl;
  29. }
  30. function setWETH(address weth) internal {
  31. _state.provider.WETH = weth;
  32. }
  33. function setWormhole(address wh) internal {
  34. _state.wormhole = payable(wh);
  35. }
  36. function setWrappedAsset(uint16 tokenChainId, bytes32 tokenAddress, address wrapper) internal {
  37. _state.wrappedAssets[tokenChainId][tokenAddress] = wrapper;
  38. _state.isWrappedAsset[wrapper] = true;
  39. }
  40. function setOutstandingBridged(address token, uint256 outstanding) internal {
  41. _state.outstandingBridged[token] = outstanding;
  42. }
  43. }