From 8df901fea1c9e2d44ead93af86accf583bd6e7e8 Mon Sep 17 00:00:00 2001 From: davidbrai Date: Wed, 11 Dec 2024 11:53:40 +0000 Subject: [PATCH] use safeTransfer when rescuing tokens --- packages/nouns-contracts/contracts/StreamEscrow.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nouns-contracts/contracts/StreamEscrow.sol b/packages/nouns-contracts/contracts/StreamEscrow.sol index 65f722baa..e183e737d 100644 --- a/packages/nouns-contracts/contracts/StreamEscrow.sol +++ b/packages/nouns-contracts/contracts/StreamEscrow.sol @@ -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'); _; @@ -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); } /**