Skip to content

Commit

Permalink
clean up comments && TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Sep 16, 2024
1 parent 6f986bd commit b09a3bb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions packages/protocol/contracts-0.8/common/EpochManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract EpochManager is
}

struct EpochProcessState {
EpochProcessStatus status; // TODO maybe a enum for future updates
EpochProcessStatus status;
uint256 perValidatorReward; // The per validator epoch reward.
uint256 totalRewardsVoter; // The total rewards to voters.
uint256 totalRewardsCommunity; // The total community reward.
Expand Down Expand Up @@ -181,7 +181,6 @@ contract EpochManager is
// TODO complete this function
require(isOnEpochProcess(), "Epoch process is not started");
// finalize epoch
// TODO last block should be the block before and timestamp from previous block
epochs[currentEpochNumber].lastBlock = block.number - 1;
// start new epoch
currentEpochNumber++;
Expand Down
4 changes: 4 additions & 0 deletions packages/protocol/contracts-0.8/governance/Validators.sol
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,10 @@ contract Validators is
group.slashInfo.lastSlashed = block.timestamp;
}

/**
* @notice Allows the EpochManager contract to mint stable token for itself.
* @param amount The amount to be minted.
*/
function mintStableToEpochManager(
uint256 amount
) external onlyL2 nonReentrant onlyRegisteredContract(EPOCH_MANAGER_REGISTRY_ID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ interface IEpochManager {
function initializeSystem(
uint256 firstEpochNumber,
uint256 firstEpochBlock,
// uint256 firstEpochTimestamp, // TODO: do we need END timestamp?
address[] calldata firstElected
) external;
function startNextEpochProcess() external;
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/governance/Election.sol
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ contract Election is
uint256 value,
address lesser,
address greater
) internal onlyL1 {
) internal {
if (votes.total.eligible.contains(group)) {
uint256 newVoteTotal = votes.total.eligible.getValue(group).add(value);
votes.total.eligible.update(group, newVoteTotal, lesser, greater);
Expand Down
2 changes: 0 additions & 2 deletions packages/protocol/migrations_sol/Migration.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,6 @@ contract Migration is Script, UsingRegistry, MigrationsConstants {

console.log(" * Registering validators ... Count: ", valKeys.length - groupCount);
// Split the validator keys into groups that will fit within the max group size.
// uint256 amountOfGroups = Math.ceilDiv(valKeys.length - groupCount, maxGroupSize);
// console.log("Amount of groups: ", amountOfGroups);

// TODO change name of variable amount of groups for amount in group
for (uint256 groupIndex = 0; groupIndex < groupCount; groupIndex++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ contract EpochRewardsTest_getTargetVoterRewards is EpochRewardsTest {
}

contract EpochRewardsTest_getTargetTotalEpochPaymentsInGold is EpochRewardsTest {
// TODO(soloseng): add L2 test case that uses EpochManager
function test_ShouldgetTargetTotalEpochPaymentsInGold_WhenExchangeRateIsSet() public {
uint256 numberValidators = 100;
epochRewards.setNumberValidatorsInCurrentSet(numberValidators);
Expand All @@ -457,7 +456,6 @@ contract EpochRewardsTest_getTargetTotalEpochPaymentsInGold is EpochRewardsTest
}

contract EpochRewardsTest_getRewardsMultiplier is EpochRewardsTest {
// TODO(soloseng): add L2 test case using EpochManager
uint256 constant timeDelta = YEAR * 10;
uint256 expectedTargetTotalSupply;
uint256 expectedTargetRemainingSupply;
Expand Down Expand Up @@ -504,7 +502,6 @@ contract EpochRewardsTest_getRewardsMultiplier is EpochRewardsTest {
}

contract EpochRewardsTest_updateTargetVotingYield is EpochRewardsTest {
//TODO(soloseng): add L2 test case that uses epochManager
uint256 constant totalSupply = 6000000 ether;
uint256 constant reserveBalance = 1000000 ether;
uint256 constant floatingSupply = totalSupply - reserveBalance;
Expand Down

0 comments on commit b09a3bb

Please sign in to comment.