Skip to content

Instantly share code, notes, and snippets.

@aakilfernandes
Created December 15, 2015 20:39
Show Gist options
  • Save aakilfernandes/36d2a33238d2a2cd74e6 to your computer and use it in GitHub Desktop.
Save aakilfernandes/36d2a33238d2a2cd74e6 to your computer and use it in GitHub Desktop.
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;
}
}
}
@aakilfernandes
Copy link
Author

Create using https://chriseth.github.io/browser-solidity/ and then try and getMinimumBidForSlot(10), it always returns 0x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment