Skip to content

Commit

Permalink
build!: move LSP1 URD in its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
b00ste committed Feb 9, 2024
1 parent 84a817d commit f483b8b
Show file tree
Hide file tree
Showing 22 changed files with 339 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/solc_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
solidity-bytes-utils/=node_modules/solidity-bytes-utils/ \
lsp0/=packages/LSP0ERC725Account/ \
lsp1/=packages/LSP1UniversalReceiver/ \
lsp1delegate/=packages/LSP1UniversalReceiverDelegate/ \
lsp2/=packages/LSP2ERC725YJSONSchema/ \
lsp3/=packages/LSP3ProfileMetadata/ \
lsp4/=packages/LSP4DigitalAssetMetadata/ \
Expand All @@ -105,6 +106,7 @@ jobs:
solidity-bytes-utils/=node_modules/solidity-bytes-utils/ \
lsp0/=packages/LSP0ERC725Account/ \
lsp1/=packages/LSP1UniversalReceiver/ \
lsp1delegate/=packages/LSP1UniversalReceiverDelegate/ \
lsp2/=packages/LSP2ERC725YJSONSchema/ \
lsp3/=packages/LSP3ProfileMetadata/ \
lsp4/=packages/LSP4DigitalAssetMetadata/ \
Expand Down
4 changes: 2 additions & 2 deletions .mythx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ analyze:
targets:
# LSP1
# ------------------
- contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol
- contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol
- lsp1delegate/contract/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol
- lsp1delegate/contract/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol

# Standard version
# ------------------
Expand Down
7 changes: 7 additions & 0 deletions contracts/Imports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@ pragma solidity ^0.8.4;

// solhint-disable no-unused-import

import {
LSP1UniversalReceiverDelegateUP
} from "lsp1delegate/contracts/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol";
import {
LSP1UniversalReceiverDelegateVault
} from "lsp1delegate/contracts/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol";

import {LSP9Vault} from "lsp9/contracts/LSP9Vault.sol";
import {LSP9VaultInit} from "lsp9/contracts/LSP9VaultInit.sol";
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

:::info Standard Specifications

[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md)
[`LSP-1-UniversalReceiverDelegateUP`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateUP.md)

:::
:::info Solidity implementation

[`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
[`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)

:::

Expand All @@ -31,8 +31,8 @@ When marked as 'public', a method can be called both externally and internally,

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#version)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateUP**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateUP.md#version)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`

Expand All @@ -56,8 +56,8 @@ _Contract version._

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateUP**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateUP.md#supportsinterface)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`

Expand Down Expand Up @@ -87,8 +87,8 @@ See [`IERC165-supportsInterface`](#ierc165-supportsinterface).

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiverdelegate)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateUP**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateUP.md#universalreceiverdelegate)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Function signature: `universalReceiverDelegate(address,uint256,bytes32,bytes)`
- Function selector: `0xa245bbda`

