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

Goal: single tx to create NFT & publish metadata #509

Closed
trentmc opened this issue Feb 13, 2022 · 0 comments · Fixed by #510
Closed

Goal: single tx to create NFT & publish metadata #509

trentmc opened this issue Feb 13, 2022 · 0 comments · Fixed by #510
Assignees
Labels
Type: Enhancement New feature or request
Milestone

Comments

@trentmc
Copy link
Member

trentmc commented Feb 13, 2022

Is your feature request related to a problem? Please describe.

Currently, in the NFT factory, a user needs to do txs to create an NFT then add metadata. This hurts UX a bit, and costs more gas.

Proposal: add a new tx that does both at once.

Describe the solution you'd like
Just change https://github.com/oceanprotocol/contracts/blob/v4main_postaudit_next/contracts/ERC721Factory.sol#L126

and add extra parameters that are required here: https://github.com/oceanprotocol/contracts/blob/v4main_postaudit_next/contracts/templates/ERC721Template.sol#L230

Call it deployERC721withMetaData().

Describe alternatives you've considered
One alternative was to have an additional (small) smart contract that does create, publish metadata, transferOwnership in the same transaction. Without touching our existing code.

  • The third step is needed because the contract is the initial owner (msg.sender) and you need to change it to you.
  • But to do this, if we want to have it in ocean.js/py/market: need to extend list of smartcontract addresses, and need new classes for 1-1 mapping. Not really desirable so close to shipping V4.

Additional context

Bonus: doing this will help in (future) implementing comments, ratings, and stamps of approval.

  • use a "dataset" data type. Then a single tx would create a new comment as a data NFT and include its metadata (=comment contents). This would reuse the infra we have for other data services: data NFTs, gdpr compliance, edit metadata, etc.
  • This will also work as a "stamp of approval" feature because it has comment text and you can verify the publisher.
  • For "ratings": often people give both a rating + comment at once, so it's better to include "rating" functionality inside a "comment" dataset, e.g. as an optional "rating" numeric field.
@trentmc trentmc added the Type: Enhancement New feature or request label Feb 13, 2022
@trentmc trentmc added this to the V4 milestone Feb 13, 2022
@alexcos20 alexcos20 linked a pull request Feb 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants