Commit Graph

1088 Commits

Author SHA1 Message Date
TAMARA LIPOWSKI
ec702a0c7f chore: Uncomment executor deployment 2025-05-21 12:11:36 -04:00
semantic-release-bot
66ec935d49 chore(release): 0.92.0 [skip ci]
## [0.92.0](https://github.com/propeller-heads/tycho-execution/compare/0.91.0...0.92.0) (2025-05-21)

### Features

* Add transferFromNeeded to non permit2 methods ([cc9e88c](cc9e88cfed))
* Bring back TransferType and simplify encoding logic ([3874892](38748925b3))
* Loosen version constrain on tycho-common ([046775b](046775b7ae))
* perform all transfers in executors ([eeebd51](eeebd51114))
* Sketch for OneTransferFromOnly.sol ([9401ce2](9401ce2620))
* Support new transfer logic in all executors ([27dfde3](27dfde3118))
* Support new transfer logic in encoding ([0f9af65](0f9af65846))

### Bug Fixes

* Fix remaining tests after latest encoding changes ([e0c195f](e0c195f63d))
* Fix tests (not there yet) ([d4244a7](d4244a7089))
* Initial balance for cyclic swaps ([7fd9f61](7fd9f611e5))
* Make all tests pass! ([ee68703](ee687038c5))
2025-05-21 14:59:04 +00:00
dianacarvalho1
3d93cce1e9 Merge pull request #198 from propeller-heads/audit/dc/one-transfer-from-only
feat: Restrict transferFrom
2025-05-21 15:57:16 +01:00
Diana Carvalho
b540f83742 Merge branch 'refs/heads/main' into audit/dc/one-transfer-from-only
# Conflicts:
#	foundry/test/assets/calldata.txt

Took 33 minutes
2025-05-21 09:50:20 +01:00
semantic-release-bot
29374e4420 chore(release): 0.91.0 [skip ci]
## [0.91.0](https://github.com/propeller-heads/tycho-execution/compare/0.90.0...0.91.0) (2025-05-19)

### Features

* **curve:** Get coin indexes from static attributes ([fcaacf2](fcaacf21fb))
2025-05-19 16:00:18 +00:00
dianacarvalho1
c96149d3b9 Merge pull request #202 from propeller-heads/encoding/dc/ENG-4426-improve-curve
feat(curve): Get coin indexes from static attributes
2025-05-19 16:58:12 +01:00
Diana Carvalho
fcaacf21fb feat(curve): Get coin indexes from static attributes
This way we don't need extra RPC calls to get these values

Took 57 minutes
2025-05-19 13:29:18 +01:00
Diana Carvalho
cc9e88cfed feat: Add transferFromNeeded to non permit2 methods
This will block an attempt to transfer from the user when we expect the funds to already be in the router.

chores:
- add docs
- in EncodingContext, rename transfer to transfer_type

Took 58 minutes
2025-05-19 12:02:57 +01:00
TAMARA LIPOWSKI
e0c195f63d fix: Fix remaining tests after latest encoding changes 2025-05-16 14:14:21 -04:00
Diana Carvalho
d4244a7089 fix: Fix tests (not there yet)
Took 58 minutes
2025-05-16 17:57:29 +01:00
TAMARA LIPOWSKI
eeebd51114 feat: perform all transfers in executors
For organization (and thus safety) purposes.

Rename to RestrictTransferFrom.sol so that we can perform multiple transfer froms (upto an allowance) in the case of split swaps (where the split is the first swap).

TODO: Fix tests.
2025-05-16 11:59:54 -04:00
Diana Carvalho
38748925b3 feat: Bring back TransferType and simplify encoding logic
Took 1 hour 53 minutes
2025-05-16 16:59:35 +01:00
TAMARA LIPOWSKI
9b59b8b434 Revert "chore: Remove permit2 from executor constructor..."
This reverts commit b0b98c5e5d.
2025-05-16 11:23:43 -04:00
Diana Carvalho
fcd85c047f chore: Misc improvements:
- Don't use payable(receiver).transfer(amount) and use OpenZeppelin's Address.sendValue instead
- In Univ4Executor send funds to the poolManager and not msg.sender
- In OneTransferFromOnly:
  - rename method name
  - don't pass the sender but hardcode it to caller() (msg.sender)
  - Move marking the transfer as done up (before we actually transfer) to prevent reentrancy attacks

