Skip to content

Commit 2c52bc3

Browse files
committed
chore: remove logs
1 parent a816b67 commit 2c52bc3

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

src/Governance.sol

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import {add, max} from "./utils/Math.sol";
1616
import {Multicall} from "./utils/Multicall.sol";
1717
import {WAD, PermitParams} from "./utils/Types.sol";
1818

19-
// TODO: REMOVE
20-
import {console} from "forge-std/console.sol";
21-
2219
/// @title Governance: Modular Initiative based Governance
2320
contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance {
2421
using SafeERC20 for IERC20;
@@ -454,8 +451,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
454451
"Governance: array-length-mismatch"
455452
);
456453

457-
console.log("0");
458-
459454
(, GlobalState memory state) = _snapshotVotes();
460455

461456
uint256 votingThreshold = calculateVotingThreshold();
@@ -473,7 +468,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
473468
/// But cannot add or remove both
474469

475470
// only allow vetoing post the voting cutoff
476-
console.log("1");
477471
require(
478472
deltaLQTYVotes <= 0 || deltaLQTYVotes >= 0 && secondsWithinEpoch() <= EPOCH_VOTING_CUTOFF,
479473
"Governance: epoch-voting-cutoff"
@@ -489,7 +483,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
489483
require(deltaLQTYVotes <= 0 && deltaLQTYVetos <= 0, "Must be a withdrawal");
490484
}
491485
}
492-
console.log("3");
493486
// TODO: CHANGE
494487
// Can add if active
495488
// Can remove if inactive
@@ -498,7 +491,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
498491

499492

500493
(, InitiativeState memory initiativeState) = _snapshotVotesForInitiative(initiative);
501-
console.log("4");
502494

503495
// deep copy of the initiative's state before the allocation
504496
InitiativeState memory prevInitiativeState = InitiativeState(
@@ -510,35 +502,29 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
510502
initiativeState.lastEpochClaim
511503
);
512504

513-
console.log("add(initiativeState.voteLQTY, deltaLQTYVotes)", add(initiativeState.voteLQTY, deltaLQTYVotes));
514505
// update the average staking timestamp for the initiative based on the user's average staking timestamp
515506
initiativeState.averageStakingTimestampVoteLQTY = _calculateAverageTimestamp(
516507
initiativeState.averageStakingTimestampVoteLQTY,
517508
userState.averageStakingTimestamp,
518509
initiativeState.voteLQTY,
519510
add(initiativeState.voteLQTY, deltaLQTYVotes)
520511
);
521-
console.log("5");
522512
initiativeState.averageStakingTimestampVetoLQTY = _calculateAverageTimestamp(
523513
initiativeState.averageStakingTimestampVetoLQTY,
524514
userState.averageStakingTimestamp,
525515
initiativeState.vetoLQTY,
526516
add(initiativeState.vetoLQTY, deltaLQTYVetos)
527517
);
528-
console.log("6");
529518

530519
// allocate the voting and vetoing LQTY to the initiative
531520
initiativeState.voteLQTY = add(initiativeState.voteLQTY, deltaLQTYVotes);
532521
initiativeState.vetoLQTY = add(initiativeState.vetoLQTY, deltaLQTYVetos);
533522

534-
console.log("7");
535-
536523
// determine if the initiative's allocated voting LQTY should be included in the vote count
537524
uint240 votesForInitiative =
538525
lqtyToVotes(initiativeState.voteLQTY, block.timestamp, initiativeState.averageStakingTimestampVoteLQTY);
539526
initiativeState.counted = (votesForInitiative >= votingThreshold) ? 1 : 0;
540527

541-
console.log("8");
542528
// update the initiative's state
543529
initiativeStates[initiative] = initiativeState;
544530

@@ -562,24 +548,14 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
562548
state.countedVoteLQTY += initiativeState.voteLQTY;
563549
}
564550

565-
console.log("9");
566551

567552
// allocate the voting and vetoing LQTY to the initiative
568-
console.log("B4 lqtyAllocatedByUserToInitiative[msg.sender][initiative]", lqtyAllocatedByUserToInitiative[msg.sender][initiative].voteLQTY);
569553
Allocation memory allocation = lqtyAllocatedByUserToInitiative[msg.sender][initiative];
570-
console.log("allocation.voteLQTY", allocation.voteLQTY);
571-
console.log("deltaLQTYVotes", uint256(int256(deltaLQTYVotes)));
572554
allocation.voteLQTY = add(allocation.voteLQTY, deltaLQTYVotes);
573-
console.log("allocation.voteLQTY", allocation.voteLQTY);
574555
allocation.vetoLQTY = add(allocation.vetoLQTY, deltaLQTYVetos);
575-
console.log("allocation.vetoLQTY", allocation.vetoLQTY);
576556
allocation.atEpoch = currentEpoch;
577-
console.log("allocation.atEpoch", allocation.atEpoch);
578557
require(!(allocation.voteLQTY != 0 && allocation.vetoLQTY != 0), "Governance: vote-and-veto");
579558
lqtyAllocatedByUserToInitiative[msg.sender][initiative] = allocation;
580-
console.log("After lqtyAllocatedByUserToInitiative[msg.sender][initiative]", lqtyAllocatedByUserToInitiative[msg.sender][initiative].voteLQTY);
581-
582-
console.log("10");
583559

584560
userState.allocatedLQTY = add(userState.allocatedLQTY, deltaLQTYVotes + deltaLQTYVetos);
585561

test/Governance.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ contract GovernanceTest is Test {
10911091
vm.stopPrank();
10921092
}
10931093

1094+
// forge test --match-test test_claimForInitiative -vv
10941095
function test_claimForInitiative() public {
10951096
vm.startPrank(user);
10961097

0 commit comments

Comments
 (0)