# Back to Alice's Auction (Reach version)

**URL:** https://forum.algorand.co/t/back-to-alices-auction-reach-version/6145
**Category:** Uncategorized
**Created:** [March 1, 2022, 12:08am UTC](https://forum.algorand.co/t/back-to-alices-auction-reach-version/6145 "2022-03-01T00:08:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hbquikcomjamesl](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hbquikcomjamesl](https://forum.algorand.co/u/hbquikcomjamesl)
#### Post date: [March 1, 2022, 12:08am UTC](https://forum.algorand.co/t/back-to-alices-auction-reach-version/6145/1 "2022-03-01T00:08:53Z")

</div>

After going through Kathryn “Blondiebytes” Hodge’s “Ten Days of Blockchain” video tutorial twice (following along the second time), I’m back to the Reach version of “Alice’s Auction” (this time with a fighting chance of understanding what I’m looking at. 🤔 🤔

I’ve managed (with some help on the Reach Discord) to dope out that the new bid gets transferred from the new bidder into the contract implicitly in the PAY\_EXPR of the parallelReduce, while the previous bid (if any) gets returned to the previous bidder explicitly in the CONSENSUS\_EXPR of the parallelReduce. (Although . . . does the “require(bid \> currentPrice)” in the CONSENSUS\_EXPR stop the aforementioned implicit transfer in the PAY\_EXPR if it fails?)

I’m having trouble wrapping my mind around the front-end (index.mjs):

1. I see that, in three different runs of the program, the bidders act in what appears to be a pseudorandom sequence. Yet the only call to Math.random I see is for the bid amounts. How is this happening?

2. I also see that each bidder is “deciding to bid” some random amount exactly once. This would seem to simulate not a “live auction,” but a “single round of sealed bids” auction. Am I understanding this correctly?

---

<div class="post-metadata">

### Author: ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)
#### Post date: [March 1, 2022, 1:32am UTC](https://forum.algorand.co/t/back-to-alices-auction-reach-version/6145/2 "2022-03-01T01:32:46Z")

</div>

If you don’t get an answer here, you can try to ask the questions (referencing this post) on the Algorand Discord ([Algorand](https://discord.gg/84AActu3at)) or the Reach Discord ([https://reach.sh/](https://reach.sh/)).
