Skip to content

Commit

Permalink
rule out rollup zero transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
godzillaba committed Sep 17, 2024
1 parent 502323e commit 265385f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rollup/RollupUserLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
}
Expand Down

0 comments on commit 265385f

Please sign in to comment.