Blind auction

Contract purpose

The purpose of the contract is to organize a blind auction.
Instead of sending a bid, the bidder sends a hashed version of it.
Since it is impossible to find two values that are long enough and with similar hash values, the bidder commits to the bid by sending the hashed version. As the active time for bid is over, the bids values will be sent unencrypted and the contract checks the hashes and submits the winner.


recipientAddress: the reciepient/beneficiary address endOfBidding: time to end the bid; the bid starts from the present moment plus the bid time endToReveal: time to pass after the bid finishes and reveal the winner

Exposed methods

auctionEnd gets the end of the auction bid set a bid

parameter nametypedetails
theBidbyte32with the formula: keccak256(arrayValues, booleanFake, secretsArray)

reveal reveal your blinded bids. Refunds the unsuccessful bids.

parameter nametypedetails
_valuesuint256[]list of bid values
_fakebool[]list of boolean control key
_secretkeybyte32[]list of secret keys

withdraw withdraw a bid with that was overbid. the value is the sum of pending returns beneficiaryAddress gets the beneficiary address bids gets the bid for the address and number of the bid

parameter nametypedetails
addressaddressthe address that made the bid
bidNumberInTheListuint256bid number

ended gets if the bid is ended endOfBidding gets the bid ending endToReveal gets the time end to reveal highestBid gets the highest bid highestBidder gets the highest bidder

Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract