Skip to content

Commit

Permalink
removed erc165 thing
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy committed Aug 12, 2024
1 parent 54f57e3 commit 73487b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
14 changes: 2 additions & 12 deletions aderyn_core/src/detect/high/incorrect_erc721_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ impl IssueDetector for IncorrectERC721InterfaceDetector {
capture!(self, context, func);
}

if (func.represents_erc721_is_approved_for_all()
|| func.represents_erc165_supports_interface())
&& !func.returns_bool()
if func.represents_erc721_is_approved_for_all() && !func.returns_bool()
{
capture!(self, context, func);
}
Expand Down Expand Up @@ -233,14 +231,6 @@ mod erc721_matching_function_signature_helper {
};
satisfier.satisfies(self)
}

pub fn represents_erc165_supports_interface(&self) -> bool {
let satisifer = SignatureMatcher {
name: "supportsInterface",
paramter_types: vec!["bytes4"],
};
satisifer.satisfies(self)
}
}

// Helpers to match return types (bool & uint256)
Expand Down Expand Up @@ -308,7 +298,7 @@ mod incorrect_erc721_tests {
assert!(found);
// assert that the detector found the correct number of instances

assert_eq!(detector.instances().len(), 9);
assert_eq!(detector.instances().len(), 8);

// assert the severity is high
assert_eq!(
Expand Down
18 changes: 0 additions & 18 deletions tests/contract-playground/src/IncorrectERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@ contract IncorrectERC721 {
balances[to] += 1;
totalSupply += 1;
}

// Define the ERC-165 identifier for the ERC-165 interface itself
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

function supportsInterface(
bytes4 interfaceId
) external view virtual returns (address) {
return address(0x1);
}
}

interface MyIERC721 {
Expand Down Expand Up @@ -282,15 +273,6 @@ contract CorrectERC721 is MyIERC721 {
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}

// Define the ERC-165 identifier for the ERC-165 interface itself
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

function supportsInterface(
bytes4 interfaceId
) external view virtual returns (bool) {
return interfaceId == _INTERFACE_ID_ERC165;
}
}

interface IERC721Receiver {
Expand Down

0 comments on commit 73487b8

Please sign in to comment.