-
Notifications
You must be signed in to change notification settings - Fork 354
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
ERC721 URIstorage extension implementation #1019
Comments
Hey, @gerceboss! Thanks for opening this issue. I think this would be a great addition to the library! We'd be happy to review and support a PR :) |
Hey @andrew-fleming , can you guide a bit on how the structure must be? How and in which files should I structure the component ? |
Sure!
Regarding which files, I'd say the structure should be something like this:
Regarding how the component itself should be structured, you can take a look at how the erc20_votes extension is defined as a template. I imagine the component should define a URIStorage implementation of |
Okay,great !! Will do that |
@andrew-fleming, can you please confirm the tests that will be needed for this extension? And also suggest other tests than these?
|
Hey, @gerceboss. Yes to those tests. Assuming the extension behaves like the OZ Solidity implementation, you can use the Solidity tests as a guide: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/test/token/ERC721/extensions/ERC721URIStorage.test.js |
@andrew-fleming , while testing, there is a problem as the branch I pushed the changes on my forked repository is different, it does not resolves and throws this error: error: Identifier not found.
use openzeppelin::tests::mocks::erc721_uri_storage_mocks::ERC721URIstorageMock;
^**********************^
error: Identifier not found.
use openzeppelin::token::erc721::extensions::ERC721URIstorageComponent;
^********^ Can you help on how I run the tests? |
It's hard to identify without seeing the code. Did you make them visible by adding:
If this isn't it, kindly link your branch and I'll take a look |
Hey @andrew-fleming,
I currently implement the functionality like this and the
I am stuck on how I implement the |
Hey! You can use
Also, I'm not sure we need a new interface for URI storage. We're just adding an implementation of IERC721Metadata |
Should we? If a project wants this to be an external fn, they can create an external fn in the contract itself and implement whatever permissions with it. That's a very specific case and as a library, I don't think that's for us to do. The URI storage extension should just support storing and reading a unique URI per token. Generally, URIs are set when they're minted |
@andrew-fleming ,I have implemented the tests and included the mock contract and the test file in the needed files. It compiles but when I run |
Hey , I recently needed to implement dynamic nfts in Cairo but oppenzepelin doesn't provide it as ERC721's extension they do in solidity.
I have implemented dynamic nft myself in the project .
Would like to work on implementing
ERC721URIstorage
extension.The text was updated successfully, but these errors were encountered: