Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
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
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
Introduces a new adapter that can move user tokens/shares via
redeemDelegationsand grants (potentially unlimited) ERC20 allowances to the VedaboringVault, so any mistake in delegation/caveat assumptions could lead to fund loss. Also adds mainnet-fork tests and CI env changes that may be flaky due to external RPC dependencies.Overview
Adds
VedaAdapter, anOwnable2Stephelper that executes delegation-based deposits and withdrawals against Veda’s Teller/BoringVault by redeeming a delegation chain, parsing the token+amount from the leaf caveat terms, and then callingteller.deposit/teller.withdraw(plus a batch variant for each).The adapter includes batch-level events (
BatchDepositExecuted,BatchWithdrawExecuted), per-call events, basic input/terms validation, a lazy “approve max” allowance strategy for deposits, and an owner-onlywithdrawEmergencyfor recovering stuck tokens.Adds
IVedaTeller, aDeployVedaAdapterfoundry script, and a large Arbitrum mainnet-fork test suite covering happy paths, reverts, replay protection assumptions, batching, and emergency withdrawal; CI and.env.exampleare updated to include Arbitrum/RPC secrets and Veda deployment addresses.Reviewed by Cursor Bugbot for commit 01be197. Bugbot is set up for automated code reviews on this repo. Configure here.