Merge branch 'main' into router/tnl/reset-transient-storage

This commit is contained in:
Tamara
2025-04-28 09:32:35 -04:00
committed by GitHub
6 changed files with 22 additions and 10 deletions

View File

@@ -1,3 +1,15 @@
## [0.83.0](https://github.com/propeller-heads/tycho-execution/compare/0.82.1...0.83.0) (2025-04-28)
### Features
* Add security check for callback selector ([4de1d10](https://github.com/propeller-heads/tycho-execution/commit/4de1d104062d4aefbde22031d9f31884be5d49ad))
### Bug Fixes
* Remove tload from executor ([3fb17c7](https://github.com/propeller-heads/tycho-execution/commit/3fb17c71da192463b0c6b15dea9a2bae47832ef5))
## [0.82.1](https://github.com/propeller-heads/tycho-execution/compare/0.82.0...0.82.1) (2025-04-24) ## [0.82.1](https://github.com/propeller-heads/tycho-execution/compare/0.82.0...0.82.1) (2025-04-24)

2
Cargo.lock generated
View File

@@ -4454,7 +4454,7 @@ dependencies = [
[[package]] [[package]]
name = "tycho-execution" name = "tycho-execution"
version = "0.82.1" version = "0.83.0"
dependencies = [ dependencies = [
"alloy", "alloy",
"alloy-primitives", "alloy-primitives",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "tycho-execution" name = "tycho-execution"
version = "0.82.1" version = "0.83.0"
edition = "2021" edition = "2021"
description = "Provides tools for encoding and executing swaps against Tycho router and protocol executors." description = "Provides tools for encoding and executing swaps against Tycho router and protocol executors."
repository = "https://github.com/propeller-heads/tycho-execution" repository = "https://github.com/propeller-heads/tycho-execution"

View File

@@ -57,7 +57,7 @@ contract Dispatcher {
* protocol-specific data required by the executor. * protocol-specific data required by the executor.
*/ */
// slither-disable-next-line delegatecall-loop,assembly // slither-disable-next-line delegatecall-loop,assembly
function _callExecutor( function _callSwapOnExecutor(
address executor, address executor,
uint256 amount, uint256 amount,
bytes calldata data bytes calldata data
@@ -94,7 +94,7 @@ contract Dispatcher {
} }
// slither-disable-next-line assembly // slither-disable-next-line assembly
function _handleCallback(bytes calldata data) function _callHandleCallbackOnExecutor(bytes calldata data)
internal internal
returns (bytes memory) returns (bytes memory)
{ {

View File

@@ -482,7 +482,7 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
swap_.decodeSingleSwap(); swap_.decodeSingleSwap();
uint256 initialBalanceTokenOut = _balanceOf(tokenOut, receiver); uint256 initialBalanceTokenOut = _balanceOf(tokenOut, receiver);
amountOut = _callExecutor(executor, amountIn, protocolData); amountOut = _callSwapOnExecutor(executor, amountIn, protocolData);
if (amountOut < minAmountOut) { if (amountOut < minAmountOut) {
revert TychoRouter__NegativeSlippage(amountOut, minAmountOut); revert TychoRouter__NegativeSlippage(amountOut, minAmountOut);
@@ -616,7 +616,7 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
: remainingAmounts[tokenInIndex]; : remainingAmounts[tokenInIndex];
currentAmountOut = currentAmountOut =
_callExecutor(executor, currentAmountIn, protocolData); _callSwapOnExecutor(executor, currentAmountIn, protocolData);
// Checks if the output token is the same as the input token // Checks if the output token is the same as the input token
if (tokenOutIndex == 0) { if (tokenOutIndex == 0) {
cyclicSwapAmountOut += currentAmountOut; cyclicSwapAmountOut += currentAmountOut;
@@ -650,7 +650,7 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
swap.decodeSingleSwap(); swap.decodeSingleSwap();
calculatedAmount = calculatedAmount =
_callExecutor(executor, calculatedAmount, protocolData); _callSwapOnExecutor(executor, calculatedAmount, protocolData);
} }
} }
@@ -658,7 +658,7 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
* @dev We use the fallback function to allow flexibility on callback. * @dev We use the fallback function to allow flexibility on callback.
*/ */
fallback() external { fallback() external {
bytes memory result = _handleCallback(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 calculatedAmount
@@ -786,7 +786,7 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
returns (bytes memory) returns (bytes memory)
{ {
if (data.length < 24) revert TychoRouter__InvalidDataLength(); if (data.length < 24) revert TychoRouter__InvalidDataLength();
bytes memory result = _handleCallback(data); bytes memory result = _callHandleCallbackOnExecutor(data);
return result; return result;
} }

View File

@@ -10,7 +10,7 @@ contract DispatcherExposed is Dispatcher {
uint256 amount, uint256 amount,
bytes calldata data bytes calldata data
) external returns (uint256 calculatedAmount) { ) external returns (uint256 calculatedAmount) {
return _callExecutor(executor, amount, data); return _callSwapOnExecutor(executor, amount, data);
} }
function exposedSetExecutor(address target) external { function exposedSetExecutor(address target) external {