Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USDC Deposits don't work: UnboundLocalError: local variable 'ata_pubkey' referenced before assignment #208

Closed
akalmykov opened this issue Dec 7, 2024 · 2 comments

Comments

@akalmykov
Copy link
Contributor

This line uses ata_pubkey that might not be initialized:

account=ata_pubkey,

which results in:

UnboundLocalError: local variable 'ata_pubkey' referenced before assignment

The reason is that only get initilized here

ixs, ata_pubkey = await self.get_wrapped_sol_account_creation_ixs(amount)

if create_WSOL_token_account:
    ixs, ata_pubkey = await self.get_wrapped_sol_account_creation_ixs(amount)
    instructions.extend(ixs)
    user_token_account = ata_pubkey

Instead of ata_pubkey , user_token_account should be used

@akalmykov
Copy link
Contributor Author

Added a PR with a fix

#209

@akalmykov
Copy link
Contributor Author

PR was merged

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

No branches or pull requests

1 participant