Admin of the smart contract can define a new tender by defining time of start and end of different stages:
- Hashed proposal send: In this stage, each participant should upload his/her proposal on IPFS and send the hashed address of it plus a pre-determined collateral to the contract.
- Reveal proposal send: In this stage, each participant should send the real address of proposal
- Review and Approve/Reject the proposals: This stage is done by admin and acceptable proposals are approved.
- Hashed price send: in this stage, only approved participants allowed to send proposed price. The priced was hashed by a salt to prevent data leaking.
- Revealed price send: The real proposed price value+salt should be sent in this stage.
- Withdraw: In this stage, the winner of tender is determined by the contract and other participants (except winner) can withdraw their collateral.
The smart contract is made using hardhat tool in Ubuntu OS and the project also including a simple user interface to implement the smart contract.
I used openzeppelin library to implement a stable-coin token named TestUSDT. The front-end is created using html and javascript.
The project is tested on local testnet.