Skip to content
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

wrong supply on TokenEntity #169

Open
roiLeo opened this issue Dec 22, 2023 · 10 comments
Open

wrong supply on TokenEntity #169

roiLeo opened this issue Dec 22, 2023 · 10 comments

Comments

@roiLeo
Copy link
Contributor

roiLeo commented Dec 22, 2023

user:

  • /ahp/u/15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW

collection:

  • /ahp/collection/u-8
@vikiival
Copy link
Member

@daiagi can you please take a look?

@daiagi
Copy link
Contributor

daiagi commented Dec 24, 2023

not really wrong supply, but missing TokenEntity
the collection /ahp/collection/u-8
contains 300 nfts

100 that looks like this
image

and 200 that look like this
image

the tokenEntity of the second group is missing
image
image
image

@roiLeo @vikiival

@roiLeo
Copy link
Contributor Author

roiLeo commented Dec 24, 2023

the tokenEntity of the second group is missing

Maybe something wrong with tokenEntities query from resolver

@daiagi
Copy link
Contributor

daiagi commented Dec 24, 2023

i think there is some bug where the nfts don't get assigned to their token for some reason

anyhow, checking

@daiagi
Copy link
Contributor

daiagi commented Dec 24, 2023

this is most likely the reason:

image

@daiagi
Copy link
Contributor

daiagi commented Dec 24, 2023

or here we also have this on u-8-199
2 events, mint and list
image

mint is without metadata, but list have metadata (came from where??)

and sure enough, no tokenEntity (because mint was without metadata and setMetadata never called)

but it doesn't make sense to create tokenEntity on LIST events, does it?!

i guess the question is where the metadata came from ?

18:59:48 INFO  squid:log ⏳ [MINT] 4037386
18:59:48 DEBUG squid:log [MINT] {
                           "caller": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "blockNumber": "4037386",
                           "timestamp": "2023-06-28T10:12:42.696Z",
                           "collectionId": "u-8",
                           "owner": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "sn": "199"
                         }
18:59:48 DEBUG squid:log [TokenEntity] {
                           "mintHandler": "Handle mint for NFT u-8-199"
                         }
18:59:48 WARN  squid:log ⚠️ [TokenEntity] MISSING NFT MEDIA u-8-199
18:59:48 DEBUG squid:log [TokenEntity] {
                           "terminateEarly": "nftMedia undefined"
                         }
18:59:48 INFO  squid:log 💚 [MINT] u-8-199
18:59:48 DEBUG sqd:processor:mapping end
                                     blockHeight: 4037386
                                     blockHash: 0x1ca2dbba2777e03933201faec08bf4136147ba42ab04c3b5cdfc4b64f1a28acf
                                     hook: event
                                     eventName: Uniques.Issued
                                     eventId: 0004037386-000999-1ca2d
18:59:48 DEBUG sqd:processor:mapping begin
                                     blockHeight: 4037386
                                     blockHash: 0x1ca2dbba2777e03933201faec08bf4136147ba42ab04c3b5cdfc4b64f1a28acf
                                     hook: event
                                     eventName: Uniques.ItemPriceSet
                                     eventId: 0004037386-001001-1ca2d
18:59:48 INFO  squid:log ⏳ [LIST] 4037386
18:59:48 DEBUG squid:log [LIST] {
                           "caller": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "blockNumber": "4037386",
                           "timestamp": "2023-06-28T10:12:42.696Z",
                           "collectionId": "u-8",
                           "sn": "199",
                           "price": "9000000000"
                         }
18:59:48 INFO  squid:log 💚 [LIST] u-8-199 by 15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW} for 9000000000
18:59:48 DEBUG sqd:processor:mapping end
                                     blockHeight: 4037386
                                     blockHash: 0x1ca2dbba2777e03933201faec08bf4136147ba42ab04c3b5cdfc4b64f1a28acf
                                     hook: event
                                     eventName: Uniques.ItemPriceSet
                                     eventId: 0004037386-001001-1ca2d
18:59:48 DEBUG sqd:processor:mapping begin
                                     blockHeight: 4037829
                                     blockHash: 0x71b493221a8e4b5fb3789f3b7ac080a804501d5e515717941218c3bf206c2880
                                     hook: event
                                     eventName: Uniques.CollectionMetadataSet
                                     eventId: 0004037829-000004-71b49
