Skip to content

Commit

Permalink
Merge pull request #83 from propeller-heads/router/dc/ENG-4260-improv…
Browse files Browse the repository at this point in the history
…e-receive

fix: Restrict receive callers to have code
  • Loading branch information
dianacarvalho1 authored Feb 26, 2025
2 parents 614af9a + 6008d5e commit 0b7e5a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion foundry/src/TychoRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,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.
Expand Down

0 comments on commit 0b7e5a7

Please sign in to comment.