Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Conversation

@0xNeshi
Copy link
Contributor

@0xNeshi 0xNeshi commented Oct 17, 2024

Issue(s): Close #197

Description

Implement a simple ERC721 contract inspired by OZ's implementation.

Note: should replace non-maintained PR #214

Checklist

@julio4
Copy link
Member

julio4 commented Nov 20, 2024

@0xNeshi The repository has been upgraded to a new site generator and the Markdown format to include code listings is slightly different. The CONTRIBUTING guidelines has been updated to reflect these changes.
Could you rebase this PR onto dev. If there's any issues or if you want me to do these changes let me know.

@julio4 julio4 changed the base branch from main to dev November 20, 2024 03:33
Copy link
Member

@julio4 julio4 left a comment

Choose a reason for hiding this comment

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

LGTM, a few small changes to follow the IERC721 as much as possible!

{{#include ../../listings/applications/721/src/erc721.cairo}}
```

There are other implementations, such as the [Open Zeppelin](https://docs.openzeppelin.com/contracts-cairo/0.7.0/erc721) one.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to 0.20.0 as the most recent one, see https://docs.openzeppelin.com/contracts-cairo/0.20.0/erc721

Updated the link for erc20 too, see 4e9607c

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@julio4 removed version (link still works), see e3d04fa

@@ -0,0 +1,19 @@
# ERC721 Token

Contracts that follow the [ERC721 Standard](https://eips.ethereum.org/EIPS/eip-721) are called ERC721 tokens. They are used to represent non-fungible assets.
Copy link
Member

Choose a reason for hiding this comment

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

Add a small comment to recommend reader to actually click and read the EIP to learn about all the erc721 interface specifications

Copy link
Contributor Author

Choose a reason for hiding this comment

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

* dep: fix patch to latest shikijs for cairo hl

* fix(app): correct sidebar placement

* fix(app): responsive content centering

* fix(app): responsive content centering

* doc: branch guidelines

* fix(app): top section nav links
Comment on lines 456 to 458
Event::Transfer(Transfer { from: owner, to: account, token_id: TOKEN_ID })
)
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Event::Transfer(Transfer { from: owner, to: account, token_id: TOKEN_ID })
)
]
Event::Transfer(Transfer { from: owner, to: account, token_id: TOKEN_ID }),
),
],

Comment on lines 480 to 482
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID })
)
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID })
)
]
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID }),
),
],

}

#[test]
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND', 'ENTRYPOINT_FAILED',))]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND', 'ENTRYPOINT_FAILED',))]
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND', 'ENTRYPOINT_FAILED'))]

Comment on lines 543 to 545
Event::Transfer(Transfer { from: owner, to: owner, token_id: TOKEN_ID })
)
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Event::Transfer(Transfer { from: owner, to: owner, token_id: TOKEN_ID })
)
]
Event::Transfer(Transfer { from: owner, to: owner, token_id: TOKEN_ID }),
),
],

Comment on lines 572 to 574
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID })
)
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID })
)
]
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID }),
),
],

Comment on lines 600 to 602
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID })
)
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID })
)
]
Event::Transfer(Transfer { from: owner, to: receiver, token_id: TOKEN_ID }),
),
],

Comment on lines 638 to 640
Event::Transfer(Transfer { from: ZERO(), to: recipient, token_id: TOKEN_ID })
)
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
Event::Transfer(Transfer { from: ZERO(), to: recipient, token_id: TOKEN_ID })
)
]
Event::Transfer(Transfer { from: ZERO(), to: recipient, token_id: TOKEN_ID }),
),
],

@julio4 julio4 merged commit f50bfe4 into NethermindEth:dev Mar 7, 2025
2 checks passed
@0xNeshi 0xNeshi deleted the erc721 branch March 7, 2025 19:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: ERC721 NFT Contract

2 participants