diff --git a/contracts/templates/ERC20Template3.sol b/contracts/templates/ERC20Template3.sol index a9d54164..11dc5f40 100644 --- a/contracts/templates/ERC20Template3.sol +++ b/contracts/templates/ERC20Template3.sol @@ -118,6 +118,7 @@ contract ERC20Template3 is address public stakeToken; uint256 public secondsPerSubscription; uint256 public trueValSubmitTimeoutEpoch; + uint256 private startEpoch; bool public paused = false; // -------------------------- PREDICTOOR -------------------------- @@ -370,6 +371,7 @@ contract ERC20Template3 is stakeToken = addresses_[4]; _updateSeconds(uints_[2], uints_[3], uints_[4]); + startEpoch = curEpoch(); return initialized; } @@ -913,7 +915,7 @@ contract ERC20Template3 is } function epoch(uint256 _timestamp) public view returns (uint256) { - return _timestamp / secondsPerEpoch; + return _timestamp / secondsPerEpoch - startEpoch; } function curEpoch() public view returns (uint256) {