I want a store where someone can become tokenOwner
for a certain amount of time. The following solutions seems the easiest:
pragma solidity ^0.4.24;
import "../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol";
contract PromotedDapp is Ownable{
uint price;
address tokenOwner;
uint nextOwnerAllowed;
constructor() public {
owner = msg.sender;
}
function becomeOwner() public {
require(now >= nextOwner);
nextOwnerAllowed = now + 604800; // In a week
tokenOwner = msg.sender;
}
}
I know another option is to work with blockHeight since one block gets minted +/- every 10 seconds, what would be a reason to chose blockHeight over time in seconds?