Conversation
McOso
reviewed
Apr 3, 2026
| * @param _amount The amount of tokens to recover | ||
| * @param _recipient The address to receive the recovered tokens | ||
| */ | ||
| function withdrawEmergency(IERC20 _token, uint256 _amount, address _recipient) external onlyOwner { |
Member
There was a problem hiding this comment.
hmm im thinking we get rid of this function. It doesnt seem possible for tokens to be left in this contract without the tx reverting, since it's atomic. If we remove, it really makes the adapter clean and lightweight, removes the need for owner / state.
Member
Author
There was a problem hiding this comment.
This is in case of someone sending tokens directly to the contract (mistaking it for EOA).
hanzel98
reviewed
Apr 4, 2026
hanzel98
reviewed
Apr 4, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit adb6c64. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What?
VedaAdapter.sol— a new adapter contract for delegation-based deposits and withdrawals on Veda BoringVaultIVedaTeller.sol— minimal interface for Veda's TellerWithMultiAssetSupportVedaLending.t.sol— comprehensive test suite (fork tests, happy paths, input validation, events, batch operations, edge cases, 3-level delegation chain, terms validation, replay prevention, slippage protection, alternative delegator)BatchDepositExecutedandBatchWithdrawExecutedevents for off-chain indexing of batch operationsWhy?
How?
DelegationMetaSwapAdapter_parseERC20TransferTermshelper, which validates that terms are at least 52 bytes (ERC20TransferAmountEnforcer format) before reading with assemblyteller.deposit()to mint shares directly to the root delegatorteller.withdraw()to burn shares and send the desired underlying output asset to the root delegator. The output token is passed as a function parameter (distinct from the vault share token in the caveat)depositByDelegationBatch/withdrawByDelegationBatch, each emitting a batch-level event alongside per-streamDepositExecuted/WithdrawExecutedeventswithdrawEmergency(owner-only) for recovering tokens accidentally sent to the contractNote
Note
High Risk
High risk because this introduces new onchain logic that redeems delegations to move ERC20s/vault shares and sets unlimited token allowances to an external vault, making correctness of caveat parsing and redemption flows security-critical.
Overview
Implements a new
VedaAdapterhelper contract that lets an operator execute delegation-redeemed deposits and withdrawals into Veda’s BoringVault viaIVedaTeller, including per-call events plusdepositByDelegationBatch/withdrawByDelegationBatchbatch execution and an owner-onlywithdrawEmergencytoken recovery path.Adds a Forge deployment script (
DeployVedaAdapter.s.sol), a large Arbitrum-fork integration test suite (VedaLending.t.sol) covering happy paths, validation/reverts, batch behavior, replay/slippage checks, and updates CI/env examples to include the Veda addresses and Arbitrum RPC secrets needed to run the new forked tests.Reviewed by Cursor Bugbot for commit aba8aa5. Bugbot is set up for automated code reviews on this repo. Configure here.