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

[WIP] Peer Snitching Contract #248

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

theref
Copy link
Contributor

@theref theref commented Mar 27, 2024

Type of PR:

  • Feature

Required reviews:

  • 3

collection.endTimestamp = collection.initTimestamp + submissionWindow;
collection.nonce =
uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty))) %
10 ** 18;
Copy link
Member

Choose a reason for hiding this comment

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

Why mod 10^18? Unless there's a good reason, I'd drop it.

}

// Function for nodes to submit their online status with evidence
function submitEvidence(uint32 id, bytes[] memory signatures, address[] memory peers) public {
Copy link
Member

Choose a reason for hiding this comment

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

I'd remove the peers parameter, and simply extract the operator address (as you currently do in L85), and then cross-check with the staking provider address.


ITACoChildApplication public immutable application;

uint256 public submissionWindow = 1 hours;
Copy link
Member

Choose a reason for hiding this comment

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

This can probably be made immutable.

Collection[] public collections;

constructor() {
admin = msg.sender;
Copy link
Member

Choose a reason for hiding this comment

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

This isn't defined, right? Anyway, I'd define as immutable too.

Copy link
Member

Choose a reason for hiding this comment

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

I'd change it to Ownable and owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants