From 265385fb7141cdecb8ddd115b841caa57e642fda Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:35:23 -0400 Subject: [PATCH] rule out rollup zero transfers --- src/rollup/RollupUserLogic.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rollup/RollupUserLogic.sol b/src/rollup/RollupUserLogic.sol index c99a1a7e..95df077b 100644 --- a/src/rollup/RollupUserLogic.sol +++ b/src/rollup/RollupUserLogic.sol @@ -780,13 +780,13 @@ contract ERC20RollupUserLogic is AbsRollupUserLogic, IRollupUserERC20 { { uint256 amount = withdrawFunds(msg.sender); // This is safe because it occurs after all checks and effects - require(IERC20Upgradeable(stakeToken).transfer(msg.sender, amount), "TRANSFER_FAILED"); // note: potential zero transfer + require(IERC20Upgradeable(stakeToken).transfer(msg.sender, amount), "TRANSFER_FAILED"); return amount; } function receiveTokens(uint256 tokenAmount) private { require( - IERC20Upgradeable(stakeToken).transferFrom(msg.sender, address(this), tokenAmount), // note: potential zero transfer + IERC20Upgradeable(stakeToken).transferFrom(msg.sender, address(this), tokenAmount), "TRANSFER_FAIL" ); }