Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: added an ERC721 NFT Contract #214
feat: added an ERC721 NFT Contract #214
Changes from 8 commits
1ef0fe4
0c25f82
488abd9
bddc71c
f30fb44
7f8b973
3aaae72
1dd2772
2b0a306
1da1af8
8815769
b5ae02b
8afbe04
aa78eb5
ccbc6f5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remember to address all review comments, see #214 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
IERC721
interface in the PR does not match the conventional one:-
IERC721
does not contain functions to getget_name
,get_symbol
andget_token_uri
, those are part of IERC721Metadata. See the expectedIERC721
interface definition here.- The IERC721Metadata interface is missing; also, it's function names are
fn name
,fn symbol
andfn token_uri
(all without theget_
part).- You can use OpenZeppelin's ERC721 implementation as inspiration for this PR, it will make it much easier to implement, see https://github.com/OpenZeppelin/cairo-contracts/blob/main/src/token/erc721.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a simplified version of OpenZeppelin is really enough for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
andsymbol
should have the type ofByteArray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
ByteArray
instead offelt252
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should address Jules's change request related to mod errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the missing
mod tests
declaration, check out the official Cairo docs on how to write tests and have them actually picked up by the compiler. Then thebash scripts/cairo_programs_verifier.sh
will work as expected (see #214 (comment)).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are written in Rust, not in Cairo.
Once you rewrite them, you should run
bash scripts/cairo_programs_verifier.sh
from the root directory - it will pinpoint any potential issues in your code and verify all of the tests pass (see project's Contributing guidelines).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the
bash scripts/cairo_programs_verifier.sh
command as requested and it passed as can be seen from the attached image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is because you renamed the file from tests.cairo to test_ERC721.cairo, but didn't declare the corresponding module in lib.cairo.
Please read how to properly write tests in Cairo using the official documentation and apply that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the tests that test functions that emit events should assert those events have been emitted as well.
Below are the links on how to do that depending on the testing library you use:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing the newline character, please resolve the conversation only once the request is addressed.