Skip to content

chore: Implement VedaAdapter#166

Open
MoMannn wants to merge 1 commit intomainfrom
chore-veda-adapter
Open

chore: Implement VedaAdapter#166
MoMannn wants to merge 1 commit intomainfrom
chore-veda-adapter

Conversation

@MoMannn
Copy link
Member

@MoMannn MoMannn commented Mar 2, 2026

What?

  • Adds VedaAdapter.sol — a new adapter contract for delegation-based deposits and withdrawals on Veda BoringVault
  • Adds IVedaTeller.sol — minimal interface for Veda's TellerWithMultiAssetSupport
  • Adds VedaLending.t.sol — comprehensive test suite (fork tests, happy paths, input validation, events, batch operations, edge cases, 3-level delegation chain)

Why?

  • Enables users to deposit into and withdraw from Veda BoringVaults through the delegation framework, without requiring direct token approvals
  • Allows operators to execute vault operations on behalf of users via the redelegation pattern, with fine-grained control over tokens, amounts, and who can redeem

How?

  • Uses the redelegation pattern (user → operator → adapter) consistent with DelegationMetaSwapAdapter
  • On deposit: redeems the delegation chain to transfer tokens to the adapter, approves the BoringVault, and calls teller.bulkDeposit() to mint shares directly to the root delegator
  • On withdraw: redeems the delegation chain to transfer vault shares to the adapter, then calls teller.withdraw() to burn shares and send underlying assets to the root delegator
  • Supports batched operations via depositByDelegationBatch / withdrawByDelegationBatch
  • Includes withdrawEmergency (owner-only) for recovering tokens accidentally sent to the contract

Note

  • Tests run against a forked Ink mainnet — add INK_RPC_URL=https://ink.drpc.org to your .env
  • Tests are failing in CI because env is not set

Note

Medium Risk
Adds a new on-chain adapter that redeems delegations to move ERC20s/vault shares and manage approvals before calling into an external Teller/Vault, so bugs could directly impact user funds despite extensive fork-based tests.

Overview
Adds a new VedaAdapter contract that redeems delegation chains to execute Veda BoringVault deposits (token transfer → bulkDeposit minting shares to the root delegator) and withdrawals (share transfer → withdraw sending assets to the root delegator), including batch variants and an owner-only withdrawEmergency token recovery path.

Introduces IVedaTeller as a minimal interface for the required Teller entrypoints and adds VedaLending.t.sol fork tests covering happy paths, input validation/reverts, event emission, batching, allowance behavior, and multi-level delegation-chain resolution.

Written by Cursor Bugbot for commit 686b3b5. This will update automatically on new commits. Configure here.

@MoMannn MoMannn requested a review from a team as a code owner March 2, 2026 10:34
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant