Skip to content

Commit

Permalink
Merge pull request #124 from liquity/expose-constant
Browse files Browse the repository at this point in the history
refactor: expose constant that can be returned by public getter
  • Loading branch information
bingen authored Jan 2, 2025
2 parents f6839c9 + f8684d9 commit ac09a1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BribeInitiative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.24;
import {IERC20} from "openzeppelin/contracts/interfaces/IERC20.sol";
import {SafeERC20} from "openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import {IGovernance} from "./interfaces/IGovernance.sol";
import {IGovernance, UNREGISTERED_INITIATIVE} from "./interfaces/IGovernance.sol";
import {IInitiative} from "./interfaces/IInitiative.sol";
import {IBribeInitiative} from "./interfaces/IBribeInitiative.sol";

Expand Down
4 changes: 1 addition & 3 deletions src/Governance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {IERC20} from "openzeppelin/contracts/interfaces/IERC20.sol";
import {SafeERC20} from "openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ReentrancyGuard} from "openzeppelin/contracts/utils/ReentrancyGuard.sol";

import {IGovernance} from "./interfaces/IGovernance.sol";
import {IGovernance, UNREGISTERED_INITIATIVE} from "./interfaces/IGovernance.sol";
import {IInitiative} from "./interfaces/IInitiative.sol";
import {ILQTYStaking} from "./interfaces/ILQTYStaking.sol";

Expand Down Expand Up @@ -74,8 +74,6 @@ contract Governance is MultiDelegateCall, UserProxyFactory, ReentrancyGuard, Own
/// @inheritdoc IGovernance
mapping(address => uint256) public override registeredInitiatives;

uint256 constant UNREGISTERED_INITIATIVE = type(uint256).max;

constructor(
address _lqty,
address _lusd,
Expand Down
6 changes: 5 additions & 1 deletion src/interfaces/IGovernance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {ILQTYStaking} from "./ILQTYStaking.sol";

import {PermitParams} from "../utils/Types.sol";

uint256 constant UNREGISTERED_INITIATIVE = type(uint256).max;

interface IGovernance {
/// @notice Emitted when a user deposits LQTY
/// @param user The account depositing LQTY
Expand Down Expand Up @@ -216,7 +218,9 @@ interface IGovernance {

/// @notice Returns when an initiative was registered
/// @param _initiative Address of the initiative
/// @return atEpoch Epoch at which the initiative was registered
/// @return atEpoch If `_initiative` is an active initiative, returns the epoch at which it was registered.
/// If `_initiative` hasn't been registered, returns 0.
/// If `_initiative` has been unregistered, returns `UNREGISTERED_INITIATIVE`.
function registeredInitiatives(address _initiative) external view returns (uint256 atEpoch);

/*//////////////////////////////////////////////////////////////
Expand Down

0 comments on commit ac09a1a

Please sign in to comment.