Contractul Job Bidding

ESCROWTOOLSFINANCIALUTILITY

Contract purpose

This Smart Contract manager the bidding process for a contractual job. Usually, local authorities use this system to find the cheapest contractor that will complete a construction project. The bid manager sets a limit as being the highest amount he is willing to spend with this project and the contract will accept bids less than or equal to this amount. THe winner will be the bidder who stated the minimum bid.

Exposed methods and variables

bidManager the ethereum address of the bid manager, given as parameter at contract creation

projectDetails returns the details of the construction project

maxBid returns the maximum sum the manager is willing to spend

startBidding set to true when the project details are set, after this moment, the bidding process can start

endBidding set to true when the chooseBidder function is called and no bidding will be accepted after this point

setProjectDetails allows the bid manager to send to the contract the details about the project and the maximum bid allowed. After this function is called, the bidding can start

parameter nametypedetails
_projectDetailsstringthe details of the project
_maxBidintegerthe maximum sum the manager will send to the contractor for this project

sendBid using this function, contractors can send their bids to the contract, hoping their bid will be the lowest

parameter nametypedetails
_bidintegerthe bid of this contractor

chooseBidder using this function, the manager can stop de bidding and choose a winner from those who already sent their bids. It returns the address of the contractor with the lowest bid and the amount of his bid

approveBidder this payable function is used by the manager to approve the picked winner and to send to the contract the bid of the winner and it emits the Winner event

payContractor by calling this function, the manager effectively pays the winner contractor so that he can start working on the project

Events

Winner

parameter nametypedetails
WinnerAddressethereum addressthe address of the winner
WinnerBidintegerthe winning bid
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract