Skip to content

Commit

Permalink
feat: ensure bribeToken != BOLD
Browse files Browse the repository at this point in the history
Fixes #99.
Fixes IR-13.
  • Loading branch information
danielattilasimon committed Dec 6, 2024
1 parent 8709efa commit 7053d1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BribeInitiative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ contract BribeInitiative is IInitiative, IBribeInitiative {
mapping(address => DoubleLinkedList.List) internal lqtyAllocationByUserAtEpoch;

constructor(address _governance, address _bold, address _bribeToken) {
require(_bribeToken != _bold, "BribeInitiative: bribe-token-cannot-be-bold");

governance = IGovernance(_governance);
bold = IERC20(_bold);
bribeToken = IERC20(_bribeToken);
Expand Down
5 changes: 5 additions & 0 deletions test/BribeInitiative.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ contract BribeInitiativeTest is Test, MockStakingV1Deployer {
vm.stopPrank();
}

function test_bribeToken_cannot_be_BOLD() external {
vm.expectRevert("BribeInitiative: bribe-token-cannot-be-bold");
new BribeInitiative({ _governance: address(governance), _bold: address(lusd), _bribeToken: address(lusd) });
}

// test total allocation vote case
function test_totalLQTYAllocatedByEpoch_vote() public {
// staking LQTY into governance for user1 in first epoch
Expand Down

0 comments on commit 7053d1c

Please sign in to comment.