PythSetters.sol 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 setPyth2WormholeChainId(uint16 chainId) internal {
  7. _state._deprecatedPyth2WormholeChainId = chainId;
  8. }
  9. function setPyth2WormholeEmitter(bytes32 emitterAddr) internal {
  10. _state._deprecatedPyth2WormholeEmitter = emitterAddr;
  11. }
  12. function setWormhole(address wh) internal {
  13. _state.wormhole = payable(wh);
  14. }
  15. function setLatestPriceInfo(
  16. bytes32 priceId,
  17. PythInternalStructs.PriceInfo memory info
  18. ) internal {
  19. _state.latestPriceInfo[priceId] = info;
  20. }
  21. function setSingleUpdateFeeInWei(uint fee) internal {
  22. _state.singleUpdateFeeInWei = fee;
  23. }
  24. function setValidTimePeriodSeconds(uint validTimePeriodSeconds) internal {
  25. _state.validTimePeriodSeconds = validTimePeriodSeconds;
  26. }
  27. function setGovernanceDataSource(
  28. PythInternalStructs.DataSource memory newDataSource
  29. ) internal {
  30. _state.governanceDataSource = newDataSource;
  31. }
  32. function setLastExecutedGovernanceSequence(uint64 sequence) internal {
  33. _state.lastExecutedGovernanceSequence = sequence;
  34. }
  35. function setGovernanceDataSourceIndex(uint32 newIndex) internal {
  36. _state.governanceDataSourceIndex = newIndex;
  37. }
  38. }