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

[Contract][UST-196] Check if reputation is negative and the epoch last claimed proof < 1 day #601

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

chentihe
Copy link
Collaborator

@chentihe chentihe commented Dec 24, 2024

Summary

replace epoch key proof with daily claim proof to get check-in reputation.

Linked Issue

close #579

Details

  • contract :
    • update daily epoch struct
    • replace epoch key proof with daily claim proof
  • circuit:
    • update the negative reputation logic
  • relay:
    • replace epoch key proof with daily claim proof
  • frontend:
    • replace epoch key proof with daily claim proof

@github-actions github-actions bot added documentation Improvements or additions to documentation feature new feature test test improvements contracts and removed documentation Improvements or additions to documentation feature new feature test test improvements labels Dec 24, 2024
@chentihe chentihe force-pushed the feat-contract-daily-calim-proof branch from 170294e to d285c20 Compare January 10, 2025 02:31
@chentihe chentihe self-assigned this Jan 10, 2025
@chentihe chentihe changed the title [WIP][Contract][UST-196] Check if reputation is negative and the epoch last claimed proof < 1 day [Contract][UST-196] Check if reputation is negative and the epoch last claimed proof < 1 day Jan 10, 2025
@chentihe chentihe marked this pull request as ready for review January 10, 2025 04:32
Copy link
Collaborator

@FoodChain1028 FoodChain1028 left a comment

Choose a reason for hiding this comment

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

There are several things need to be changed :) Thank you for the work!

packages/contracts/contracts/UnirepApp.sol Outdated Show resolved Hide resolved
packages/contracts/contracts/UnirepApp.sol Outdated Show resolved Hide resolved
packages/contracts/contracts/UnirepApp.sol Show resolved Hide resolved
packages/contracts/test/ClaimDailyLoginRep.test.ts Outdated Show resolved Hide resolved
packages/contracts/test/ClaimDailyLoginRep.test.ts Outdated Show resolved Hide resolved
packages/relay/src/services/ReputationService.ts Outdated Show resolved Hide resolved
packages/relay/test/checkin.test.ts Show resolved Hide resolved
Copy link
Collaborator

@FoodChain1028 FoodChain1028 left a comment

Choose a reason for hiding this comment

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

Looks great to me!

just one typo remained.

if (proofNullifier[nullifier]) {
revert ProofHasUsed();
}

proofNullifier[nullifier] = true;

// check the epoch != current epoch (ppl can only post in current aepoch)
// check the epoch != current epoch (ppl can only claim in current aepoch)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// check the epoch != current epoch (ppl can only claim in current aepoch)
// check the epoch != current epoch (ppl can only claim in current epoch)

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

Successfully merging this pull request may close these issues.

[UST-196] [Contract] Check if reputation is negative and the epoch last claimed proof < 1 day
4 participants