-
Notifications
You must be signed in to change notification settings - Fork 0
WIP: Paid contests & awards #18
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
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This WIP pull request introduces paid contests and awards functionality with TON blockchain integration. The changes enable contest creators to configure entry fees and prize pools, with automated award distribution to winners using TON wallets.
Key Changes
- Integration of TON blockchain functionality for wallet creation, balance checking, and transaction processing
- Database schema updates to support payment tracking, wallet management, and contest award types
- Award distribution scheduler that automatically pays out winners after contest completion
- Service layer refactoring to consolidate business logic and improve separation of concerns
Reviewed Changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/ton/*.go | TON blockchain client, wallet management, and transaction operations |
| pkg/scheduler/scheduler.go | Task scheduler for periodic award distribution |
| migrations/*.sql | Database schema for payments, wallets, and award tracking |
| internal/storage/repository/postgres/*.go | Repository layer updated to support transactions and new entities |
| internal/app/service/*.go | Service layer with consolidated business logic for contests, entries, and payments |
| internal/app/distributor/distributor.go | Award distribution logic for completed contests |
| internal/app/handler/*.go | API handlers refactored to use service layer |
| internal/config/config.go | TON client configuration added |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return fmt.Errorf("user has no wallet") | ||
| } | ||
|
|
||
| recepient, err := address.ParseAddr(winner.Address) |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name "recepient" is misspelled. It should be "recipient" (note the 'i' before 'e').
|
|
||
| factor := 1 - 0.02 | ||
| amount := tlb.FromNanoTON(big.NewInt(int64(float64(nanos) * factor))) | ||
| tx, err := wallet.TransferTo(ctx, recepient, amount, fmt.Sprintf("contests.fckn.engineer: Prize for winning contest #%d", c.ID)) |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name "recepient" is misspelled. It should be "recipient" (note the 'i' before 'e').
| whereClauses = append(whereClauses, fmt.Sprintf("LOWER(title) LIKE LOWER($%d)", paramIndex)) | ||
| queryArgs = append(queryArgs, "%"+filters.Title+"%") | ||
| countArgs = append(countArgs, "%"+filters.Title+"%") | ||
| paramIndex++ |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definition of paramIndex is never used.
…test, entry, and submission flows
No description provided.