PythSetters.sol 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // contracts/Setters.sol
  2. // SPDX-License-Identifier: Apache 2
  3. pragma solidity ^0.8.0;
  4. import "./PythState.sol";
  5. contract PythSetters is PythState {
  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 setChainId(uint16 chainId) internal {
  13. _state.provider.chainId = chainId;
  14. }
  15. function setGovernanceChainId(uint16 chainId) internal {
  16. _state.provider.governanceChainId = chainId;
  17. }
  18. function setGovernanceContract(bytes32 governanceContract) internal {
  19. _state.provider.governanceContract = governanceContract;
  20. }
  21. function setPyth2WormholeChainId(uint16 chainId) internal {
  22. _state.provider.pyth2WormholeChainId = chainId;
  23. }
  24. function setPyth2WormholeEmitter(bytes32 emitterAddr) internal {
  25. _state.provider.pyth2WormholeEmitter = emitterAddr;
  26. }
  27. function setWormhole(address wh) internal {
  28. _state.wormhole = payable(wh);
  29. }
  30. function setLatestPriceInfo(bytes32 priceId, PythStructs.PriceInfo memory info) internal {
  31. _state.latestPriceInfo[priceId] = info;
  32. }
  33. }