Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use timestamp instead of block number in predictoor #780

Merged

Conversation

trizin
Copy link
Contributor

@trizin trizin commented Jul 28, 2023

Fixes #779

Changes proposed in this PR:

  • Use timestamp instead of block number
  • Calculate everything based on epoch number, and the epoch number based on timestamp

@trizin trizin changed the title Issue779 use timestamp instead of block number in predictoor Use timestamp instead of block number in predictoor Jul 28, 2023
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slither found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
}

function soonestBlockToPredict(uint256 prediction_block) public view returns (uint256) {
function soonestEpochToPredict(uint256 prediction_ts) public view returns (uint256) {

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
contracts/templates/ERC20Template3.sol Fixed Show fixed Hide fixed
@trizin trizin marked this pull request as ready for review July 28, 2023 18:37
}

function getTotalStake(
uint256 epoch_start

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

@trentmc
Copy link
Member

trentmc commented Aug 16, 2023

I just noticed this PR. Why isn't it merged? (And it's an important thing to do) cc @trizin

@alexcos20 alexcos20 merged commit 870c4b8 into v2.0 Aug 16, 2023
16 checks passed
@alexcos20 alexcos20 deleted the issue779-use-timestamp-instead-of-block-number-in-predictoor branch August 16, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: DoNotMerge Don't merge this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants