Skip to content

Commit

Permalink
build!: move LSP17ContractExtension in its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
skimaharvey committed Jan 24, 2024
1 parent 4c31ce7 commit 2fe241f
Show file tree
Hide file tree
Showing 31 changed files with 25,808 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CodeGPT.apiKey": "CodeGPT Plus Beta"
}
8 changes: 5 additions & 3 deletions contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import {
OwnableUnset
} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
import {LSP14Ownable2Step} from "../LSP14Ownable2Step/LSP14Ownable2Step.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
import {
LSP17Extendable
} from "lsp17contractextension/contracts/LSP17Extendable.sol";
import {
LSP20CallVerification
} from "../LSP20CallVerification/LSP20CallVerification.sol";
Expand All @@ -56,7 +58,7 @@ import {_INTERFACEID_LSP14} from "../LSP14Ownable2Step/LSP14Constants.sol";

import {
_LSP17_EXTENSION_PREFIX
} from "../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";
import {
_INTERFACEID_LSP20_CALL_VERIFICATION
} from "../LSP20CallVerification/LSP20Constants.sol";
Expand All @@ -68,7 +70,7 @@ import {
} from "@erc725/smart-contracts/contracts/errors.sol";
import {
NoExtensionFoundForFunctionSelector
} from "../LSP17ContractExtension/LSP17Errors.sol";
} from "lsp17contractextension/contracts/LSP17Errors.sol";

/**
* @title The Core Implementation of [LSP-0-ERC725Account] Standard.
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP17Extensions/Extension4337.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import {

// modules
import {LSP14Ownable2Step} from "../LSP14Ownable2Step/LSP14Ownable2Step.sol";
import {LSP17Extension} from "../LSP17ContractExtension/LSP17Extension.sol";
import {
LSP17Extension
} from "lsp17contractextension/contracts/LSP17Extension.sol";

// librairies
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
Expand Down
8 changes: 6 additions & 2 deletions contracts/LSP17Extensions/OnERC721ReceivedExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ pragma solidity ^0.8.4;
import {
ERC721Holder
} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import {LSP17Extension} from "../LSP17ContractExtension/LSP17Extension.sol";
import {
LSP17Extension
} from "lsp17contractextension/contracts/LSP17Extension.sol";

/**
* @dev LSP17 Extension that can be attached to a LSP17Extendable contract
* to allow it to receive ERC721 tokens via `safeTransferFrom`.
*/
// solhint-disable-next-line no-empty-blocks
contract OnERC721ReceivedExtension is ERC721Holder, LSP17Extension {}
contract OnERC721ReceivedExtension is ERC721Holder, LSP17Extension {

}
2 changes: 1 addition & 1 deletion contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
} from "../../LSP1UniversalReceiver/LSP1Constants.sol";
import {
_LSP17_EXTENSION_PREFIX
} from "../../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";

// errors
import {
Expand Down
8 changes: 5 additions & 3 deletions contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
LSP4DigitalAssetMetadata
} from "../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol";
import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
import {
LSP17Extendable
} from "lsp17contractextension/contracts/LSP17Extendable.sol";

// libraries
import {
Expand All @@ -23,15 +25,15 @@ import {LSP7TokenContractCannotHoldValue} from "./LSP7Errors.sol";

import {
_LSP17_EXTENSION_PREFIX
} from "../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";

// errors

import {
NoExtensionFoundForFunctionSelector,
InvalidFunctionSelector,
InvalidExtensionAddress
} from "../LSP17ContractExtension/LSP17Errors.sol";
} from "lsp17contractextension/contracts/LSP17Errors.sol";

