Skip to content

Commit

Permalink
use safeTransfer when rescuing tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrai committed Dec 11, 2024
1 parent 4285edb commit 8df901f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nouns-contracts/contracts/StreamEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ pragma solidity ^0.8.19;
import { IStreamEscrow } from './interfaces/IStreamEscrow.sol';
import { INounsToken } from './interfaces/INounsToken.sol';
import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import { SafeERC20 } from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';

contract StreamEscrow is IStreamEscrow {
using SafeERC20 for IERC20;

modifier onlyDAO() {
require(msg.sender == daoExecutor, 'only dao');
_;
Expand Down Expand Up @@ -312,7 +315,7 @@ contract StreamEscrow is IStreamEscrow {
* @param amount The amount of tokens to rescue.
*/
function rescueToken(address token, address to, uint256 amount) external onlyDAO {
IERC20(token).transfer(to, amount);
IERC20(token).safeTransfer(to, amount);
}

/**
Expand Down

0 comments on commit 8df901f

Please sign in to comment.