Skip to content

fix: wsol edgecase #461

Merged
guibescos merged 15 commits intomainfrom
fix-insufficient-funds
Mar 31, 2025
Merged

fix: wsol edgecase #461
guibescos merged 15 commits intomainfrom
fix-insufficient-funds

Conversation

@guibescos
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
swap-staging ⬜️ Ignored (Inspect) Visit Preview Mar 31, 2025 4:26pm

Comment thread auction-server/src/api.rs
@guibescos guibescos changed the title Fix insufficient funds fix: wsol edgecase Mar 31, 2025
@guibescos guibescos marked this pull request as ready for review March 31, 2025 14:18
Comment thread auction-server/src/auction/service/verification.rs Outdated
token_program_searcher: spl_token::id(),
fee_token,
referral_fee_bps,
user_mint_user_balance: 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how were all these passing previously?

Copy link
Copy Markdown
Contributor Author

@guibescos guibescos Mar 31, 2025

Choose a reason for hiding this comment

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

the user_mint_user_balance wasn't used for anything in verification nor in the sdks before this PR

pubkey::Pubkey,
rent::Rent,
},
spl_token_2022::state::Account as TokenAccount,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems fine since you're using the token 2022 token account (which is greater than 165 bytes, i think). i don't think there's any real edge cases, this seems to be overcompensating for the user in the case that they have enough SOL to pay for legacy token accounts but not for token 2022 token accounts. but probably worth a comment just noting this down for devX reasons

Copy link
Copy Markdown
Contributor Author

@guibescos guibescos Mar 31, 2025

Choose a reason for hiding this comment

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

it's quite tricky because TokenAccount::LEN is actually 165, so this code might not work for token22, won't fix now but added a todo

Comment thread sdk/js/src/svm.ts
Comment thread sdk/js/src/svm.ts
@guibescos guibescos merged commit 1ebffad into main Mar 31, 2025
3 checks passed
@guibescos guibescos deleted the fix-insufficient-funds branch March 31, 2025 16:27
@guibescos guibescos restored the fix-insufficient-funds branch March 31, 2025 16:30
@danimhr danimhr deleted the fix-insufficient-funds branch April 17, 2025 08:51
@danimhr danimhr restored the fix-insufficient-funds branch April 17, 2025 08:51
@danimhr danimhr deleted the fix-insufficient-funds branch April 17, 2025 08:51
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.

2 participants