18:59:48 DEBUG squid:log [METADATA] {
                           "caller": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "blockNumber": "4037829",
                           "timestamp": "2023-06-28T12:22:00.244Z",
                           "collectionId": "u-8",
                           "metadata": "ipfs://ipfs/bafkreiewudhu24qo5oerbizhcybhwe25f5getbu5xydtpjuvumpafhivpm"
                         }
                         ```

@daiagi
Copy link
Contributor

daiagi commented Dec 24, 2023

@roiLeo
collectionMetadataSet?

I think that's it, all these nfts show the fallback collection metadata

image

@roiLeo
Copy link
Contributor Author

roiLeo commented Dec 24, 2023

I think that's it, all these nfts show the fallback collection metadata

final.metadata = event.metadata || collection.metadata
?

@daiagi
Copy link
Contributor

daiagi commented Dec 24, 2023

I think that's it, all these nfts show the fallback collection metadata

final.metadata = event.metadata || collection.metadata

?

damn. you're right
@vikiival to the rescue?

@daiagi
Copy link
Contributor

daiagi commented Dec 24, 2023

ok i think i figured it out
the metadata on the collection is being set AFTER 200 nfts are minted
need to handle this situation in setMetadata mapping

something like

  1. find all the nft's in the collection that don't have token (or no metadata?)
  2. if any exists, create a new token using the collection metadata
  3. assign all of them to that token
 [MINT] 4037386
01:27:20 DEBUG squid:log [MINT] {
                           "caller": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "blockNumber": "4037386",
                           "timestamp": "2023-06-28T10:12:42.696Z",
                           "collectionId": "u-8",
                           "owner": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "sn": "199"
                         }
01:27:20 DEBUG squid:log [MINT] {
                           "collectionId": "u-8",
                           "nftId": "u-8-199",
                           "timestamp": "2023-06-28T10:12:42.696Z"
                         }
01:27:20 DEBUG squid:log [TokenEntity] {
                           "mintHandler": "Handle mint for NFT u-8-199"
                         }
01:27:20 WARN  squid:log ⚠️ [TokenEntity] MISSING NFT MEDIA u-8-199
01:27:20 INFO  squid:log 💚 [MINT] u-8-199
01:27:20 DEBUG sqd:processor:mapping end
                                     blockHeight: 4037386
                                     blockHash: 0x1ca2dbba2777e03933201faec08bf4136147ba42ab04c3b5cdfc4b64f1a28acf
                                     hook: event
                                     eventName: Uniques.Issued
                                     eventId: 0004037386-000999-1ca2d
01:27:20 DEBUG sqd:processor:mapping begin
                                     blockHeight: 4037386
                                     blockHash: 0x1ca2dbba2777e03933201faec08bf4136147ba42ab04c3b5cdfc4b64f1a28acf
                                     hook: event
                                     eventName: Uniques.ItemPriceSet
                                     eventId: 0004037386-001001-1ca2d
01:27:20 INFO  squid:log ⏳ [LIST] 4037386
01:27:20 DEBUG squid:log [LIST] {
                           "caller": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "blockNumber": "4037386",
                           "timestamp": "2023-06-28T10:12:42.696Z",
                           "collectionId": "u-8",
                           "sn": "199",
                           "price": "9000000000"
                         }
01:27:20 INFO  squid:log 💚 [LIST] u-8-199 by 15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW} for 9000000000
01:27:20 DEBUG sqd:processor:mapping end
                                     blockHeight: 4037386
                                     blockHash: 0x1ca2dbba2777e03933201faec08bf4136147ba42ab04c3b5cdfc4b64f1a28acf
                                     hook: event
                                     eventName: Uniques.ItemPriceSet
                                     eventId: 0004037386-001001-1ca2d
01:27:20 DEBUG sqd:processor:mapping begin
                                     blockHeight: 4037829
                                     blockHash: 0x71b493221a8e4b5fb3789f3b7ac080a804501d5e515717941218c3bf206c2880
                                     hook: event
                                     eventName: Uniques.CollectionMetadataSet
                                     eventId: 0004037829-000004-71b49
01:27:20 DEBUG squid:log [METADATA] {
                           "caller": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW",
                           "blockNumber": "4037829",
                           "timestamp": "2023-06-28T12:22:00.244Z",
                           "collectionId": "u-8",
                           "metadata": "ipfs://ipfs/bafkreiewudhu24qo5oerbizhcybhwe25f5getbu5xydtpjuvumpafhivpm"
                         }
01:27:20 DEBUG squid:log [METADATA] {
                           "collectionId": "u-8",
                           "metadata": "ipfs://ipfs/bafkreiewudhu24qo5oerbizhcybhwe25f5getbu5xydtpjuvumpafhivpm",
                           "timestamp": "2023-06-28T12:22:00.244Z"
                         }

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 a pull request may close this issue.

3 participants