585 Commits

Author SHA1 Message Date
pedrobergamini
7cf3f268c1 chore: improve test harness 2025-06-23 12:46:41 -03:00
Diana Carvalho
1d952b19be fix: After rebase fixes
Took 5 minutes
2025-06-23 15:50:45 +01:00
Diana Carvalho
93678d9d19 feat(univ4): Pass user_data as hook_data in execution
Because we don't know the size of hook data, it needs to be at the end of the protocol data. But we also don't know the size of the intermediary swaps. To solve this, we are now ple encoding the intermediary swaps and only then appending the hook data

Took 2 hours 50 minutes

Took 40 seconds
2025-06-23 15:44:26 +01:00
Diana Carvalho
a0581773cd feat: Support hooks (without special calldata)
Add hook address to encoded data and then use it in execution
Add execution test for Euler

Took 1 hour 19 minutes

Took 2 hours 40 minutes

Took 3 minutes


Took 2 minutes
2025-06-23 15:44:26 +01:00
Diana Carvalho
df63b87569 fix: Add optimized_transfers_integration_tests.rs
I forgot these tests in the previous PR

Took 24 minutes
2025-06-23 15:34:11 +01:00
Diana Carvalho
1d263f8b4c fix: After rebase fixes
Took 6 minutes
2025-06-23 15:02:21 +01:00
Diana Carvalho
e09789f347 test: Refactor tests
- Move encoding integration tests to integration test folder (in the rust project)
- Move protocol integration tests be inside the protocol file. This way we can change the block without any problems and it is easier for integrators

Took 6 minutes

Took 6 minutes


Took 17 minutes
2025-06-23 15:02:20 +01:00
pedrobergamini
f0e2d04cc9 chore: test _getActualFilledTakerAmount edge cases 2025-06-18 14:51:59 -03:00
pedrobergamini
4c7f33d81b chore: fix _getActualFilledTakerAmount return value 2025-06-18 13:08:50 -03:00
die-herdplatte
b331a43392 forge fmt 2025-06-18 16:22:34 +02:00
pedrobergamini
033a4bfe9f chore: fix slither info warning 2025-06-17 23:30:48 -03:00
pedrobergamini
90ac0a4c98 test: fix all aggregate order tests and a few executor bugs 2025-06-17 23:27:03 -03:00
pedrobergamini
a777ab6adc test: update generated calldata.txt 2025-06-17 21:40:13 -03:00
die-herdplatte
72553bf98d Fix slither issues 2025-06-17 11:34:31 +02:00
die-herdplatte
58ce241c63 Add support for Ekubo MEV-resist extension 2025-06-17 11:02:37 +02:00
pedrobergamini
5418846619 chore: refactor Aggregate orders, fix Single orders integration tests and calldata generation 2025-06-16 23:08:54 -03:00
pedrobergamini
5d33a8ebca test: refactor Bebop tests for simplified order types 2025-06-16 15:34:05 -03:00
pedrobergamini
8259cefad9 test: add BebopSettlementMock and update test setup 2025-06-16 15:33:07 -03:00
pedrobergamini
d527479037 refactor: simplify BebopExecutor by removing Multi order type, improve settlement flow 2025-06-16 15:32:07 -03:00
pedrobergamini
8a82dbfe34 chore: test multi and aggregate orders, support all signature types available 2025-06-08 02:58:52 -03:00
pedrobergamini
0106c5c425 chore: move BebopOrderType to models.rs 2025-06-08 01:01:51 -03:00
pedrobergamini
71a8401670 chore: address merge conflicts, implement user_data for Bebop 2025-06-08 00:36:23 -03:00
pedrobergamini
68d4d083c3 test: add uniswap v3 => bebop sequential swap 2025-06-07 18:36:01 -03:00
pedrobergamini
2bac529fc1 test: update calldata.txt 2025-06-07 18:07:10 -03:00
pedrobergamini
2124b49a68 test: bebop single encoding integration test 2025-06-07 17:46:08 -03:00
pedrobergamini
5282e2bc83 chore: fix breaking tests and start addressing PR review comments 2025-06-06 19:17:08 -03:00
Diana Carvalho
4f58977007 fix(BalancerV3Executor): Do data.length check at the beginning of swap
Took 16 minutes
2025-06-06 17:24:07 +01:00
Diana Carvalho
941879d5d6 fix(BalancerV3Executor): Slice callback data nicely
Make a stricter data validation

Took 35 minutes
2025-06-06 17:01:48 +01:00
Diana Carvalho
c03df8aa1e feat: Add balancer v3 to transfer optimization constants
Also added a getForkBlock() on TychoRouterTestSetup.
 Moved the router balancer test inside the Balancer file and created a TychoRouterForBalancerV3Test to wrap it

Took 1 hour 10 minutes


