Cyfrin / solidity-by-example.github.io

Solidity By Example
https://solidity-by-example.org/
MIT License
614 stars 201 forks source link

Applies the requirement: All bidders except the highest bidder can withdraw their bid #207

Closed TylerIlunga closed 2 years ago

TylerIlunga commented 2 years ago

Reference: https://solidity-by-example.org/app/english-auction

Applies the following requirement found in the link above: "All bidders except the highest bidder can withdraw their bid"

t4sk commented 2 years ago

Thanks for your feedback. But I meant to write, current highest bidder cannot withdraw his highest bid.

Your code change will disallow the current highest bidder from withdrawing all of his previous bids.

Example

Alice bid 1 ETH Bob bid 2 ETH Alice bid 3 ETH <--- Alice cannot withdraw her previous bid of 1 ETH