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

Support custom URI's for ERC721WithData Contract #60

Merged
merged 3 commits into from
Jun 27, 2022

Conversation

shorsher
Copy link
Member

The ERC721WithData contract now supports custom token URI's on mint.

  • constructor now takes an optional baseURI string
  • new MintWithURI method that sets the URI for the provided token id

The ERC721WithData contract now supports custom token URI's on mint.

 - constructor now takes an optional baseURI string
 - new MintWithURI method that sets the URI for the provided token id

Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
@shorsher shorsher marked this pull request as draft June 22, 2022 15:50
@@ -2,9 +2,10 @@

pragma solidity ^0.8.0;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if "NoData" and "WithData" are not the best names at this point. Really "NoData" is "the minimum viable ERC implementation that can still work somewhat with FireFly" and "WithData" is "all the extra recommended stuff for full FireFly functionality".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @jimthematrix suggested, we can turn the NoData contracts into just ERC20 and ERC721. What are thoughts for the WithData contracts being called ERC721FireFly? 🤷🏻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still prefer "WithData" since it's more specific to the difference compared to nodata. plus giving it the "firefly" suffix makes it sounds as though they are supposed to be the contract of choice for using with FireFly

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback guys, I've wrote up your comments in this issue: #63. Going to go ahead and merge this PR.

Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks like a good starting point. Left a few comments on things to consider further.

samples/solidity/contracts/ERC721WithData.sol Outdated Show resolved Hide resolved
samples/solidity/contracts/ERC721WithData.sol Outdated Show resolved Hide resolved
Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
@jimthematrix
Copy link
Contributor

LGTM after the latest update, thanks @shorsher

I assume next we are going to make similar updates to the "no data" version of the contract? I also like the suggestion from @awrichar to call them just ERC20 and ERC721 without the NoData suffix

@shorsher shorsher changed the title Support custom URI's for ERC721WithData Support custom URI's for ERC721WithData Contract Jun 23, 2022
@shorsher shorsher marked this pull request as ready for review June 23, 2022 01:08
 - Added new TokenFactory interface for ERC165 support
 - Updated ERC721WithData interace to include MintWithURI

Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
@shorsher
Copy link
Member Author

shorsher commented Jun 23, 2022

Thanks for all the comments! Could use a double check on my interface updates for ERC165 and there's an open question around contract naming.

@shorsher
Copy link
Member Author

Note: Discussion for changing the contract names has been moved to #63.

@shorsher shorsher merged commit 55e8d6b into hyperledger:main Jun 27, 2022
@shorsher shorsher deleted the custom-uri branch June 27, 2022 12:51
address to,
uint256 tokenId,
bytes calldata data,
string memory tokenURI_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should data be the last parameter to match other methods?

string memory name,
string memory symbol,
bool is_fungible,
bytes calldata data,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should data be last?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants