This is the accompanying code for the article "Verifiable Sealed-bid Auction on Ethereum Blockchain" to be published at Trusted Smart Contracts workshop 2018. It consists of:
- Two Solidity contracts: Auction and Pedersen
- C# Console application for interaction with these contracts
- Install Ethereum client Geth 1.7.3 or higher.
- Create a new directory on your drive to contain the private blockchain
- Copy the genesis.json file to that directory
- Open cmd/powershell/terminal and switch to the directory
- Execute
geth --datadir <directory_name> init genesis.json
- Execute
geth --datadir <directory_name> --networkid 300 --rpc --rpcaddr "127.0.0.1" --port "8545" --rpccorsdomain "*" --rpcapi "eth,net,web3,admin,personal" console
Now your private blockchain is ready and it supports Byzantium added proposals. We need a set of accounts to act as bidders and auctioneer.
- Execute
personal.newAccount('123')
to create new account with password 123. - After creating multiple accounts, we need to start mining some ethers on each account.
miner.setEtherbase(eth.accounts[0])
miner.start(4)
...
miner.stop()
3.Repeat the above commands but with different indexs 1, 2, ...
- Build the Auctioneer C# project using Visual Studio 2017
- Start the miner on geth console
- Run the application and it will report a sequence of transactions starting from the deployment to finalizing the auction.
- Inside, the Program.cs file you can find a list of auction parameters and their description. You can change them and rebuild the application to test the new effects.