gnoverse / gnochess

User-friendly chess dApp in Gno ecosystem
https://gnochess.com
GNU General Public License v3.0
16 stars 10 forks source link

Make the faucet `register` users on-chain (instead of Redis) #160

Open moul opened 1 year ago

moul commented 1 year ago

Objective

Our goal is to pivot the user registration mechanism to a fully on-chain system, phasing out the reliance on off-chain storage methods, specifically Redis. Transitioning to this approach presents the following benefits:

Through this on-chain transformation, we further our commitment to harnessing the true capabilities of blockchain, ensuring an efficient and equitable registration experience for our competition.

Implementation Strategy

  1. Faucet Procedure Alteration:

    • Instead of the faucet executing a Send transaction to dispatch tokens to a designated address, it should instead be programmed to trigger an on-chain player registration process. This can be achieved with the following call: -pkgpath r/demo/register -func RegisterPlayer(addr, token) -send XXXugnot.
  2. Registration Contract Functionality:

    • The contract located at r/demo/register has a twofold responsibility:
      • Firstly, it must verify the uniqueness of the account, ensuring no previous claims exist for the given address.
      • Post verification, the contract should record the registration details and subsequently disburse the tokens to the provided address using the capabilities of the std.Banker module.
albttx commented 1 year ago

Just on -func RegisterPlayer(addr, token), how do we ensure the player use the same token as it's provided in mailchimp ?