Created
December 15, 2015 20:39
-
-
Save aakilfernandes/36d2a33238d2a2cd74e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract Billboard{ | |
uint minimumBid = 10; | |
uint minimumBidDelta = 10; | |
Slot[] slots; //an array of slots. Each slot is one period of time (for example one day) | |
struct Slot{ | |
address winner; // winner of the slot | |
uint bid; // amount of wei the winner bid | |
} | |
function getMinimumBidForSlot(uint _slotIndex) constant returns(uint){ | |
if(slots[_slotIndex].bid == 0){ | |
return minimumBid; | |
}else{ | |
return slots[_slotIndex].bid+minimumBidDelta; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create using https://chriseth.github.io/browser-solidity/ and then try and
getMinimumBidForSlot(10)
, it always returns0x