OneDaijo / daijo-contracts

Apache License 2.0
6 stars 2 forks source link

Test timestamping depending on deployment #58

Closed thiefinparis closed 6 years ago

thiefinparis commented 6 years ago

This should supersede #56.

Depending on where QINToken is deployed (this changes the bool that's passed to it on construction), it and all the contracts it creates will be in test mode. Whenever these contracts check the time through the getCurrentTime function, they will receive a test time that will be set to now on initialization. Afterwards, it can be modified externally. If not in test mode, it will return now, and the set method will throw (maybe we should make this just a no-op).

thiefinparis commented 6 years ago

@zlgrube Updated Controllable.sol as a minor cleanup. Just FYI, we generally prefer require(condition) or assert(condition) over if(!condition) { revert(); }.