/**
* @title Implementation of a LSP7 Digital Asset, a contract that represents a fungible token.
Expand Down
8 changes: 5 additions & 3 deletions contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import {
} from "../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol";
import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";

import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
import {
LSP17Extendable
} from "lsp17contractextension/contracts/LSP17Extendable.sol";

// libraries
import {
Expand All @@ -24,15 +26,15 @@ import {LSP7TokenContractCannotHoldValue} from "./LSP7Errors.sol";

import {
_LSP17_EXTENSION_PREFIX
} from "../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";

// errors

import {
NoExtensionFoundForFunctionSelector,
InvalidFunctionSelector,
InvalidExtensionAddress
} from "../LSP17ContractExtension/LSP17Errors.sol";
} from "lsp17contractextension/contracts/LSP17Errors.sol";

/**
* @title LSP7DigitalAsset contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import {
LSP4DigitalAssetMetadataCore
} from "../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol";

import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
import {
LSP17Extendable
} from "lsp17contractextension/contracts/LSP17Extendable.sol";

// libraries
import {
Expand All @@ -35,15 +37,15 @@ import {

import {
_LSP17_EXTENSION_PREFIX
} from "../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";

// errors

import {
NoExtensionFoundForFunctionSelector,
InvalidFunctionSelector,
InvalidExtensionAddress
} from "../LSP17ContractExtension/LSP17Errors.sol";
} from "lsp17contractextension/contracts/LSP17Errors.sol";

/**
* @title Implementation of a LSP8 Identifiable Digital Asset, a contract that represents a non-fungible token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import {
LSP4DigitalAssetMetadataCore
} from "../LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol";

import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
import {
LSP17Extendable
} from "lsp17contractextension/contracts/LSP17Extendable.sol";

// libraries
import {
Expand All @@ -35,15 +37,15 @@ import {

import {
_LSP17_EXTENSION_PREFIX
} from "../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";

// errors

import {
NoExtensionFoundForFunctionSelector,
InvalidFunctionSelector,
InvalidExtensionAddress
} from "../LSP17ContractExtension/LSP17Errors.sol";
} from "lsp17contractextension/contracts/LSP17Errors.sol";

/**
* @title Implementation of a LSP8 Identifiable Digital Asset, a contract that represents a non-fungible token.
Expand Down
8 changes: 5 additions & 3 deletions contracts/LSP9Vault/LSP9VaultCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import {
OwnableUnset
} from "@erc725/smart-contracts/contracts/custom/OwnableUnset.sol";
import {LSP14Ownable2Step} from "../LSP14Ownable2Step/LSP14Ownable2Step.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
import {
LSP17Extendable
} from "lsp17contractextension/contracts/LSP17Extendable.sol";

// constants
import {
Expand Down Expand Up @@ -64,14 +66,14 @@ import {
import {_INTERFACEID_LSP14} from "../LSP14Ownable2Step/LSP14Constants.sol";
import {
_LSP17_EXTENSION_PREFIX
} from "../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";

// errors
import {LSP1DelegateNotAllowedToSetDataKey} from "./LSP9Errors.sol";

import {
NoExtensionFoundForFunctionSelector
} from "../LSP17ContractExtension/LSP17Errors.sol";
} from "lsp17contractextension/contracts/LSP17Errors.sol";

/**
* @title Core Implementation of LSP9Vault built on top of [ERC725], [LSP1UniversalReceiver]
Expand Down
2 changes: 1 addition & 1 deletion contracts/Mocks/ERC165Interfaces.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import {_INTERFACEID_LSP14} from "../LSP14Ownable2Step/LSP14Constants.sol";
import {
_INTERFACEID_LSP17_EXTENDABLE,
_INTERFACEID_LSP17_EXTENSION
} from "../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";
import {
_INTERFACEID_LSP20_CALL_VERIFICATION,
_INTERFACEID_LSP20_CALL_VERIFIER
Expand Down
4 changes: 3 additions & 1 deletion contracts/Mocks/LSP17ExtendableTester.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";
import {
LSP17Extendable
} from "lsp17contractextension/contracts/LSP17Extendable.sol";

/**
* @dev This contract is used only for testing purposes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {

import {
_LSP17_EXTENSION_PREFIX
} from "../../LSP17ContractExtension/LSP17Constants.sol";
} from "lsp17contractextension/contracts/LSP17Constants.sol";

/**
* @dev This contract is used only for testing
Expand Down
8 changes: 4 additions & 4 deletions dodoc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const dodocConfig = {
'contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol',
'contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol',
'contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol',
'contracts/LSP17ContractExtension/LSP17Extendable.sol',
'contracts/LSP17ContractExtension/LSP17Extension.sol',
'packages/LSP17ContractExtension/LSP17Extendable.sol',
'packages/LSP17ContractExtension/LSP17Extension.sol',
'contracts/LSP17Extensions/Extension4337.sol',
'contracts/LSP17Extensions/OnERC721ReceivedExtension.sol',
'contracts/LSP20CallVerification/LSP20CallVerification.sol',
Expand Down Expand Up @@ -44,7 +44,7 @@ export const dodocConfig = {
'contracts/LSP5ReceivedAssets/LSP5Utils.sol',
'contracts/LSP6KeyManager/LSP6Utils.sol',
'contracts/LSP10ReceivedVaults/LSP10Utils.sol',
'contracts/LSP17ContractExtension/LSP17Utils.sol',
'packages/LSP17ContractExtension/LSP17Utils.sol',

// external --------------------
'@erc725/smart-contracts/contracts/ERC725.sol',
Expand All @@ -55,7 +55,7 @@ export const dodocConfig = {
'contracts/LSP5ReceivedAssets/LSP5Utils.sol',
'contracts/LSP6KeyManager/LSP6Utils.sol',
'contracts/LSP10ReceivedVaults/LSP10Utils.sol',
'contracts/LSP17ContractExtension/LSP17Utils.sol',
'packages/LSP17ContractExtension/LSP17Utils.sol',
],
templatePath: './dodoc/template.sqrl',
helpers: [
Expand Down
72 changes: 72 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"@erc725/smart-contracts": "^7.0.0",
"@openzeppelin/contracts": "^4.9.2",
"@openzeppelin/contracts-upgradeable": "^4.9.2",
"solidity-bytes-utils": "0.8.0"
"solidity-bytes-utils": "0.8.0",
"lsp17contractextension": "*"
},
"devDependencies": {
"@b00ste/hardhat-dodoc": "^0.3.15",
Expand Down
4 changes: 4 additions & 0 deletions packages/LSP17ContractExtension/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['custom'],
};
3 changes: 3 additions & 0 deletions packages/LSP17ContractExtension/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = ../../lib/forge-std
url = https://github.com/foundry-rs/forge-std.git
Loading

0 comments on commit 2fe241f

Please sign in to comment.