@@ -16,9 +16,6 @@ import {add, max} from "./utils/Math.sol";
16
16
import {Multicall} from "./utils/Multicall.sol " ;
17
17
import {WAD, PermitParams} from "./utils/Types.sol " ;
18
18
19
- // TODO: REMOVE
20
- import {console} from "forge-std/console.sol " ;
21
-
22
19
/// @title Governance: Modular Initiative based Governance
23
20
contract Governance is Multicall , UserProxyFactory , ReentrancyGuard , IGovernance {
24
21
using SafeERC20 for IERC20 ;
@@ -454,8 +451,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
454
451
"Governance: array-length-mismatch "
455
452
);
456
453
457
- console.log ("0 " );
458
-
459
454
(, GlobalState memory state ) = _snapshotVotes ();
460
455
461
456
uint256 votingThreshold = calculateVotingThreshold ();
@@ -473,7 +468,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
473
468
/// But cannot add or remove both
474
469
475
470
// only allow vetoing post the voting cutoff
476
- console.log ("1 " );
477
471
require (
478
472
deltaLQTYVotes <= 0 || deltaLQTYVotes >= 0 && secondsWithinEpoch () <= EPOCH_VOTING_CUTOFF,
479
473
"Governance: epoch-voting-cutoff "
@@ -489,7 +483,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
489
483
require (deltaLQTYVotes <= 0 && deltaLQTYVetos <= 0 , "Must be a withdrawal " );
490
484
}
491
485
}
492
- console.log ("3 " );
493
486
// TODO: CHANGE
494
487
// Can add if active
495
488
// Can remove if inactive
@@ -498,7 +491,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
498
491
499
492
500
493
(, InitiativeState memory initiativeState ) = _snapshotVotesForInitiative (initiative);
501
- console.log ("4 " );
502
494
503
495
// deep copy of the initiative's state before the allocation
504
496
InitiativeState memory prevInitiativeState = InitiativeState (
@@ -510,35 +502,29 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
510
502
initiativeState.lastEpochClaim
511
503
);
512
504
513
- console.log ("add(initiativeState.voteLQTY, deltaLQTYVotes) " , add (initiativeState.voteLQTY, deltaLQTYVotes));
514
505
// update the average staking timestamp for the initiative based on the user's average staking timestamp
515
506
initiativeState.averageStakingTimestampVoteLQTY = _calculateAverageTimestamp (
516
507
initiativeState.averageStakingTimestampVoteLQTY,
517
508
userState.averageStakingTimestamp,
518
509
initiativeState.voteLQTY,
519
510
add (initiativeState.voteLQTY, deltaLQTYVotes)
520
511
);
521
- console.log ("5 " );
522
512
initiativeState.averageStakingTimestampVetoLQTY = _calculateAverageTimestamp (
523
513
initiativeState.averageStakingTimestampVetoLQTY,
524
514
userState.averageStakingTimestamp,
525
515
initiativeState.vetoLQTY,
526
516
add (initiativeState.vetoLQTY, deltaLQTYVetos)
527
517
);
528
- console.log ("6 " );
529
518
530
519
// allocate the voting and vetoing LQTY to the initiative
531
520
initiativeState.voteLQTY = add (initiativeState.voteLQTY, deltaLQTYVotes);
532
521
initiativeState.vetoLQTY = add (initiativeState.vetoLQTY, deltaLQTYVetos);
533
522
534
- console.log ("7 " );
535
-
536
523
// determine if the initiative's allocated voting LQTY should be included in the vote count
537
524
uint240 votesForInitiative =
538
525
lqtyToVotes (initiativeState.voteLQTY, block .timestamp , initiativeState.averageStakingTimestampVoteLQTY);
539
526
initiativeState.counted = (votesForInitiative >= votingThreshold) ? 1 : 0 ;
540
527
541
- console.log ("8 " );
542
528
// update the initiative's state
543
529
initiativeStates[initiative] = initiativeState;
544
530
@@ -562,24 +548,14 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, IGovernance
562
548
state.countedVoteLQTY += initiativeState.voteLQTY;
563
549
}
564
550
565
- console.log ("9 " );
566
551
567
552
// allocate the voting and vetoing LQTY to the initiative
568
- console.log ("B4 lqtyAllocatedByUserToInitiative[msg.sender][initiative] " , lqtyAllocatedByUserToInitiative[msg .sender ][initiative].voteLQTY);
569
553
Allocation memory allocation = lqtyAllocatedByUserToInitiative[msg .sender ][initiative];
570
- console.log ("allocation.voteLQTY " , allocation.voteLQTY);
571
- console.log ("deltaLQTYVotes " , uint256 (int256 (deltaLQTYVotes)));
572
554
allocation.voteLQTY = add (allocation.voteLQTY, deltaLQTYVotes);
573
- console.log ("allocation.voteLQTY " , allocation.voteLQTY);
574
555
allocation.vetoLQTY = add (allocation.vetoLQTY, deltaLQTYVetos);
575
- console.log ("allocation.vetoLQTY " , allocation.vetoLQTY);
576
556
allocation.atEpoch = currentEpoch;
577
- console.log ("allocation.atEpoch " , allocation.atEpoch);
578
557
require (! (allocation.voteLQTY != 0 && allocation.vetoLQTY != 0 ), "Governance: vote-and-veto " );
579
558
lqtyAllocatedByUserToInitiative[msg .sender ][initiative] = allocation;
580
- console.log ("After lqtyAllocatedByUserToInitiative[msg.sender][initiative] " , lqtyAllocatedByUserToInitiative[msg .sender ][initiative].voteLQTY);
581
-
582
- console.log ("10 " );
583
559
584
560
userState.allocatedLQTY = add (userState.allocatedLQTY, deltaLQTYVotes + deltaLQTYVetos);
585
561
0 commit comments