Skip to content

Commit

Permalink
Start epoch from 0
Browse files Browse the repository at this point in the history
  • Loading branch information
trizin authored Jul 29, 2023
1 parent 4b2f4e0 commit 1d4e2e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/templates/ERC20Template3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ contract ERC20Template3 is
address public stakeToken;
uint256 public secondsPerSubscription;
uint256 public trueValSubmitTimeoutEpoch;
uint256 private startEpoch;
bool public paused = false;
// -------------------------- PREDICTOOR --------------------------

Expand Down Expand Up @@ -370,6 +371,7 @@ contract ERC20Template3 is

stakeToken = addresses_[4];
_updateSeconds(uints_[2], uints_[3], uints_[4]);
startEpoch = curEpoch();
return initialized;
}

Expand Down Expand Up @@ -913,7 +915,7 @@ contract ERC20Template3 is
}

function epoch(uint256 _timestamp) public view returns (uint256) {

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

Parameter ERC20Template3.epoch(uint256)._timestamp is not in mixedCase
return _timestamp / secondsPerEpoch;
return _timestamp / secondsPerEpoch - startEpoch;
}

function curEpoch() public view returns (uint256) {
Expand Down

0 comments on commit 1d4e2e7

Please sign in to comment.