Skip to content

Commit

Permalink
Add extra safety check to FarmingPool constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
k06a committed Sep 25, 2023
1 parent c320d35 commit 44d7868
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/FarmingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ contract FarmingPool is IFarmingPool, Ownable, ERC20 {
using Address for address payable;
using FarmingLib for FarmingLib.Info;

error SameStakingAndRewardsTokens();
error ZeroStakingTokenAddress();
error ZeroRewardsTokenAddress();
error ZeroDistributorAddress();
Expand Down Expand Up @@ -43,6 +44,7 @@ contract FarmingPool is IFarmingPool, Ownable, ERC20 {
string(abi.encodePacked("farm", stakingToken_.symbol()))
)
{
if (stakingToken_ == rewardsToken_) revert SameStakingAndRewardsTokens();
if (address(stakingToken_) == address(0)) revert ZeroStakingTokenAddress();
if (address(rewardsToken_) == address(0)) revert ZeroRewardsTokenAddress();
stakingToken = stakingToken_;
Expand Down

0 comments on commit 44d7868

Please sign in to comment.