Took 21 seconds
2025-06-06 10:41:35 +01:00
Diana Carvalho
269e328b5f feat: Add integration tests for balancer v3
Refactor BalancerV3Executor to have an inner _swapCallback method with the real swapping logic. Then we have two external methods:
- handleCallback: called by the router. Here we need to remove the first 68 bytes (4 selector + 32 dataOffset + 32 dataLength)
- swapCallback: called by the Vault directly if we are swapping against the executor directly (no router involved)

Took 1 minute
2025-06-05 17:22:17 +01:00
Diana Carvalho
806ce4e62c feat: Make BalancerV3Executor inherit from ICallback
Took 37 minutes
2025-06-05 14:59:22 +01:00
Diana Carvalho
f173f9bed7 feat: Add balancer-v3-monorepo lib
Took 6 minutes
2025-06-05 14:59:22 +01:00
Diana Carvalho
f34db52f09 feat: Implement BalancerV3Executor
Took 2 hours 32 minutes


Took 8 seconds

Took 13 minutes
2025-06-05 14:59:22 +01:00
pedrobergamini
17e535494b fix: cargo and forge fmt 2025-06-04 19:57:40 -03:00
pedrobergamini
ad0a9991da feat: support multi and aggregate orders 2025-06-04 19:41:13 -03:00
pedrobergamini
946c4391e8 fix: SafeCast => V4SafeCast to fix build issue 2025-06-04 19:13:13 -03:00
pedrobergamini
6f80137117 test: add single, split and sequential scenarios 2025-06-04 19:12:56 -03:00
pedrobergamini
af0f4c454e chore: implement correct native ETH support 2025-06-04 19:12:07 -03:00
pedrobergamini
7e7e3f0e01 feat: implement encoder and executor with single order support 2025-06-04 17:57:09 -03:00
TAMARA LIPOWSKI
6ea9c3708e chore: remove tenderly roles
- For organization
2025-05-27 13:12:13 -04:00
Diana Carvalho
9356e87d3a Merge remote-tracking branch 'origin/router/tnl/fix-deployment' into router/tnl/fix-deployment
# Conflicts:
#	config/router_addresses.json

Took 15 seconds
2025-05-27 16:01:46 +01:00
Diana Carvalho
0dafed0cad feat: Deploy new router on base
Took 33 minutes
2025-05-27 16:01:30 +01:00
TAMARA LIPOWSKI
e2e061e73e feat: Update unichain executors + router addrs
Deployed gas optimization
2025-05-27 10:55:48 -04:00
Diana Carvalho
c0805b107f Merge branch 'refs/heads/main' into router/tnl/fix-deployment 2025-05-27 15:33:20 +01:00
Diana Carvalho
4f85e3e88e chore: Move tests from strategy_encoders to tycho_encoders
Most of these tests were actually integration tests, so they should be in the outer level of the package.

Took 1 hour 5 minutes
2025-05-26 17:08:44 +01:00
Diana Carvalho
c62af2f232 feat: Don't sign permit2 objects
We don't want to be responsible for holding private keys -> the user is the one that should do this outside of tycho-execution

Done:
- Remove signature from EncodedSolution
- Introduce UserTransferType and pass that everywhere instead of is_permit2_active and token_in_already_in_router
- Remove signing from permit2. Added it to the encoding_utils.rs only
- Mark encode_full_calldata as deprecated
- Backwards compatibility: still accept a signer for the encode_full_calldata case
- Update all tests

Took 2 hours 10 minutes


Took 13 minutes
2025-05-26 12:50:11 +01:00
Diana Carvalho
75f2c3a1c5 feat: Create non alloy specific Permit and PermitDetails structs
- Add try_from methods to convert them to the corresponding Solidity representations
- Update tests

Took 56 seconds
2025-05-23 11:31:05 +01:00
Diana Carvalho
88ad67e5ff Merge branch 'refs/heads/main' into router/tnl/fix-deployment 2025-05-22 15:35:49 +01:00
Diana Carvalho
4e8c6ddc8c feat: Separate encoding swaps from encoding txs
This way the user is responsible for encoding the Tycho Router method inputs that are used as guardrails in execution.

Interface changes:
- Create EncodedSolution
- StrategyEncoder
  - don't need to know have permit2 or token_in_already_in_router as attributes anymore
  - encode_strategy returns EncodedSolution now (no method encoding done here now)
- TychoEncoder
  - add encode_solution() method. This is the recommended method for users
  - needs to have permit2, token_in_already_in_router and router_address as attributes
  - permit creation is made in the router now

Also:
- create encoding_utils.rs
- update all tests

Took 2 hours 42 minutes


Took 3 minutes

Took 13 minutes
2025-05-22 14:43:12 +01:00
Diana Carvalho
1f26fbce14 fix: Small misc improvements from audit
- In RestrictTransferFrom:
  - Compare tokenIn with tokenIn from storage
  - Correct docstrings
  - Recompute storage slots with new names
  - Rename transferFromNeeded to isTransferFromAllowed
  - Don't track amount spent but subtract from amount allowed
- In TychoRouter: Rename transferFromNeeded to isTransferFromAllowed

Took 32 minutes
2025-05-22 10:52:00 +01:00