Took 18 minutes
2025-05-16 10:49:49 +01:00
Tamara
99d5df4f77 Merge branch 'main' into audit/dc/one-transfer-from-only 2025-05-15 13:47:42 -04:00
TAMARA LIPOWSKI
ec3d04d565 chore: remove author from docs 2025-05-15 13:44:51 -04:00
TAMARA LIPOWSKI
7c26e56a85 test: Ensure revert when attempting two transferFroms 2025-05-15 13:36:34 -04:00
Diana Carvalho
0b5233ead4 chore: Improve docstrings and decode bools always the same way
Took 26 minutes
2025-05-15 18:01:27 +01:00
TAMARA LIPOWSKI
7fd9f611e5 fix: Initial balance for cyclic swaps
This needs to be calculated before we perform a transferFrom in the router! This worked before since we were doing the transferFroms always from inside the executors.
2025-05-15 13:00:03 -04:00
TAMARA LIPOWSKI
d21ae45a49 chore: remove unnecessary sender encoding in USV3 2025-05-15 12:59:04 -04:00
dianacarvalho1
ae4602f668 Merge pull request #193 from propeller-heads/router/dc/ENG-4454-remove-executor-script
chore: Add script to remove executor addresses from Tycho Router
2025-05-15 16:22:52 +01:00
Diana Carvalho
046775b7ae feat: Loosen version constrain on tycho-common
Took 14 minutes
2025-05-15 16:19:31 +01:00
dianacarvalho1
aec512c386 Merge branch 'main' into router/dc/ENG-4454-remove-executor-script 2025-05-15 16:18:33 +01:00
Diana Carvalho
ccde611d81 Merge branch 'refs/heads/main' into audit/dc/one-transfer-from-only 2025-05-15 15:52:55 +01:00
Diana Carvalho
4b2aa36424 Merge branch 'refs/heads/main' into audit/dc/one-transfer-from-only 2025-05-15 15:52:17 +01:00
semantic-release-bot
7f7084ca7a chore(release): 0.90.0 [skip ci]
## [0.90.0](https://github.com/propeller-heads/tycho-execution/compare/0.89.0...0.90.0) (2025-05-15)

### Features

* Explicitly handle the TransferType.NONE case ([65bd0d0](65bd0d0749))
* Verify the amount out was received correctly for arbitrage swaps ([70230bf](70230bf05f))

### Bug Fixes

* Revert if the TransferType is not valid ([b0c254a](b0c254add4))
2025-05-15 14:51:47 +00:00
dianacarvalho1
584559022b Merge pull request #200 from propeller-heads/ci/dc/fix-lint-ci
ci: fix lint ci
2025-05-15 15:49:02 +01:00
Diana Carvalho
2e71a3e0ff ci: fix lint ci
Took 1 minute
2025-05-15 15:44:41 +01:00
Diana Carvalho
e726571114 ci: Update lint CI
Took 8 minutes


Took 5 seconds

Took 11 seconds

Took 11 seconds
2025-05-15 15:23:24 +01:00
TAMARA LIPOWSKI
69c8325a1d chore: OneTransferFromOnly docs + proper slots
Also revert instead of returning if multiple `transferFrom`s are attempted - as this signals that encoding is incorrect or has been messed with.
2025-05-15 10:08:40 -04:00
Diana Carvalho
6cff470999 Merge branch 'refs/heads/main' into audit/dc/one-transfer-from-only
# Conflicts:
#	foundry/src/executors/TokenTransfer.sol

Took 38 seconds
2025-05-15 14:53:18 +01:00
Diana Carvalho
09ff7691f8 chore: Make naming consistent: transfer_needed, approval_needed, etc
Took 46 minutes
2025-05-15 14:52:43 +01:00
TAMARA LIPOWSKI
4a0533b8ea chore: Remove transfer flag from curve + balancer
we will never perform a manual transfer into these protocols, as they require the tokens to be in the router contract in order to perform a transferFrom.
2025-05-15 09:15:32 -04:00
TAMARA LIPOWSKI
b0b98c5e5d chore: Remove permit2 from executor constructor...
whenever not needed.
2025-05-15 08:23:55 -04:00
Diana Carvalho
ee687038c5 fix: Make all tests pass!
Delete TokenTransfer.sol
Make slither happy

