Skip to content

Commit

Permalink
build!: move LSP1 in its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Jan 25, 2024
1 parent 6a51249 commit 9374a02
Show file tree
Hide file tree
Showing 52 changed files with 3,450 additions and 11,145 deletions.
12 changes: 7 additions & 5 deletions contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";
import {ILSP0ERC725Account} from "./ILSP0ERC725Account.sol";
import {
ILSP1UniversalReceiver
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";

import {
ILSP1UniversalReceiverDelegate as ILSP1Delegate
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol";
} from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol";

// libraries
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {
LSP1Utils
} from "lsp1/contracts/LSP1Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
} from "lsp2/contracts/LSP2Utils.sol";

// modules
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
Expand Down Expand Up @@ -51,7 +53,7 @@ import {
_INTERFACEID_LSP1_DELEGATE,
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX,
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY
} from "../LSP1UniversalReceiver/LSP1Constants.sol";
} from "lsp1/contracts/LSP1Constants.sol";
import {_INTERFACEID_LSP14} from "../LSP14Ownable2Step/LSP14Constants.sol";

import {
Expand Down
4 changes: 1 addition & 3 deletions contracts/LSP10ReceivedVaults/LSP10Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";

// libraries
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP9} from "../LSP9Vault/LSP9Constants.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";

// libraries
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP1Utils} from "lsp1/contracts/LSP1Utils.sol";

// errors
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
import {
ILSP1UniversalReceiverDelegate
} from "../ILSP1UniversalReceiverDelegate.sol";
} from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol";
import {ILSP7DigitalAsset} from "../../LSP7DigitalAsset/ILSP7DigitalAsset.sol";

// modules
Expand All @@ -22,7 +22,7 @@ import {LSP5Utils} from "../../LSP5ReceivedAssets/LSP5Utils.sol";
import {LSP10Utils} from "../../LSP10ReceivedVaults/LSP10Utils.sol";

// constants
import {_INTERFACEID_LSP1_DELEGATE} from "../LSP1Constants.sol";
import {_INTERFACEID_LSP1_DELEGATE} from "lsp1/contracts/LSP1Constants.sol";
import {
_TYPEID_LSP7_TOKENSSENDER,
_TYPEID_LSP7_TOKENSRECIPIENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";
import {
ILSP1UniversalReceiverDelegate
} from "../ILSP1UniversalReceiverDelegate.sol";
} from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol";
import {ILSP7DigitalAsset} from "../../LSP7DigitalAsset/ILSP7DigitalAsset.sol";

// modules
Expand All @@ -18,7 +18,7 @@ import {Version} from "../../Version.sol";
import {LSP5Utils} from "../../LSP5ReceivedAssets/LSP5Utils.sol";

