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

Race condition in auction contract #573

Open
joe-p opened this issue Jul 20, 2023 · 0 comments
Open

Race condition in auction contract #573

joe-p opened this issue Jul 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@joe-p
Copy link

joe-p commented Jul 20, 2023

Overview

In the current contract, there is a race condition when placing a bid. The contract will attempt to repay the previous bidder, but the previous bidder can change within a block. The current design will only allow one bid per block.

Solution

Rather than immediately repaying the previous bidder, this functionality should be implemented as a separate method. Below is an example implementation of this.

https://github.com/algorand-devrel/beaker-auction/blob/master/backend/smart_contracts/auction/contract.py

@joe-p joe-p added the bug Something isn't working label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant