ReceiverSetters.sol 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // contracts/Setters.sol
  2. // SPDX-License-Identifier: Apache 2
  3. pragma solidity ^0.8.0;
  4. import "./ReceiverState.sol";
  5. contract ReceiverSetters is ReceiverState {
  6. function updateGuardianSetIndex(uint32 newIndex) internal {
  7. _state.guardianSetIndex = newIndex;
  8. }
  9. function expireGuardianSet(uint32 index) internal {
  10. _state.guardianSets[index].expirationTime =
  11. uint32(block.timestamp) +
  12. 86400;
  13. }
  14. function storeGuardianSet(
  15. ReceiverStructs.GuardianSet memory set,
  16. uint32 index
  17. ) internal {
  18. _state.guardianSets[index] = set;
  19. }
  20. function setInitialized(address implementatiom) internal {
  21. _state.initializedImplementations[implementatiom] = true;
  22. }
  23. function setGovernanceActionConsumed(bytes32 hash) internal {
  24. _state.consumedGovernanceActions[hash] = true;
  25. }
  26. function setChainId(uint16 chainId) internal {
  27. _state.provider.chainId = chainId;
  28. }
  29. function setGovernanceChainId(uint16 chainId) internal {
  30. _state.provider.governanceChainId = chainId;
  31. }
  32. function setGovernanceContract(bytes32 governanceContract) internal {
  33. _state.provider.governanceContract = governanceContract;
  34. }
  35. }