// constants
import {_INTERFACEID_LSP1_DELEGATE} from "../LSP1Constants.sol";
import {_INTERFACEID_LSP1_DELEGATE} from "lsp1/contracts/LSP1Constants.sol";
import {
_TYPEID_LSP7_TOKENSSENDER,
_TYPEID_LSP7_TOKENSRECIPIENT,
Expand Down
4 changes: 1 addition & 3 deletions contracts/LSP5ReceivedAssets/LSP5Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";

// libraries
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// constants
import {
Expand Down
2 changes: 1 addition & 1 deletion contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
import {
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX,
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY
} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
} from "lsp1/contracts/LSP1Constants.sol";
import {
_LSP17_EXTENSION_PREFIX
} from "../../LSP17ContractExtension/LSP17Constants.sol";
Expand Down
4 changes: 1 addition & 3 deletions contracts/LSP6KeyManager/LSP6Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import {
import {ILSP6KeyManager} from "./ILSP6KeyManager.sol";

// libraries
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// constants
import {
Expand Down
4 changes: 1 addition & 3 deletions contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP7} from "./LSP7Constants.sol";
Expand Down
6 changes: 3 additions & 3 deletions contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.4;
// interfaces
import {
ILSP1UniversalReceiver as ILSP1
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";
import {ILSP7DigitalAsset} from "./ILSP7DigitalAsset.sol";

// modules
Expand All @@ -16,7 +16,7 @@ import {
import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP1Utils} from "lsp1/contracts/LSP1Utils.sol";

// errors
import {
Expand All @@ -35,7 +35,7 @@ import {
} from "./LSP7Errors.sol";

// constants
import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
import {_INTERFACEID_LSP1} from "lsp1/contracts/LSP1Constants.sol";
import {
_TYPEID_LSP7_TOKENOPERATOR,
_TYPEID_LSP7_TOKENSSENDER,
Expand Down
4 changes: 1 addition & 3 deletions contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP7} from "./LSP7Constants.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import {
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP8, _LSP8_TOKENID_FORMAT_KEY} from "./LSP8Constants.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.12;
// interfaces
import {
ILSP1UniversalReceiver as ILSP1
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";
import {
ILSP8IdentifiableDigitalAsset
} from "./ILSP8IdentifiableDigitalAsset.sol";
Expand All @@ -22,7 +22,7 @@ import {
import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP1Utils} from "lsp1/contracts/LSP1Utils.sol";

// errors
import {
Expand All @@ -46,7 +46,7 @@ import {
} from "./LSP8Errors.sol";

// constants
import {_INTERFACEID_LSP1} from "../LSP1UniversalReceiver/LSP1Constants.sol";
import {_INTERFACEID_LSP1} from "lsp1/contracts/LSP1Constants.sol";
import {
_TYPEID_LSP8_TOKENOPERATOR,
_TYPEID_LSP8_TOKENSSENDER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import {
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP8, _LSP8_TOKENID_FORMAT_KEY} from "./LSP8Constants.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/LSP9Vault/LSP9Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {Version} from "../Version.sol";
import {LSP9VaultCore} from "./LSP9VaultCore.sol";

// libraries
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP1Utils} from "lsp1/contracts/LSP1Utils.sol";

// constants
import {
Expand Down
12 changes: 5 additions & 7 deletions contracts/LSP9Vault/LSP9VaultCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ pragma solidity ^0.8.4;
// interfaces
import {
ILSP1UniversalReceiver
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";

import {
ILSP1UniversalReceiverDelegate
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol";
} from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol";
import {ILSP9Vault} from "./ILSP9Vault.sol";

// libraries
import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";
import {LSP1Utils} from "lsp1/contracts/LSP1Utils.sol";
import {LSP2Utils} from "lsp2/contracts/LSP2Utils.sol";

// modules
import {ERC725XCore} from "@erc725/smart-contracts/contracts/ERC725XCore.sol";
Expand Down Expand Up @@ -49,7 +47,7 @@ import {
_INTERFACEID_LSP1_DELEGATE,
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX,
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_KEY
} from "../LSP1UniversalReceiver/LSP1Constants.sol";
} from "lsp1/contracts/LSP1Constants.sol";

import {
_LSP6KEY_ADDRESSPERMISSIONS_PREFIX
Expand Down
2 changes: 1 addition & 1 deletion contracts/LSP9Vault/LSP9VaultInitAbstract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import {LSP9VaultCore} from "./LSP9VaultCore.sol";

// libraries
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP1Utils} from "lsp1/contracts/LSP1Utils.sol";

// constants
import {
Expand Down
6 changes: 3 additions & 3 deletions contracts/Mocks/ERC165Interfaces.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ import {IERC223} from "./Tokens/IERC223.sol";
import {ILSP0ERC725Account} from "../LSP0ERC725Account/ILSP0ERC725Account.sol";
import {
ILSP1UniversalReceiver as ILSP1
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";

import {
ILSP1UniversalReceiverDelegate as ILSP1Delegate
} from "../LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol";
} from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol";

import {ILSP6KeyManager as ILSP6} from "../LSP6KeyManager/ILSP6KeyManager.sol";
import {
Expand Down Expand Up @@ -64,7 +64,7 @@ import {_INTERFACEID_LSP0} from "../LSP0ERC725Account/LSP0Constants.sol";
import {
_INTERFACEID_LSP1,
_INTERFACEID_LSP1_DELEGATE
} from "../LSP1UniversalReceiver/LSP1Constants.sol";
} from "lsp1/contracts/LSP1Constants.sol";
import {_INTERFACEID_LSP6} from "../LSP6KeyManager/LSP6Constants.sol";
import {_INTERFACEID_LSP7} from "../LSP7DigitalAsset/LSP7Constants.sol";
import {
Expand Down
2 changes: 1 addition & 1 deletion contracts/Mocks/LSP20Owners/OwnerWIthURD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.4;

import {
ILSP1UniversalReceiver
} from "../../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";

import {
ILSP14Ownable2Step
Expand Down
2 changes: 1 addition & 1 deletion contracts/Mocks/Reentrancy/LSP20ReentrantContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
// constants
import {
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX
} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
} from "lsp1/contracts/LSP1Constants.sol";

import {
_LSP6KEY_ADDRESSPERMISSIONS_PERMISSIONS_PREFIX,
Expand Down
2 changes: 1 addition & 1 deletion contracts/Mocks/Reentrancy/LSP20ReentrantContractBatch.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
// constants
import {
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX
} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
} from "lsp1/contracts/LSP1Constants.sol";

import {
_LSP6KEY_ADDRESSPERMISSIONS_PERMISSIONS_PREFIX,
Expand Down
2 changes: 1 addition & 1 deletion contracts/Mocks/Reentrancy/ReentrantContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {ILSP6KeyManager} from "../../LSP6KeyManager/ILSP6KeyManager.sol";
// constants
import {
_LSP1_UNIVERSAL_RECEIVER_DELEGATE_PREFIX
} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
} from "lsp1/contracts/LSP1Constants.sol";

import {
_LSP6KEY_ADDRESSPERMISSIONS_PERMISSIONS_PREFIX
Expand Down
4 changes: 2 additions & 2 deletions contracts/Mocks/Tokens/TokenReceiverWithLSP1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ pragma solidity ^0.8.4;
// interfaces
import {
ILSP1UniversalReceiver
} from "../../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";

// modules
import {
ERC165Storage
} from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

// constants
import {_INTERFACEID_LSP1} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
import {_INTERFACEID_LSP1} from "lsp1/contracts/LSP1Constants.sol";

contract TokenReceiverWithLSP1 is ERC165Storage, ILSP1UniversalReceiver {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions contracts/Mocks/Tokens/TokenReceiverWithLSP1Revert.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ pragma solidity ^0.8.4;
// interfaces
import {
ILSP1UniversalReceiver
} from "../../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";

// modules
import {
ERC165Storage
} from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

// constants
import {_INTERFACEID_LSP1} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
import {_INTERFACEID_LSP1} from "lsp1/contracts/LSP1Constants.sol";

contract TokenReceiverWithLSP1Revert is ERC165Storage, ILSP1UniversalReceiver {
function addLSP1Support() public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {
} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import {
ILSP1UniversalReceiver
} from "../../LSP1UniversalReceiver/ILSP1UniversalReceiver.sol";
} from "lsp1/contracts/ILSP1UniversalReceiver.sol";

// modules
import {
ERC165Storage
} from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

// constants
import {_INTERFACEID_LSP1} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
import {_INTERFACEID_LSP1} from "lsp1/contracts/LSP1Constants.sol";

contract TokenReceiverWithLSP1WithERC721Received is
ERC165Storage,
Expand Down
Loading

0 comments on commit 9374a02

Please sign in to comment.