Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Ethereum_Auction_Manager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
BHAVYA CHOUDHARY
Ethereum_Auction_Manager
Commits
b0963cbd
Commit
b0963cbd
authored
Aug 24, 2017
by
BHAVYA CHOUDHARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Structure of Vickery Auction
parent
ed1a47ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
VickreyAuction.sol
VickreyAuction.sol
+64
-0
No files found.
VickreyAuction.sol
0 → 100644
View file @
b0963cbd
pragma solidity ^0.4.4;
import "DAuction.sol";
contract DVickreyAuction is DAuction {
uint256 public bidDepositAmount;
uint256 public revealBlocksNum;
uint256 secondHighestBid;
bool refundCalled;
bool finalizeCalled;
// constructor
function DVickreyAuction(uint256 reservePrice, address judgeAddress, uint256 commitTimePeriod, uint256 revealTimePeriod, uint256 _bidDepositAmount) DAuction(reservePrice, commitTimePeriod, judgeAddress) {
bidDepositAmount = _bidDepositAmount;
revealBlockNum = revealTimePeriod;
}
function commitBid(bytes32 bidCommitment) biddingOpen payable returns(bool) {
throw;
}
function revealBid(uint256 nonce) revealOpen payable returns(address highestBidder) {
throw;
}
function finalize() auctionover {
require(msg.sender == highestBidder);
require(!refundCalled && !finalizeCalled);
finalizeCalled=true;
creator.transfer(secondHighestBid);
}
function refund(uint256 refundAmount) auctionOver judgeOnly {
require(highestBidder!=0);
require(refundAmount<= this.balance);
require(!finalizeCalled && !refundCalled);
refundCalled=true;
highestBidder.transfer(refundAmount);
creator.transfer(secondHighestBid-refundAmount);
}
function withdraw() auctionover returns (uint){
throw;
}
modifier auctionover {
require(block.blockNum > startBlockNum+biddingBlocksNum+revealBlocksNum);
_;
}
modifier biddingOpen {
require(block.blockNum <= startBlockNum+biddingBlocksNum);
_;
}
modifier revealOpen {
require(block.blockNum > startBlockNum+biddingBlocksNum);
require(block.blockNum <= startBlockNum+biddingBlocksNum+revealBlocksNum);
_;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment