Skip to content

fix(defindex-adapter): authorize deposit and withdraw auth - #1173

Merged
collinsezedike merged 2 commits into
drydocs:mainfrom
ibochivincent-lang:fix/1128-defindex-adapter-auth
Oct 25, 2026
Merged

collinsezedike merged 2 commits into
drydocs:mainfrom
ibochivincent-lang:fix/1128-defindex-adapter-auth

Conversation

@ibochivincent-lang

@ibochivincent-lang ibochivincent-lang commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Pre-authorizes the DeFindex vault's nested token movements in both adapter directions with env.authorize_as_current_contract.
  • Deposit authorizes the vault's usdc.transfer(adapter, dfx, amount) pull.
  • Withdraw authorizes the DeFindex vault's withdraw burn of the adapter's dfTokens.
  • Adds deposit and withdraw auth-tree tests that run without mock_all_auths_allowing_non_root_auth.

Closes #1128

@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

@ibochivincent-lang is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@ibochivincent-lang Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This fixes the deposit path only. #1128 also requires the withdraw burn path to register the nested token authorization, with a test that exercises it. Please add the withdraw fix and a withdraw auth-tree test. The Soroban job also fails on cargo fmt --check, so run cargo fmt --all.

let min_amount = min_after_slippage(amount).unwrap_or_else(|e| panic_with_error!(&env, e));

let usdc = get_usdc(&env);
env.authorize_as_current_contract(vec![

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This covers deposit. The withdraw path at lib.rs:243 still calls DeFindex's withdraw without the equivalent nested authorization, and no withdraw auth-tree test exercises it.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ibochivincent-lang thank you for the update. The withdraw authorization and auth-tree coverage are in place and all required checks pass. Please consider picking up another open issue.

@collinsezedike collinsezedike changed the title fix(defindex-adapter): authorize nested token pull in deposit fix(defindex-adapter): authorize deposit and withdraw auth Oct 25, 2026
@collinsezedike
collinsezedike merged commit 0914431 into drydocs:main Oct 25, 2026
14 checks passed
@collinsezedike

Copy link
Copy Markdown
Collaborator

Thank you for the contribution, @ibochivincent-lang; if the project is useful to you, starring the repository would help it reach more people.

This branch was successfully deployed

1 active deployment
Preview — a4229964 Deployed Oct 25, 2026 by vercel[bot]
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.

[Bug] DefindexAdapter does not authorize the token pull DeFindex makes from it

2 participants