Skip to content

Commit

Permalink
change transfer to call
Browse files Browse the repository at this point in the history
  • Loading branch information
ququzone committed Mar 25, 2024
1 parent 6033864 commit c807ea2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions contracts/RewardsDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ contract RewardsDistributor is IRewardsDistributor, ReentrancyGuard {
(_timestamp >= _locked.end && !_locked.isPermanent)
) {
address _owner = ve.ownerOf(_tokenId);
payable(_owner).transfer(amount);
(bool success, ) = payable(_owner).call{value: amount}("");
require(success, "transfer rewards failed.");
} else {
ve.depositFor{value: amount}(_tokenId, amount);
}
Expand Down Expand Up @@ -175,7 +176,8 @@ contract RewardsDistributor is IRewardsDistributor, ReentrancyGuard {
(_timestamp >= _locked.end && !_locked.isPermanent)
) {
address _owner = ve.ownerOf(_tokenId);
payable(_owner).transfer(amount);
(bool success, ) = payable(_owner).call{value: amount}("");
require(success, "transfer rewards failed.");
} else {
ve.depositFor{value: amount}(_tokenId, amount);
}
Expand Down
3 changes: 2 additions & 1 deletion contracts/gauges/Gauge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ contract Gauge is IGauge, ERC2771Context, ReentrancyGuard {
uint256 reward = rewards[_account];
if (reward > 0) {
rewards[_account] = 0;
payable(_account).transfer(reward);
(bool success, ) = payable(_account).call{value: reward}("");
require(success, "transfer rewards failed.");
emit ClaimRewards(_account, reward);
}
}
Expand Down
Loading

0 comments on commit c807ea2

Please sign in to comment.