Bugfixes:
- Executors
  - Ekubo:
    - Fix the POOL_DATA_OFFSET value and remove sender from callback data
    - Use SafeERC20
  - Maverick and Univ2: Use safeTransfer and not safeTransferFrom
  - Univ3: update expected data length
  - Univ4: update the selectors (the signature changed)
- Router:
  - For split swap we don't need to pass the tokenInReceiver, it should always be the router address
  - For single and sequential: change order of the parameters (to be before the permit2 specific objects)
- Encoders:
  - Update selector signatures
  - For split swap pass the transfer_from (we might not need to if the token in is ETH)

Took 2 hours 51 minutes
2025-05-15 13:11:34 +01:00
TAMARA LIPOWSKI
27dfde3118 feat: Support new transfer logic in all executors
TODO:
- Fix failing tests
- Remove permit2 from initialization of contracts
2025-05-14 20:42:19 -04:00
Diana Carvalho
0f9af65846 feat: Support new transfer logic in encoding
The transfer from the user into the router is supposed to happen in the router (we only support this in the executors for callback constrained protocols). This is necessary because of some security concerns that were found in the audit. This way we reduce the space of attack.
- Refactored TransferOptimization not to handle TransferTypes anymore but just return bools.
- Split get_transfer_type into get_transfers and get_in_between_transfer. Updates tests
- Updated the strategies to use this
- Updated function signatures to pass transfer_from and funds_receiver
- Updated SwapEncoders to handle this
- SplitSwapStrategy just assumes all tokens are sent to and from the router at all times

Took 2 hours 46 minutes
2025-05-14 18:00:19 +01:00
dianacarvalho1
00f201440b Merge pull request #195 from propeller-heads/router/dc/ENG-4529-arbitrage-balance-check
feat: Arbitrage balance check and explicitly handle the TransferType.NONE case
2025-05-14 15:00:00 +01:00
Diana Carvalho
9401ce2620 feat: Sketch for OneTransferFromOnly.sol
Took 49 seconds
2025-05-14 11:22:54 +01:00
Diana Carvalho
b0c254add4 fix: Revert if the TransferType is not valid
Took 8 minutes
2025-05-14 09:03:18 +01:00
Diana Carvalho
65bd0d0749 feat: Explicitly handle the TransferType.NONE case
Took 8 minutes
2025-05-14 09:03:17 +01:00
Diana Carvalho
70230bf05f feat: Verify the amount out was received correctly for arbitrage swaps
Took 25 minutes


Took 3 minutes

Took 23 seconds
2025-05-14 09:03:17 +01:00
semantic-release-bot
67eba8d7d2 chore(release): 0.89.0 [skip ci]
## [0.89.0](https://github.com/propeller-heads/tycho-execution/compare/0.88.0...0.89.0) (2025-05-14)

### Features

* Remove special handling of the Univ4 callback ([f14c8ee](f14c8ee29b))
2025-05-14 07:54:05 +00:00
dianacarvalho1
497c3bc337 Merge pull request #194 from propeller-heads/router/dc/ENG-4515-univ4-callback
feat: Remove special handling of the Univ4 callback
2025-05-14 08:51:24 +01:00
dianacarvalho1
c117cea8e7 Merge branch 'main' into router/dc/ENG-4515-univ4-callback 2025-05-13 17:11:34 +01:00
dianacarvalho1
71379db2c1 Merge pull request #196 from propeller-heads/ci/dc/fix-lint-ci
ci: fix cargo clippy command in CI
2025-05-13 15:02:14 +01:00
Diana Carvalho
37e9d2b712 ci: fix cargo clippy command in CI
Took 7 minutes


Took 4 minutes
2025-05-13 14:56:30 +01:00
Diana Carvalho
444fc2d7b0 docs: Add comment on receive() in CurveExecutor
Took 9 minutes
2025-05-12 10:48:07 +01:00
Diana Carvalho
f14c8ee29b feat: Remove special handling of the Univ4 callback
The problem was that the pool manager was expecting an ABI encoded result to be returned and we were not returning that (we were returning just a result)
Special thanks to Max for figuring this out

Took 31 minutes
2025-05-09 10:48:54 +01:00
dianacarvalho1
fb1737c1f5 Merge pull request #191 from propeller-heads/router/dc/ENG-4492-remove-self-maverick
chore: Remove unused self from MaverickV2Executor
2025-05-08 15:22:11 +01:00