Merge pull request #189 from propeller-heads/router/dc/ENG-4476-generalize-callback-return

feat: Misc audit fixes (callback result and revert condition in _wrapETH)
This commit is contained in:
dianacarvalho1
2025-05-02 15:55:53 +01:00
committed by GitHub
2 changed files with 9 additions and 4 deletions

View File

@@ -13,6 +13,11 @@ For complete documentation, see Tycho docs [here](https://docs.propellerheads.xy
To get started on encoding, have a look at our [Encoding example](examples/encoding-example/README.md). To get started on encoding, have a look at our [Encoding example](examples/encoding-example/README.md).
For a complete example please refer to the [Tycho Quickstart guide](https://docs.propellerheads.xyz/tycho). For a complete example please refer to the [Tycho Quickstart guide](https://docs.propellerheads.xyz/tycho).
## Report a Vulnerability ## Security
All audits of the Tycho Router and Executor contracts can be found [here](docs/audits).
The vulnerabilities discovered during the audits have been acknowledged and addressed or accepted.
### Report a Vulnerability
Contact [security@propellerheads.xyz](mailto:security@propellerheads.xyz) Contact [security@propellerheads.xyz](mailto:security@propellerheads.xyz)

View File

@@ -661,8 +661,8 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
bytes memory result = _callHandleCallbackOnExecutor(msg.data); bytes memory result = _callHandleCallbackOnExecutor(msg.data);
// slither-disable-next-line assembly // slither-disable-next-line assembly
assembly ("memory-safe") { assembly ("memory-safe") {
// Propagate the calculatedAmount // Propagate the result
return(add(result, 32), 16) return(add(result, 32), mload(result))
} }
} }
@@ -757,7 +757,7 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
* @param amount of native ETH to wrap. * @param amount of native ETH to wrap.
*/ */
function _wrapETH(uint256 amount) internal { function _wrapETH(uint256 amount) internal {
if (msg.value > 0 && msg.value != amount) { if (msg.value != amount) {
revert TychoRouter__MessageValueMismatch(msg.value, amount); revert TychoRouter__MessageValueMismatch(msg.value, amount);
} }
_weth.deposit{value: amount}(); _weth.deposit{value: amount}();