Skip to content

Commit

Permalink
Update contracts to match deployment on chain
Browse files Browse the repository at this point in the history
  • Loading branch information
ScreamingHawk committed Jul 9, 2023
1 parent c8fcb7e commit afc1d7b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
15 changes: 1 addition & 14 deletions contracts/modules/commons/ModuleHooks.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import "./ModuleStorage.sol";
import "./ModuleERC165.sol";

import "../../interfaces/receivers/IERC1155Receiver.sol";
import "../../interfaces/receivers/IERC777Receiver.sol";
import "../../interfaces/receivers/IERC721Receiver.sol";
import "../../interfaces/receivers/IERC223Receiver.sol";


contract ModuleHooks is IERC1155Receiver, IERC777Receiver, IERC721Receiver, IERC223Receiver, IModuleHooks, ModuleERC165, ModuleSelfAuth {
contract ModuleHooks is IERC1155Receiver, IERC721Receiver, IModuleHooks, ModuleERC165, ModuleSelfAuth {
// HOOKS_KEY = keccak256("org.arcadeum.module.hooks.hooks");
bytes32 private constant HOOKS_KEY = bytes32(0xbe27a319efc8734e89e26ba4bc95f5c788584163b959f03fa04e2d7ab4b9a120);

Expand Down Expand Up @@ -95,12 +94,6 @@ contract ModuleHooks is IERC1155Receiver, IERC777Receiver, IERC721Receiver, IERC
return ModuleHooks.onERC1155BatchReceived.selector;
}

/**
* @notice Handle the receipt of ERC777 token types.
*/
// solhint-disable-next-line no-empty-blocks
function tokensReceived(address, address, address, uint256, bytes calldata, bytes calldata) external override virtual {}

/**
* @notice Handle the receipt of a single ERC721 token.
* @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
Expand All @@ -109,11 +102,6 @@ contract ModuleHooks is IERC1155Receiver, IERC777Receiver, IERC721Receiver, IERC
return ModuleHooks.onERC721Received.selector;
}

/**
* @notice Handle the receipt of ERC223 tokens.
*/
function tokenFallback(address, uint256, bytes calldata) external override virtual {} // solhint-disable-line no-empty-blocks

/**
* @notice Routes fallback calls through hooks
*/
Expand Down Expand Up @@ -147,7 +135,6 @@ contract ModuleHooks is IERC1155Receiver, IERC777Receiver, IERC721Receiver, IERC
if (
_interfaceID == type(IModuleHooks).interfaceId ||
_interfaceID == type(IERC1155Receiver).interfaceId ||
_interfaceID == type(IERC777Receiver).interfaceId ||
_interfaceID == type(IERC721Receiver).interfaceId ||
_interfaceID == type(IERC223Receiver).interfaceId
) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/modules/utils/RequireUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract RequireUtils {
* @param _expiration Expiration to check
*/
function requireNonExpired(uint256 _expiration) external view {
require(block.timestamp <= _expiration, "RequireUtils#requireNonExpired: EXPIRED");
require(block.timestamp < _expiration, "RequireUtils#requireNonExpired: EXPIRED");
}

/**
Expand Down
6 changes: 1 addition & 5 deletions foundry_test/modules/utils/RequireUtils.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,12 @@ contract SubModuleNonceTest is AdvTest {
}

function test_requireNonExpired(uint256 _expiration) external {
if (block.timestamp > _expiration) {
if (block.timestamp >= _expiration) {
vm.expectRevert(bytes('RequireUtils#requireNonExpired: EXPIRED'));
}
requireUtils.requireNonExpired(_expiration);
}

function test_requireNonExpiredWithExactBlock() external view {
requireUtils.requireNonExpired(block.timestamp);
}

function test_requireMinNonce(uint160 _space, uint96 _nonce, uint96 _nonceToCheck) external {
imp.writeNonce(_space, _nonce);
uint256 encoded = abi.decode(abi.encodePacked(_space, _nonceToCheck), (uint256));
Expand Down
1 change: 0 additions & 1 deletion test/ERC165.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { expect, interfaceIdOf, randomHex } from './utils'
const interfaceIds = [
'IERC223Receiver',
'IERC721Receiver',
'IERC777Receiver',
'IERC1155Receiver',
'IERC1271Wallet',
'IModuleAuth',
Expand Down

0 comments on commit afc1d7b

Please sign in to comment.