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

Replace increase/decrease_allowance functions with approve #1022

Merged
merged 2 commits into from
Jun 26, 2023

Conversation

sisuresh
Copy link
Contributor

Update sdk to match SAC changes.

I tried to add the following documentation to the token interface for the approve function, but I was getting a LengthExceedsMax macro error. This should be added to our docs instead.

/// # A note on modifying allowances
///
/// The approve function overwrites the previous value with `amount`, so it's
/// possible for the previous allowance to be spent in an earlier transaction
/// before `amount` is written in a later transaction. The result of this is
/// that `spender` can spend more than intended. This issue can be avoided by
/// first setting the allowance to 0, verifying that the spender didn't spend
/// any portion of the previous allowance, and then setting the allowance to the
/// new desired amount. You can read more about this issue here - https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729.

@sisuresh sisuresh enabled auto-merge (squash) June 26, 2023 04:41
@sisuresh sisuresh merged commit e90db9f into stellar:main Jun 26, 2023
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