Skip to content

Commit

Permalink
Prevent new Flywheel Rewards contracts from being the zero addr
Browse files Browse the repository at this point in the history
  • Loading branch information
kphed committed Nov 13, 2023
1 parent 4875d5a commit ebb7d36
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/FlywheelCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ contract FlywheelCore is Auth {
/// @notice optional booster module for calculating virtual balances on strategies
IFlywheelBooster public flywheelBooster;

error InvalidAddress();

constructor(
ERC20 _rewardToken,
IFlywheelRewards _flywheelRewards,
Expand Down Expand Up @@ -163,6 +165,7 @@ contract FlywheelCore is Auth {

/// @notice swap out the flywheel rewards contract
function setFlywheelRewards(IFlywheelRewards newFlywheelRewards) external requiresAuth {
if (address(newFlywheelRewards) == address(0)) revert InvalidAddress();
if (address(flywheelRewards) != address(0)) {
uint256 oldRewardBalance = rewardToken.balanceOf(address(flywheelRewards));

Expand Down

0 comments on commit ebb7d36

Please sign in to comment.