Skip to content

feat(contracts): implement upsert profile#210

Closed
chidii wants to merge 4 commits into
Quid-proquo:mainfrom
chidii:contracts/upsert-profile-v2
Closed

feat(contracts): implement upsert profile#210
chidii wants to merge 4 commits into
Quid-proquo:mainfrom
chidii:contracts/upsert-profile-v2

Conversation

@chidii

@chidii chidii commented Jun 1, 2026

Copy link
Copy Markdown

Closes #193

Summary
Implements the admin-only upsert_profile entrypoint for the Quid reputation contract.

Files Created

  • quid-contract/contracts/quid-reputation/Cargo.toml
  • quid-contract/contracts/quid-reputation/src/lib.rs
  • quid-contract/contracts/quid-reputation/src/error.rs
  • quid-contract/contracts/quid-reputation/src/test.rs

Implementation

  • initialize(admin) — sets the admin address
  • upsert_profile(subject, successful_missions, rejected_submissions, reviewer_score, founder_score, total_earnings) — admin-only profile write
  • get_profile(subject) — read a profile
  • Requires admin auth via admin.require_auth()
  • Rejects negative total_earnings
  • Rejects reviewer_score or founder_score > 100
  • Stores profile with updated_at timestamp
  • Publishes ProfileUpdatedEvent

Tests (10)

  • Initialize sets admin
  • Double initialize fails
  • Upsert success with field verification
  • Upsert updates existing profile
  • Rejects negative earnings
  • Rejects score > 100 (reviewer and founder)
  • Requires admin auth
  • Get profile not found
  • Emits ProfileUpdatedEvent
  • Zero values allowed

@drips-wave

drips-wave Bot commented Jun 1, 2026

Copy link
Copy Markdown

@chidii Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kaylahray Kaylahray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello @chidii Please resolve conflicts n workflow

@chidii chidii force-pushed the contracts/upsert-profile-v2 branch from 01250d0 to 710e8ed Compare June 4, 2026 10:31
@chidii

chidii commented Jun 4, 2026

Copy link
Copy Markdown
Author

@Kaylahray Branch cleaned up: rebased on main, single commit, no merge conflicts. Ready for re-review.

@Kaylahray

Copy link
Copy Markdown
Contributor

@chidii sorry last time please

@chidii

chidii commented Jun 6, 2026

Copy link
Copy Markdown
Author

@Kaylahray Conflicts resolved and upsert_profile entrypoint added per issue #193. All acceptance criteria covered — admin auth, negative earnings rejection, ProfileUpdatedEvent emitted, and tests included. Ready for re-review!

@chidii

chidii commented Jun 6, 2026

Copy link
Copy Markdown
Author

Closing in favour of #222 which is a clean implementation rebased directly on main.

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.

Upsert profile entrypoint

2 participants