Skip to content

Commit

Permalink
fix: make sure _veToken isn't zero
Browse files Browse the repository at this point in the history
  • Loading branch information
pandadefi committed Mar 26, 2022
1 parent 4c619f1 commit eb44ee4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions contracts/Gauge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ contract Gauge is BaseGauge, IGauge {
);
}

function setVe(address _ve) external onlyOwner {
veToken = _ve;
emit UpdatedVeToken(_ve);
function setVe(address _veToken) external onlyOwner {
require(address(_veToken) != address(0x0), "_veToken 0x0 address");
veToken = _veToken;
emit UpdatedVeToken(_veToken);
}

/** @return total of the staked vault token
Expand Down
8 changes: 5 additions & 3 deletions contracts/VeYfiRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ contract VeYfiRewards is BaseGauge {
address _owner
) {
__initialize(_rewardToken, _owner);
require(address(_veToken) != address(0x0), "_veToken 0x0 address");
veToken = _veToken;
}

function setVe(address _ve) external onlyOwner {
veToken = _ve;
emit UpdatedVeToken(_ve);
function setVe(address _veToken) external onlyOwner {
require(address(_veToken) != address(0x0), "_veToken 0x0 address");
veToken = _veToken;
emit UpdatedVeToken(_veToken);
}

function _updateReward(address account) internal override {
Expand Down

0 comments on commit eb44ee4

Please sign in to comment.