Skip to content

Conversation

@jus1d
Copy link
Member

@jus1d jus1d commented Nov 8, 2025

No description provided.

Copy link

Copilot AI left a 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)
Copy link

Copilot AI Nov 11, 2025

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').

Copilot uses AI. Check for mistakes.

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))
Copy link

Copilot AI Nov 11, 2025

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').

Copilot uses AI. Check for mistakes.
whereClauses = append(whereClauses, fmt.Sprintf("LOWER(title) LIKE LOWER($%d)", paramIndex))
queryArgs = append(queryArgs, "%"+filters.Title+"%")
countArgs = append(countArgs, "%"+filters.Title+"%")
paramIndex++
Copy link

Copilot AI Nov 11, 2025

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.

Copilot uses AI. Check for mistakes.
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.

2 participants