Skip to content

Commit

Permalink
calling super.tokentansfer before hook logic 🐞
Browse files Browse the repository at this point in the history
  • Loading branch information
Bulalu committed Aug 4, 2023
1 parent c3b7f7f commit 4f039c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
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);
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);
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();

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

0 comments on commit 4f039c8

Please sign in to comment.