Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 2.66 KB

README.md

File metadata and controls

12 lines (9 loc) · 2.66 KB

SmartAuction

Assignment of Peer to Peer Systems and Blockchains A.A. 2018-19 (UniPi)

Contract implemented in Solidity language for the Ethereum blockchain that implement two type of auction Dutch and Vickrey and other contracts useful to emulate an Auction House.

General Description

The project has been organized in such a way as to have the single auctions as "contracts", in this way every single auction is a separate instance, compared to the other auctions, of the same contract. This structure required the implementation of an abstract contract that would model a general auction in which many of the "security" mechanisms between the seller and the winner of the auction are implemented(Escrow). The other two contracts specifically model the two types of auctions only extend this contract by adding their particular functioning. The project has been structured in this way mainly to be able to imprint the Factory Pattern that will be useful again in the second phase of this project that foresees the implementation of a Dapp (this contract is actually used for Dapp). It has been structured a high contract that models an auction house that will only create and collect the relative auctions, this centralization of the single contracts assures to the seller and the buyer the exchange of the goods in a safe way since only the auction house can close the contract in case of problems from one of the two parties. In addition to this it has been used another particular pattern (Strategy Pattern) for the creation of various functions that deal with the calculation of the decay of the cost in Dutch; also, in this case, it has been useful the introduction of the Factory pattern since it allows us to "limit" the functions that can be used for the decay and therefore to avoid the use of any contract that implements this interface. This choice has been made mainly because the use of an external contract can be a critical point for the security and the functioning of the contract that manages the auctions.

Why python script?

Python script is the solution to the problem of the emission of the events that mark the various phases of the auctions, is an alternative of using solutions such as Ethereum Alarm Clock that is a bit expensive, this script plays the same function of EAC.
If neither is used, the only solution is to have events output when a function is called by a participant. This means charging the cost of the event to the participant and not having the certainty that the events are sent when the phase has actually started.

The contracts has been actually used in the implementation of a Dapp in web3.js see Dapp Rep