Skip to content

Commit

Permalink
chore: remove Address library (#471)
Browse files Browse the repository at this point in the history
Co-authored-by: Jean Cvllr <31145285+CJ42@users.noreply.github.com>
  • Loading branch information
YamenMerhi and CJ42 authored Feb 13, 2023
1 parent 66fe41e commit 4e11beb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {ERC725Y} from "@erc725/smart-contracts/contracts/ERC725Y.sol";

// libraries
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP1Utils} from "../LSP1Utils.sol";
import {LSP2Utils} from "../../LSP2ERC725YJSONSchema/LSP2Utils.sol";
Expand Down Expand Up @@ -43,7 +42,6 @@ import "../LSP1Errors.sol";
*/
contract LSP1UniversalReceiverDelegateUP is ERC165, ILSP1UniversalReceiver {
using ERC165Checker for address;
using Address for address;

/**
* @inheritdoc ILSP1UniversalReceiver
Expand Down Expand Up @@ -74,7 +72,7 @@ contract LSP1UniversalReceiverDelegateUP is ERC165, ILSP1UniversalReceiver {

// if the contract being transferred doesn't support LSP9, do not register it as a received vault
if (mapPrefix == _LSP10_VAULTS_MAP_KEY_PREFIX) {
if (notifier.isContract()) {
if (notifier.code.length > 0) {
if (!notifier.supportsERC165InterfaceUnchecked(_INTERFACEID_LSP9))
return "LSP1: not an LSP9Vault ownership transfer";
}
Expand Down
5 changes: 1 addition & 4 deletions contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {ILSP1UniversalReceiver} from "../LSP1UniversalReceiver/ILSP1UniversalRec
import {ILSP7DigitalAsset} from "./ILSP7DigitalAsset.sol";

// libraries
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {GasLib} from "../Utils/GasLib.sol";

Expand All @@ -30,8 +29,6 @@ import {_TYPEID_LSP7_TOKENSSENDER, _TYPEID_LSP7_TOKENSRECIPIENT} from "./LSP7Con
* This contract implement the core logic of the functions for the {ILSP7DigitalAsset} interface.
*/
abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
using Address for address;

// --- Storage

bool internal _isNonDivisible;
Expand Down Expand Up @@ -372,7 +369,7 @@ abstract contract LSP7DigitalAssetCore is ILSP7DigitalAsset {
bytes memory packedData = abi.encodePacked(from, to, amount, data);
ILSP1UniversalReceiver(to).universalReceiver(_TYPEID_LSP7_TOKENSRECIPIENT, packedData);
} else if (!allowNonLSP1Recipient) {
if (to.isContract()) {
if (to.code.length > 0) {
revert LSP7NotifyTokenReceiverContractMissingLSP1Interface(to);
} else {
revert LSP7NotifyTokenReceiverIsEOA(to);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {ILSP1UniversalReceiver} from "../LSP1UniversalReceiver/ILSP1UniversalRec
import {ILSP8IdentifiableDigitalAsset} from "./ILSP8IdentifiableDigitalAsset.sol";

// libraries
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {GasLib} from "../Utils/GasLib.sol";
Expand All @@ -30,7 +29,6 @@ import {_TYPEID_LSP8_TOKENSSENDER, _TYPEID_LSP8_TOKENSRECIPIENT} from "./LSP8Con
abstract contract LSP8IdentifiableDigitalAssetCore is ILSP8IdentifiableDigitalAsset {
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableSet for EnumerableSet.Bytes32Set;
using Address for address;

// --- Storage

Expand Down Expand Up @@ -427,7 +425,7 @@ abstract contract LSP8IdentifiableDigitalAssetCore is ILSP8IdentifiableDigitalAs
bytes memory packedData = abi.encodePacked(from, to, tokenId, data);
ILSP1UniversalReceiver(to).universalReceiver(_TYPEID_LSP8_TOKENSRECIPIENT, packedData);
} else if (!allowNonLSP1Recipient) {
if (to.isContract()) {
if (to.code.length > 0) {
revert LSP8NotifyTokenReceiverContractMissingLSP1Interface(to);
} else {
revert LSP8NotifyTokenReceiverIsEOA(to);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {ILSP8CompatibleERC721} from "./ILSP8CompatibleERC721.sol";
import {ILSP8IdentifiableDigitalAsset} from "../ILSP8IdentifiableDigitalAsset.sol";

// libraries
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";

Expand Down Expand Up @@ -36,7 +35,6 @@ abstract contract LSP8CompatibleERC721 is
LSP4Compatibility,
LSP8IdentifiableDigitalAsset
{
using Address for address;
using EnumerableSet for EnumerableSet.AddressSet;

/**
Expand Down Expand Up @@ -276,7 +274,7 @@ abstract contract LSP8CompatibleERC721 is
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
if (to.code.length > 0) {
try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, data) returns (
bytes4 retval
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {ILSP8CompatibleERC721} from "./ILSP8CompatibleERC721.sol";
import {ILSP8IdentifiableDigitalAsset} from "../ILSP8IdentifiableDigitalAsset.sol";

// libraries
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";

Expand Down Expand Up @@ -36,7 +35,6 @@ abstract contract LSP8CompatibleERC721InitAbstract is
LSP8IdentifiableDigitalAssetInitAbstract,
LSP4Compatibility
{
using Address for address;
using EnumerableSet for EnumerableSet.AddressSet;

/**
Expand Down Expand Up @@ -272,7 +270,7 @@ abstract contract LSP8CompatibleERC721InitAbstract is
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
if (to.code.length > 0) {
try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, data) returns (
bytes4 retval
) {
Expand Down

0 comments on commit 4e11beb

Please sign in to comment.