From 801976fafab6d28395f738ba7971e927a3743e9d Mon Sep 17 00:00:00 2001 From: Diana Carvalho Date: Tue, 25 Feb 2025 09:36:04 +0000 Subject: [PATCH] fix: Restrict receive callers to have code --- don't change below this line --- ENG-4260 Took 8 minutes --- foundry/src/TychoRouter.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/foundry/src/TychoRouter.sol b/foundry/src/TychoRouter.sol index e4c5fd5..50f7f1e 100644 --- a/foundry/src/TychoRouter.sol +++ b/foundry/src/TychoRouter.sol @@ -432,7 +432,9 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard { /** * @dev Allows this contract to receive native token */ - receive() external payable {} + receive() external payable { + require(msg.sender.code.length != 0); + } /** * @dev Called by UniswapV3 pool when swapping on it.