Expand Down Expand Up @@ -254,8 +254,8 @@ Calls `bytes4(keccak256(setDataBatch(bytes32[],bytes[])))` without checking for

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateUP**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateUP.md#cannotregistereoasasassets)
- Solidity implementation: [`LSP1UniversalReceiverDelegateUP.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol)
- Error signature: `CannotRegisterEOAsAsAssets(address)`
- Error hash: `0xa5295345`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

:::info Standard Specifications

[`LSP-1-UniversalReceiver`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md)
[`LSP-1-UniversalReceiverDelegateVault`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateVault.md)

:::
:::info Solidity implementation

[`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
[`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)

:::

Expand All @@ -29,8 +29,8 @@ When marked as 'public', a method can be called both externally and internally,

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#version)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateVault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateVault.md#version)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Function signature: `VERSION()`
- Function selector: `0xffa1ad74`

Expand All @@ -54,8 +54,8 @@ _Contract version._

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#supportsinterface)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateVault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateVault.md#supportsinterface)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Function signature: `supportsInterface(bytes4)`
- Function selector: `0x01ffc9a7`

Expand Down Expand Up @@ -85,8 +85,8 @@ See [`IERC165-supportsInterface`](#ierc165-supportsinterface).

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#universalreceiverdelegate)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateVault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateVault.md#universalreceiverdelegate)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Function signature: `universalReceiverDelegate(address,uint256,bytes32,bytes)`
- Function selector: `0xa245bbda`

Expand Down Expand Up @@ -211,8 +211,8 @@ Calls `bytes4(keccak256(setDataBatch(bytes32[],bytes[])))` without checking for

:::note References

- Specification details: [**LSP-1-UniversalReceiver**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiver.md#cannotregistereoasasassets)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Specification details: [**LSP-1-UniversalReceiverDelegateVault**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-1-UniversalReceiverDelegateVault.md#cannotregistereoasasassets)
- Solidity implementation: [`LSP1UniversalReceiverDelegateVault.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp1delegate/contracts/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol)
- Error signature: `CannotRegisterEOAsAsAssets(address)`
- Error hash: `0xa5295345`

Expand Down
4 changes: 2 additions & 2 deletions dodoc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const dodocConfig = {
include: [
'universalprofile/contracts/UniversalProfile.sol',
'lsp0/contracts/LSP0ERC725Account.sol',
'contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol',
'contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol',
'lsp1delegate/contracts/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol',
'lsp1delegate/contracts/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol',
'lsp6/contracts/LSP6KeyManager.sol',
'lsp9/contracts/LSP9Vault.sol',
'contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol',
Expand Down
64 changes: 64 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"solidity-bytes-utils": "0.8.0",
"lsp0": "*",
"lsp1": "*",
"lsp1delegate": "*",
"lsp2": "*",
"lsp4": "*",
"lsp5": "*",
Expand Down
4 changes: 4 additions & 0 deletions packages/LSP1UniversalReceiverDelegate/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['custom'],
};
25 changes: 25 additions & 0 deletions packages/LSP1UniversalReceiverDelegate/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": "solhint:recommended",
"rules": {
"avoid-sha3": "error",
"avoid-suicide": "error",
"avoid-throw": "error",
"avoid-tx-origin": "error",
"check-send-result": "error",
"compiler-version": ["error", "^0.8.0"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"not-rely-on-block-hash": "error",
"not-rely-on-time": "error",
"reentrancy": "error",
"constructor-syntax": "error",
"private-vars-leading-underscore": ["error", { "strict": false }],
"imports-on-top": "error",
"visibility-modifier-order": "error",
"no-unused-import": "error",
"no-global-import": "error",
"reason-string": ["warn", { "maxLength": 120 }],
"avoid-low-level-calls": "off",
"no-empty-blocks": ["error", { "ignoreConstructors": true }],
"custom-errors": "off"
}
}
3 changes: 3 additions & 0 deletions packages/LSP1UniversalReceiverDelegate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# LSP1 Universal Receiver Delegate

Package for the LSP1 Universal Receiver Delegate standard.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {ILSP7DigitalAsset} from "lsp7/contracts/ILSP7DigitalAsset.sol";

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

// libraries
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {ILSP7DigitalAsset} from "lsp7/contracts/ILSP7DigitalAsset.sol";

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

// libraries
import {LSP5Utils} from "lsp5/contracts/LSP5Utils.sol";
Expand Down
17 changes: 17 additions & 0 deletions packages/LSP1UniversalReceiverDelegate/contracts/Version.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

abstract contract Version {
/**
* @dev Get the version of the contract.
* @notice Contract version.
*
* @return The version of the the contract.
*/
// DO NOT CHANGE
// Comments block below is used by release-please to automatically update the version in this file.
// x-release-please-start-version
string public constant VERSION = "0.14.0";

// x-release-please-end
}
Loading

0 comments on commit f483b8b

Please sign in to comment.