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

calling super.tokentansfer before hook logic 🐞 #12

Merged
merged 2 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/ERC721ACH.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ contract ERC721ACH is ERC721AC, IERC721ACH {
uint256 startTokenId,
uint256 quantity
) internal virtual override {
super._beforeTokenTransfers(from, to, startTokenId, quantity);
SweetmanTech marked this conversation as resolved.
Show resolved Hide resolved
IBeforeTokenTransfersHook beforeTokenTransfersHook = IBeforeTokenTransfersHook(hooks[HookType.BeforeTokenTransfers]);
if (
address(beforeTokenTransfersHook) != address(0) &&
Expand All @@ -78,6 +79,8 @@ contract ERC721ACH is ERC721AC, IERC721ACH {
uint256 startTokenId,
uint256 quantity
) internal virtual override {

super._afterTokenTransfers(from, to, startTokenId, quantity);
SweetmanTech marked this conversation as resolved.
Show resolved Hide resolved
IAfterTokenTransfersHook afterTokenTransfersHook = IAfterTokenTransfersHook(hooks[HookType.AfterTokenTransfers]);
if (
address(afterTokenTransfersHook) != address(0) &&
Expand Down
2 changes: 2 additions & 0 deletions test/utils/ERC721ACHMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ contract ERC721ACHMock is ERC721ACH {
bool public hooksEnabled;
address public owner;

error Access_OnlyOwner();
Copy link
Contributor

Choose a reason for hiding this comment

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

are you using this anywhere?


constructor(address _owner) ERC721ACH("ERC-721ACH Mock", "MOCK") {
owner = _owner;
}
Expand Down
Loading