Coder Social home page Coder Social logo

indexer's People

Contributors

ayushtom avatar irisdv avatar th0rgal avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

foreman3890

indexer's Issues

Add referrals stats

Description

We have trouble managing data for referrals, Ideally, we would have something where we can have:

  • Check the revenue generated by a particular address on direct referrals for Starknet ID (so the 75%)
  • Check the revenue generated by a particular address on direct referrals for the affiliate (so the 25%)
  • Check the revenue generated by a particular address on indirect referrals for the Starknet ID
  • Check the revenue generated by a particular address on indirect referrals for the affiliate
  • Check the total revenue generated by Starknet ID on direct/indirect affiliates
  • Check the total revenue generated by Affiliates
  • Check the top affiliates

Maybe we can use the the current stats dashboard made in python but Idk

Update to Cairo2 events

Add new indexers to support new naming events and disable the old indexers at a specified block.

starknet_id_update -> DomainRenewal and DomainMint
domain_to_resolver_update -> DomainResolverUpdate
domain_transfer -> DomainTransfer
domain_to_addr_update -> removed, check starknetid
addr_to_domain_update -> AddressToDomainUpdate
reset_subdomains_update -> SubdomainsReset

Asset Burn Event Indexing (Deferred)

We meed a database to keep updated the balances of assets owned by a user off chain.

These balances can be updated by our server:

  • increased when the user completes an achievement for example
  • decreased when a signature for updating the image_id is generated

But also by our indexer:

  • decreased when someone claims an asset on chain in AssetsContract (via mint_assets, see https://github.com/starknet-id/starkurabu_asset_contract/issues/1 )
  • increased when someone burns an asset on chain (also in AssetsContract)
  • updated (with + and -) when someone changes the equipment (via EquipmentUpdated in Starkurabu NFT Contract)

Collections:
on_chain_credits:

{ asset_id, variant_id, owner, amount }

off_chain_credits:
{ asset_id, variant_id, owner, amount, cursor }

To get the balance of user, find his credits on_chain and off_chain and do the sum.

If a chain reorganization happens, it's possible that a user could end up double spending:
He burns an asset on chain and receives it off chain, and then generate the signature to mint it back on chain. If a reorg cancels the burn, he can still mint it even though he didn't burn the first one. I think it's not a too big issue but we need to know what would happen in that case (would the balance be -1, 0, ...).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.