GraphemeNFT / rarible-scaffold

MIT License
0 stars 0 forks source link

check base metadata for 'word' - isPrimitive? #93

Open dcsan opened 2 years ago

dcsan commented 2 years ago

i think it defaults to true for this field?

so i set it to false:

// metadata.isPrimitive = false;

but this caused an "out of bounds" crash on minting the item...

@keepRunning do we need to update the contract?

dcsan commented 2 years ago

51

keepRunning commented 2 years ago

Is this in the contract or ipfs metadata?

dcsan commented 2 years ago

in the DrawWordTool, the below crashes and I assume the default true value is set in the .sol contract?

function makeMetadata (letters, imageCid, name, tokenIds, rows, cols) {
  let metadata = Object.assign({}, STARTING_JSON);
  metadata.name = name;
  metadata.image = imageCid;
  metadata.graphemeSrc = { tokenIds, rows, cols };
  // metadata.isPrimitive = false;
  metadata.attributes = [{
    trait_type: "Type",
    value: "Word",
  },
  {
    trait_type: "Total Letters",
    value: tokenIds.length.toString(),
  }];
keepRunning commented 2 years ago

its set true/false in the appropriate methods(reserveToken\mintItemForWord) in the contract. But how is this related - ipfs metadata and contract?

dcsan commented 2 years ago

i was trying to filter just on 'words'. adding the isPrimitive field above caused the subsequent call to fail - maybe that was a one-off, as my understanding is the metadata doesn't have a structure enforced, right?

oh i was misreading. isPrimitive is part of the info which we need a separate contract method to read/write. https://github.com/GraphemeNFT/rarible-scaffold/blob/rarible-local/docs/metadata.json

maybe we could move to typescript, it would make it a lot easier to enforce these type structures...