diff --git a/package-lock.json b/package-lock.json index 18dccb16a..3597c6415 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13286,6 +13286,10 @@ "resolved": "packages/LSP2ERC725YJSONSchema", "link": true }, + "node_modules/lsp4": { + "resolved": "packages/LSP4DigitalAssetMetadata", + "link": true + }, "node_modules/ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", @@ -23534,6 +23538,44 @@ "typechain": "^8.0.0", "typescript": "^5.3.3" } + }, + "packages/LSP4DigitalAssetMetadata": { + "name": "lsp4", + "version": "0.12.1", + "license": "Apache-2.0", + "dependencies": { + "@erc725/smart-contracts": "^7.0.0" + }, + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^2.0.2", + "@typechain/ethers-v5": "^10.2.0", + "dotenv": "^16.0.3", + "eslint-config-custom": "*", + "ethers": "^5.7.2", + "hardhat": "^2.13.0", + "hardhat-contract-sizer": "^2.8.0", + "hardhat-deploy": "^0.11.25", + "hardhat-gas-reporter": "^1.0.9", + "hardhat-packager": "^1.4.2", + "solhint": "^3.3.6", + "ts-node": "^10.2.0", + "tsconfig": "*", + "typechain": "^8.0.0", + "typescript": "^4.9.5" + } + }, + "packages/LSP4DigitalAssetMetadata/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } } }, "dependencies": { @@ -33595,6 +33637,35 @@ "typescript": "^5.3.3" } }, + "lsp4": { + "version": "file:packages/LSP4DigitalAssetMetadata", + "requires": { + "@erc725/smart-contracts": "^7.0.0", + "@nomicfoundation/hardhat-toolbox": "^2.0.2", + "@typechain/ethers-v5": "^10.2.0", + "dotenv": "^16.0.3", + "eslint-config-custom": "*", + "ethers": "^5.7.2", + "hardhat": "^2.13.0", + "hardhat-contract-sizer": "^2.8.0", + "hardhat-deploy": "^0.11.25", + "hardhat-gas-reporter": "^1.0.9", + "hardhat-packager": "^1.4.2", + "solhint": "^3.3.6", + "ts-node": "^10.2.0", + "tsconfig": "*", + "typechain": "^8.0.0", + "typescript": "^4.9.5" + }, + "dependencies": { + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true + } + } + }, "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", diff --git a/packages/LSP4DigitalAssetMetadata/.eslintrc.js b/packages/LSP4DigitalAssetMetadata/.eslintrc.js new file mode 100644 index 000000000..03ee7431b --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['custom'], +}; diff --git a/packages/LSP4DigitalAssetMetadata/.gitmodules b/packages/LSP4DigitalAssetMetadata/.gitmodules new file mode 100644 index 000000000..3dce69ce0 --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/forge-std"] + path = ../../lib/forge-std + url = https://github.com/foundry-rs/forge-std.git diff --git a/packages/LSP4DigitalAssetMetadata/.solhint.json b/packages/LSP4DigitalAssetMetadata/.solhint.json new file mode 100644 index 000000000..26e01c48a --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/.solhint.json @@ -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" + } +} diff --git a/packages/LSP4DigitalAssetMetadata/README.md b/packages/LSP4DigitalAssetMetadata/README.md new file mode 100644 index 000000000..44c90d86b --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/README.md @@ -0,0 +1,51 @@ +# LSP Package Template + +This project can be used as a skeleton to build a package for a LSP implementation in Solidity (LUKSO Standard Proposal) + +It is based on Hardhat. + +## How to setup a LSP as a package? + +1. Copy the `template/` folder and paste it under the `packages/` folder. Then rename this `template/` folder that you copied with the LSP name. + +You can do so either: + +- manually, by copying the folder and pasting it inside `packages` and then renaming it. + or +- by running the following command from the root of the repository. + +```bash +cp -r template packages/lsp-name +``` + +2. Update the `"name"` and `"description"` field inside the `package.json` for this LSP package you just created. + +3. Setup the dependencies + +If this LSP uses external dependencies like `@openzeppelin/contracts`, put them under `dependencies` with the version number. + +```json +"@openzeppelin/contracts": "^4.9.3" +``` + +If this LSP uses other LSP as dependencies, put each LSP dependency as shown below. This will use the current code in the package: + +```json +"@lsp2": "*" +``` + +4. Setup the npm commands for linting, building, testing, etc... under the `"scripts"` in the `package.json` + +5. Test that all commands you setup run successfully + +By running the commands below, your LSP package should come up in the list of packages that Turbo is running this command for. + +```bash +turbo build +turbo lint +turbo lint:solidity +turbo test +turbo test:foundry +``` + +6. Finally update the relevant information in the `README.md` file in the folder of the newly created package, such as the title at the top, some description, etc... diff --git a/packages/LSP4DigitalAssetMetadata/contracts/LSP4Constants.sol b/packages/LSP4DigitalAssetMetadata/contracts/LSP4Constants.sol new file mode 100644 index 000000000..5dab3f868 --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/contracts/LSP4Constants.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +// Token types +uint256 constant _LSP4_TOKEN_TYPE_TOKEN = 0; +uint256 constant _LSP4_TOKEN_TYPE_NFT = 1; +uint256 constant _LSP4_TOKEN_TYPE_COLLECTION = 2; + +// --- ERC725Y entries + +// bytes10(keccak256('SupportedStandards')) + bytes2(0) + bytes20(keccak256('LSP4DigitalAsset')) +bytes32 constant _LSP4_SUPPORTED_STANDARDS_KEY = 0xeafec4d89fa9619884b60000a4d96624a38f7ac2d8d9a604ecf07c12c77e480c; + +// bytes4(keccak256('LSP4DigitalAsset')) +bytes constant _LSP4_SUPPORTED_STANDARDS_VALUE = hex"a4d96624"; + +// keccak256('LSP4TokenName') +bytes32 constant _LSP4_TOKEN_NAME_KEY = 0xdeba1e292f8ba88238e10ab3c7f88bd4be4fac56cad5194b6ecceaf653468af1; + +// keccak256('LSP4TokenSymbol') +bytes32 constant _LSP4_TOKEN_SYMBOL_KEY = 0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756; + +// keccak256('LSP4TokenType') +bytes32 constant _LSP4_TOKEN_TYPE_KEY = 0xe0261fa95db2eb3b5439bd033cda66d56b96f92f243a8228fd87550ed7bdfdb3; + +// keccak256('LSP4Creators[]') +bytes32 constant _LSP4_CREATORS_ARRAY_KEY = 0x114bd03b3a46d48759680d81ebb2b414fda7d030a7105a851867accf1c2352e7; + +// bytes10(keccak256('LSP4CreatorsMap')) +bytes10 constant _LSP4_CREATORS_MAP_KEY_PREFIX = 0x6de85eaf5d982b4e5da0; + +// keccak256('LSP4Metadata') +bytes32 constant _LSP4_METADATA_KEY = 0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e; diff --git a/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadata.sol b/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadata.sol new file mode 100644 index 000000000..cb993cbda --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadata.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +// modules +import {ERC725Y} from "@erc725/smart-contracts/contracts/ERC725Y.sol"; +import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol"; +import {LSP4DigitalAssetMetadataCore} from "./LSP4DigitalAssetMetadataCore.sol"; + +// constants +import { + _LSP4_SUPPORTED_STANDARDS_KEY, + _LSP4_SUPPORTED_STANDARDS_VALUE, + _LSP4_TOKEN_NAME_KEY, + _LSP4_TOKEN_SYMBOL_KEY, + _LSP4_TOKEN_TYPE_KEY +} from "./LSP4Constants.sol"; + +/** + * @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store. + * @author Matthew Stevens + * @dev Standard Implementation of the LSP4 standard. + */ +abstract contract LSP4DigitalAssetMetadata is + ERC725Y, + LSP4DigitalAssetMetadataCore +{ + /** + * @notice Deploying a digital asset `name_` with the `symbol_` symbol. + * + * @param name_ The name of the token. + * @param symbol_ The symbol of the token. + * @param initialOwner_ The owner of the token contract. + * @param lsp4TokenType_ The type of token this digital asset contract represents (`0` = Token, `1` = NFT, `2` = Collection). + */ + constructor( + string memory name_, + string memory symbol_, + address initialOwner_, + uint256 lsp4TokenType_ + ) ERC725Y(initialOwner_) { + // set data key SupportedStandards:LSP4DigitalAsset + ERC725YCore._setData( + _LSP4_SUPPORTED_STANDARDS_KEY, + _LSP4_SUPPORTED_STANDARDS_VALUE + ); + + ERC725YCore._setData(_LSP4_TOKEN_NAME_KEY, bytes(name_)); + ERC725YCore._setData(_LSP4_TOKEN_SYMBOL_KEY, bytes(symbol_)); + ERC725YCore._setData(_LSP4_TOKEN_TYPE_KEY, abi.encode(lsp4TokenType_)); + } + + /** + * @dev The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed + * via this function once the digital asset contract has been deployed. + */ + function _setData( + bytes32 dataKey, + bytes memory dataValue + ) internal virtual override(ERC725YCore, LSP4DigitalAssetMetadataCore) { + LSP4DigitalAssetMetadataCore._setData(dataKey, dataValue); + } +} diff --git a/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadataCore.sol b/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadataCore.sol new file mode 100644 index 000000000..17310ad8d --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadataCore.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +// modules +import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol"; + +// constants +import { + _LSP4_TOKEN_NAME_KEY, + _LSP4_TOKEN_SYMBOL_KEY, + _LSP4_TOKEN_TYPE_KEY +} from "./LSP4Constants.sol"; + +// errors +import { + LSP4TokenNameNotEditable, + LSP4TokenSymbolNotEditable, + LSP4TokenTypeNotEditable +} from "./LSP4Errors.sol"; + +/** + * @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store. + * @author Matthew Stevens + * @dev Standard Implementation of the LSP4 standard. + */ +abstract contract LSP4DigitalAssetMetadataCore is ERC725YCore { + /** + * @dev The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed + * via this function once the digital asset contract has been deployed. + */ + function _setData( + bytes32 dataKey, + bytes memory dataValue + ) internal virtual override { + if (dataKey == _LSP4_TOKEN_NAME_KEY) { + revert LSP4TokenNameNotEditable(); + } else if (dataKey == _LSP4_TOKEN_SYMBOL_KEY) { + revert LSP4TokenSymbolNotEditable(); + } else if (dataKey == _LSP4_TOKEN_TYPE_KEY) { + revert LSP4TokenTypeNotEditable(); + } else { + _store[dataKey] = dataValue; + + emit DataChanged(dataKey, dataValue); + } + } +} diff --git a/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadataInitAbstract.sol b/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadataInitAbstract.sol new file mode 100644 index 000000000..5c35af88e --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/contracts/LSP4DigitalAssetMetadataInitAbstract.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +// modules +import { + ERC725YInitAbstract +} from "@erc725/smart-contracts/contracts/ERC725YInitAbstract.sol"; + +import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol"; + +import {LSP4DigitalAssetMetadataCore} from "./LSP4DigitalAssetMetadataCore.sol"; + +// constants +import { + _LSP4_SUPPORTED_STANDARDS_KEY, + _LSP4_SUPPORTED_STANDARDS_VALUE, + _LSP4_TOKEN_NAME_KEY, + _LSP4_TOKEN_SYMBOL_KEY, + _LSP4_TOKEN_TYPE_KEY +} from "./LSP4Constants.sol"; + +/** + * @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store. + * @author Matthew Stevens + * @dev Inheritable Proxy Implementation of the LSP4 standard. + */ +abstract contract LSP4DigitalAssetMetadataInitAbstract is + LSP4DigitalAssetMetadataCore, + ERC725YInitAbstract +{ + /** + * @notice Initializing a digital asset `name_` with the `symbol_` symbol. + * + * @param name_ The name of the token + * @param symbol_ The symbol of the token + * @param initialOwner_ The owner of the token contract + * @param lsp4TokenType_ The type of token this digital asset contract represents (`1` = Token, `2` = NFT, `3` = Collection) + */ + function _initialize( + string memory name_, + string memory symbol_, + address initialOwner_, + uint256 lsp4TokenType_ + ) internal virtual onlyInitializing { + ERC725YInitAbstract._initialize(initialOwner_); + + // set data key SupportedStandards:LSP4DigitalAsset + ERC725YCore._setData( + _LSP4_SUPPORTED_STANDARDS_KEY, + _LSP4_SUPPORTED_STANDARDS_VALUE + ); + + ERC725YCore._setData(_LSP4_TOKEN_NAME_KEY, bytes(name_)); + ERC725YCore._setData(_LSP4_TOKEN_SYMBOL_KEY, bytes(symbol_)); + ERC725YCore._setData(_LSP4_TOKEN_TYPE_KEY, abi.encode(lsp4TokenType_)); + } + + /** + * @dev The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed + * via this function once the digital asset contract has been deployed. + */ + function _setData( + bytes32 dataKey, + bytes memory dataValue + ) internal virtual override(ERC725YCore, LSP4DigitalAssetMetadataCore) { + LSP4DigitalAssetMetadataCore._setData(dataKey, dataValue); + } +} diff --git a/packages/LSP4DigitalAssetMetadata/contracts/LSP4Errors.sol b/packages/LSP4DigitalAssetMetadata/contracts/LSP4Errors.sol new file mode 100644 index 000000000..9ecaa3e93 --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/contracts/LSP4Errors.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @dev Reverts when trying to edit the data key `LSP4TokenName` after the digital asset contract has been deployed / initialized. + * The `LSP4TokenName` data key is located inside the ERC725Y data key-value store of the digital asset contract. + * It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + */ +error LSP4TokenNameNotEditable(); + +/** + * @dev Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital asset contract has been deployed / initialized. + * The `LSP4TokenSymbol` data key is located inside the ERC725Y data key-value store of the digital asset contract. + * It can be set only once inside the constructor/initializer when the digital asset contract is being deployed / initialized. + */ +error LSP4TokenSymbolNotEditable(); + +/** + * @dev Reverts when trying to edit the data key `LSP4TokenType` after the digital asset contract has been deployed / initialized. + * The `LSP4TokenType` data key is located inside the ERC725Y data key-value store of the digital asset contract. + * It can be set only once inside the constructor / initializer when the digital asset contract is being deployed / initialized. + */ +error LSP4TokenTypeNotEditable(); diff --git a/packages/LSP4DigitalAssetMetadata/foundry.toml b/packages/LSP4DigitalAssetMetadata/foundry.toml new file mode 100644 index 000000000..aac84236b --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/foundry.toml @@ -0,0 +1,10 @@ +[profile.default] +src = 'contracts' +out = 'out' +libs = ['node_modules','lib'] +cache_path = 'forge-cache' +test = 'foundry' +solc_version = "0.8.17" +[fuzz] +runs = 10_000 +max_test_rejects = 200_000 diff --git a/packages/LSP4DigitalAssetMetadata/hardhat.config.ts b/packages/LSP4DigitalAssetMetadata/hardhat.config.ts new file mode 100644 index 000000000..d818a205d --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/hardhat.config.ts @@ -0,0 +1,128 @@ +import { HardhatUserConfig } from 'hardhat/config'; +import { NetworkUserConfig } from 'hardhat/types'; +import { config as dotenvConfig } from 'dotenv'; +import { resolve } from 'path'; + +/** + * this package includes: + * - @nomiclabs/hardhat-ethers + * - @nomicfoundation/hardhat-chai-matchers + * - @nomicfoundation/hardhat-network-helpers + * - @nomiclabs/hardhat-etherscan + * - hardhat-gas-reporter (is this true? Why do we have it as a separate dependency?) + * - @typechain/hardhat + * - solidity-coverage + */ +import '@nomicfoundation/hardhat-toolbox'; + +// additional hardhat plugins +import 'hardhat-packager'; +import 'hardhat-contract-sizer'; +import 'hardhat-deploy'; + +// custom built hardhat plugins and scripts +// can be imported here (e.g: docs generation, gas benchmark, etc...) + +dotenvConfig({ path: resolve(__dirname, './.env') }); + +function getTestnetChainConfig(): NetworkUserConfig { + const config: NetworkUserConfig = { + live: true, + url: 'https://rpc.testnet.lukso.network', + chainId: 4201, + }; + + if (process.env.CONTRACT_VERIFICATION_TESTNET_PK !== undefined) { + config['accounts'] = [process.env.CONTRACT_VERIFICATION_TESTNET_PK]; + } + + return config; +} + +const config: HardhatUserConfig = { + defaultNetwork: 'hardhat', + networks: { + hardhat: { + live: false, + saveDeployments: false, + allowBlocksWithSameTimestamp: true, + }, + luksoTestnet: getTestnetChainConfig(), + }, + namedAccounts: { + owner: 0, + }, + // uncomment if the contracts from this LSP package must be deployed at deterministic + // // addresses across multiple chains + // deterministicDeployment: { + // luksoTestnet: { + // // Nick Factory. See https://github.com/Arachnid/deterministic-deployment-proxy + // factory: '0x4e59b44847b379578588920ca78fbf26c0b4956c', + // deployer: '0x3fab184622dc19b6109349b94811493bf2a45362', + // funding: '0x0000000000000000000000000000000000000000000000000000000000000000', + // signedTx: + // '0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222', + // }, + // }, + etherscan: { + apiKey: 'no-api-key-needed', + customChains: [ + { + network: 'luksoTestnet', + chainId: 4201, + urls: { + apiURL: 'https://api.explorer.execution.testnet.lukso.network/api', + browserURL: 'https://explorer.execution.testnet.lukso.network/', + }, + }, + ], + }, + gasReporter: { + enabled: true, + currency: 'USD', + gasPrice: 21, + excludeContracts: ['Helpers/'], + src: './contracts', + showMethodSig: true, + }, + solidity: { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + /** + * Optimize for how many times you intend to run the code. + * Lower values will optimize more for initial deployment cost, higher + * values will optimize more for high-frequency usage. + * @see https://docs.soliditylang.org/en/v0.8.6/internals/optimizer.html#opcode-based-optimizer-module + */ + runs: 1000, + }, + outputSelection: { + '*': { + '*': ['storageLayout'], + }, + }, + }, + }, + packager: { + // What contracts to keep the artifacts and the bindings for. + contracts: [], + // Whether to include the TypeChain factories or not. + // If this is enabled, you need to run the TypeChain files through the TypeScript compiler before shipping to the registry. + includeFactories: true, + }, + paths: { + artifacts: 'artifacts', + tests: 'tests', + }, + typechain: { + outDir: 'types', + target: 'ethers-v5', + }, + mocha: { + timeout: 10000000, + }, +}; + +export default config; diff --git a/packages/LSP4DigitalAssetMetadata/package.json b/packages/LSP4DigitalAssetMetadata/package.json new file mode 100644 index 000000000..708957f2f --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/package.json @@ -0,0 +1,44 @@ +{ + "name": "lsp4", + "version": "0.12.1", + "description": "Package for the LSP4 Digital Asset Metadata standard", + "license": "Apache-2.0", + "author": "", + "keywords": [ + "LUKSO", + "LSP", + "Blockchain", + "Standards", + "Smart Contracts", + "Ethereum", + "EVM", + "Solidity" + ], + "scripts": { + "build": "hardhat compile --show-stack-traces", + "clean": "hardhat clean", + "format": "prettier --write .", + "lint": "eslint . --ext .ts,.js", + "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" + }, + "dependencies": { + "@erc725/smart-contracts": "^7.0.0" + }, + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^2.0.2", + "@typechain/ethers-v5": "^10.2.0", + "dotenv": "^16.0.3", + "eslint-config-custom": "*", + "ethers": "^5.7.2", + "hardhat": "^2.13.0", + "hardhat-contract-sizer": "^2.8.0", + "hardhat-deploy": "^0.11.25", + "hardhat-gas-reporter": "^1.0.9", + "hardhat-packager": "^1.4.2", + "solhint": "^3.3.6", + "ts-node": "^10.2.0", + "tsconfig": "*", + "typechain": "^8.0.0", + "typescript": "^4.9.5" + } +} diff --git a/packages/LSP4DigitalAssetMetadata/remappings.txt b/packages/LSP4DigitalAssetMetadata/remappings.txt new file mode 100644 index 000000000..ca89288f2 --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/remappings.txt @@ -0,0 +1,9 @@ +@erc725/smart-contracts/=node_modules/@erc725/smart-contracts/ +@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ +@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ +eth-gas-reporter/=node_modules/eth-gas-reporter/ +forge-std/=lib/forge-std/src/ +hardhat-deploy/=node_modules/hardhat-deploy/ +hardhat/=node_modules/hardhat/ +solidity-bytes-utils/=node_modules/solidity-bytes-utils/ +ds-test/=lib/forge-std/lib/ds-test/src/ diff --git a/packages/LSP4DigitalAssetMetadata/tsconfig.json b/packages/LSP4DigitalAssetMetadata/tsconfig.json new file mode 100644 index 000000000..b7a34e03f --- /dev/null +++ b/packages/LSP4DigitalAssetMetadata/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "tsconfig/contracts.json", + "include": ["**/*.ts"] +}