From dd514a4e6ab89e3089a7292a181e22029b7ed9c8 Mon Sep 17 00:00:00 2001 From: "b00ste.lyx" <62855857+b00ste@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:23:24 +0200 Subject: [PATCH] build!: move LSP7 in its own package (#865) --- .github/workflows/solc_version.yml | 2 + .mythx.yml | 12 +- .../LSP1UniversalReceiverDelegateUP.sol | 4 +- .../LSP1UniversalReceiverDelegateVault.sol | 4 +- contracts/Mocks/ERC165Interfaces.sol | 6 +- contracts/Mocks/LSP1TypeIDsTester.sol | 2 +- .../Tokens/LSP7CappedSupplyInitTester.sol | 4 +- .../Mocks/Tokens/LSP7CappedSupplyTester.sol | 6 +- contracts/Mocks/Tokens/LSP7InitTester.sol | 4 +- .../Mocks/Tokens/LSP7MintWhenDeployed.sol | 2 +- contracts/Mocks/Tokens/LSP7Tester.sol | 4 +- .../UniversalReceiverDelegateDataUpdater.sol | 4 +- ...niversalReceiverDelegateTokenReentrant.sol | 4 +- .../LSP7DigitalAsset/presets/LSP7Mintable.md | 1933 ---------------- .../lsp6/contracts/LSP6KeyManager.md | 1969 +++++++++++++++++ .../contracts}/LSP7DigitalAsset.md | 104 +- .../contracts}/extensions/LSP7Burnable.md | 106 +- .../contracts}/extensions/LSP7CappedSupply.md | 110 +- docs/libraries/lsp6/contracts/LSP6Utils.md | 254 +++ dodoc/config.ts | 19 +- package-lock.json | 56 + package.json | 1 + packages/LSP7DigitalAsset/.eslintrc.js | 4 + packages/LSP7DigitalAsset/.solhint.json | 25 + packages/LSP7DigitalAsset/README.md | 3 + .../contracts}/ILSP7DigitalAsset.sol | 0 .../contracts}/LSP7Constants.sol | 0 .../contracts}/LSP7DigitalAsset.sol | 0 .../contracts}/LSP7DigitalAssetCore.sol | 0 .../LSP7DigitalAssetInitAbstract.sol | 0 .../contracts}/LSP7Errors.sol | 0 .../contracts}/extensions/LSP7Burnable.sol | 0 .../extensions/LSP7BurnableInitAbstract.sol | 0 .../extensions/LSP7CappedSupply.sol | 0 .../LSP7CappedSupplyInitAbstract.sol | 0 .../contracts}/presets/ILSP7Mintable.sol | 0 .../contracts}/presets/LSP7Mintable.sol | 0 .../contracts}/presets/LSP7MintableInit.sol | 0 .../presets/LSP7MintableInitAbstract.sol | 0 packages/LSP7DigitalAsset/hardhat.config.ts | 128 ++ packages/LSP7DigitalAsset/package.json | 47 + packages/LSP7DigitalAsset/tsconfig.json | 4 + remappings.txt | 1 + tests/Benchmark.test.ts | 3 +- .../Interactions/AllowedFunctions.test.ts | 3 +- .../Interactions/AllowedStandards.test.ts | 3 +- .../Interactions/ERC725XExecuteBatch.test.ts | 2 +- .../PermissionTransferValue.test.ts | 3 +- .../Interactions/AllowedFunctions.test.ts | 3 +- .../Interactions/AllowedStandards.test.ts | 3 +- .../Interactions/BatchExecute.test.ts | 2 +- .../PermissionTransferValue.test.ts | 3 +- .../LSP6ControlledToken.test.ts | 3 +- .../Relay/ExecuteRelayCall.test.ts | 8 +- .../proxy/LSP7MintableInit.test.ts | 2 +- .../standard/LSP7Mintable.test.ts | 2 +- 56 files changed, 2705 insertions(+), 2157 deletions(-) delete mode 100644 docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md create mode 100644 docs/contracts/lsp6/contracts/LSP6KeyManager.md rename docs/contracts/{LSP7DigitalAsset => lsp7/contracts}/LSP7DigitalAsset.md (92%) rename docs/contracts/{LSP7DigitalAsset => lsp7/contracts}/extensions/LSP7Burnable.md (92%) rename docs/contracts/{LSP7DigitalAsset => lsp7/contracts}/extensions/LSP7CappedSupply.md (91%) create mode 100644 docs/libraries/lsp6/contracts/LSP6Utils.md create mode 100644 packages/LSP7DigitalAsset/.eslintrc.js create mode 100644 packages/LSP7DigitalAsset/.solhint.json create mode 100644 packages/LSP7DigitalAsset/README.md rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/ILSP7DigitalAsset.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/LSP7Constants.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/LSP7DigitalAsset.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/LSP7DigitalAssetCore.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/LSP7DigitalAssetInitAbstract.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/LSP7Errors.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/extensions/LSP7Burnable.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/extensions/LSP7BurnableInitAbstract.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/extensions/LSP7CappedSupply.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/extensions/LSP7CappedSupplyInitAbstract.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/presets/ILSP7Mintable.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/presets/LSP7Mintable.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/presets/LSP7MintableInit.sol (100%) rename {contracts/LSP7DigitalAsset => packages/LSP7DigitalAsset/contracts}/presets/LSP7MintableInitAbstract.sol (100%) create mode 100644 packages/LSP7DigitalAsset/hardhat.config.ts create mode 100644 packages/LSP7DigitalAsset/package.json create mode 100644 packages/LSP7DigitalAsset/tsconfig.json diff --git a/.github/workflows/solc_version.yml b/.github/workflows/solc_version.yml index 4d6915b51..1d482f890 100644 --- a/.github/workflows/solc_version.yml +++ b/.github/workflows/solc_version.yml @@ -87,6 +87,7 @@ jobs: lsp4/=packages/LSP4DigitalAssetMetadata/ \ lsp5/=packages/LSP5ReceivedAssets/ \ lsp6/=packages/LSP6KeyManager/ \ + lsp7/=packages/LSP7DigitalAsset/ \ lsp10/=packages/LSP10ReceivedVaults/ \ lsp14/=packages/LSP14Ownable2Step/ \ lsp17contractextension/=packages/LSP17ContractExtension/ \ @@ -102,6 +103,7 @@ jobs: lsp4/=packages/LSP4DigitalAssetMetadata/ \ lsp5/=packages/LSP5ReceivedAssets/ \ lsp6/=packages/LSP6KeyManager/ \ + lsp7/=packages/LSP7DigitalAsset/ \ lsp10/=packages/LSP10ReceivedVaults/ \ lsp14/=packages/LSP14Ownable2Step/ \ lsp17contractextension/=packages/LSP17ContractExtension/ \ diff --git a/.mythx.yml b/.mythx.yml index d4b73d415..acd22b26c 100644 --- a/.mythx.yml +++ b/.mythx.yml @@ -26,10 +26,10 @@ analyze: - contracts/LSP6KeyManager/LSP6KeyManager.sol # - Tokens & NFTs - lsp4/contracts/LSP4DigitalAssetMetadata.sol - - contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol - - contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol - - contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol - - contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol + - lsp7/contracts/LSP7DigitalAsset.sol + - lsp7/contracts/presets/LSP7Mintable.sol + - lsp7/contracts/extensions/LSP7Burnable.sol + - lsp7/contracts/extensions/LSP7CappedSupply.sol - contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol - contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol - contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol @@ -46,8 +46,8 @@ analyze: - lsp4/contracts/LSP4DigitalAssetMetadataInitAbstract.sol - contracts/LSP6KeyManager/LSP6KeyManagerInit.sol # - Tokens & NFTs - - contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol - - contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol + - lsp7/contracts/LSP7DigitalAssetInitAbstract.sol + - lsp7/contracts/presets/LSP7MintableInit.sol - contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol - contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol - contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol diff --git a/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol b/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol index 3d33eaa27..055957d2b 100644 --- a/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol +++ b/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol @@ -8,7 +8,7 @@ import { import { ILSP1UniversalReceiverDelegate } from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol"; -import {ILSP7DigitalAsset} from "../../LSP7DigitalAsset/ILSP7DigitalAsset.sol"; +import {ILSP7DigitalAsset} from "lsp7/contracts/ILSP7DigitalAsset.sol"; // modules import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; @@ -27,7 +27,7 @@ import { _TYPEID_LSP7_TOKENSSENDER, _TYPEID_LSP7_TOKENSRECIPIENT, _INTERFACEID_LSP7 -} from "../../LSP7DigitalAsset/LSP7Constants.sol"; +} from "lsp7/contracts/LSP7Constants.sol"; import { _TYPEID_LSP8_TOKENSSENDER, _TYPEID_LSP8_TOKENSRECIPIENT, diff --git a/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol b/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol index d36989886..2c9371021 100644 --- a/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol +++ b/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol @@ -8,7 +8,7 @@ import { import { ILSP1UniversalReceiverDelegate } from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol"; -import {ILSP7DigitalAsset} from "../../LSP7DigitalAsset/ILSP7DigitalAsset.sol"; +import {ILSP7DigitalAsset} from "lsp7/contracts/ILSP7DigitalAsset.sol"; // modules import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; @@ -23,7 +23,7 @@ import { _TYPEID_LSP7_TOKENSSENDER, _TYPEID_LSP7_TOKENSRECIPIENT, _INTERFACEID_LSP7 -} from "../../LSP7DigitalAsset/LSP7Constants.sol"; +} from "lsp7/contracts/LSP7Constants.sol"; import { _TYPEID_LSP8_TOKENSSENDER, _TYPEID_LSP8_TOKENSRECIPIENT, diff --git a/contracts/Mocks/ERC165Interfaces.sol b/contracts/Mocks/ERC165Interfaces.sol index 4fd49b7de..21178971b 100644 --- a/contracts/Mocks/ERC165Interfaces.sol +++ b/contracts/Mocks/ERC165Interfaces.sol @@ -38,9 +38,7 @@ import { } from "lsp1/contracts/ILSP1UniversalReceiverDelegate.sol"; import {ILSP6KeyManager as ILSP6} from "lsp6/contracts/ILSP6KeyManager.sol"; -import { - ILSP7DigitalAsset as ILSP7 -} from "../LSP7DigitalAsset/ILSP7DigitalAsset.sol"; +import {ILSP7DigitalAsset as ILSP7} from "lsp7/contracts/ILSP7DigitalAsset.sol"; import { ILSP8IdentifiableDigitalAsset as ILSP8 } from "../LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol"; @@ -66,7 +64,7 @@ import { _INTERFACEID_LSP1_DELEGATE } from "lsp1/contracts/LSP1Constants.sol"; import {_INTERFACEID_LSP6} from "lsp6/contracts/LSP6Constants.sol"; -import {_INTERFACEID_LSP7} from "../LSP7DigitalAsset/LSP7Constants.sol"; +import {_INTERFACEID_LSP7} from "lsp7/contracts/LSP7Constants.sol"; import { _INTERFACEID_LSP8 } from "../LSP8IdentifiableDigitalAsset/LSP8Constants.sol"; diff --git a/contracts/Mocks/LSP1TypeIDsTester.sol b/contracts/Mocks/LSP1TypeIDsTester.sol index c2bab121e..8a81aa268 100644 --- a/contracts/Mocks/LSP1TypeIDsTester.sol +++ b/contracts/Mocks/LSP1TypeIDsTester.sol @@ -11,7 +11,7 @@ import { _TYPEID_LSP7_TOKENSSENDER, _TYPEID_LSP7_TOKENSRECIPIENT, _TYPEID_LSP7_TOKENOPERATOR -} from "../LSP7DigitalAsset/LSP7Constants.sol"; +} from "lsp7/contracts/LSP7Constants.sol"; import { _TYPEID_LSP8_TOKENSSENDER, _TYPEID_LSP8_TOKENSRECIPIENT, diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol b/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol index 0e9c44e1b..8b49503fb 100644 --- a/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol +++ b/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol @@ -5,10 +5,10 @@ pragma solidity ^0.8.4; // modules import { LSP7DigitalAssetInitAbstract -} from "../../LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol"; +} from "lsp7/contracts/LSP7DigitalAssetInitAbstract.sol"; import { LSP7CappedSupplyInitAbstract -} from "../../LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol"; +} from "lsp7/contracts/extensions/LSP7CappedSupplyInitAbstract.sol"; contract LSP7CappedSupplyInitTester is LSP7CappedSupplyInitAbstract { function initialize( diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol b/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol index de76f80d2..914962744 100644 --- a/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol +++ b/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol @@ -3,10 +3,8 @@ pragma solidity ^0.8.4; // modules -import {LSP7DigitalAsset} from "../../LSP7DigitalAsset/LSP7DigitalAsset.sol"; -import { - LSP7CappedSupply -} from "../../LSP7DigitalAsset/extensions/LSP7CappedSupply.sol"; +import {LSP7DigitalAsset} from "lsp7/contracts/LSP7DigitalAsset.sol"; +import {LSP7CappedSupply} from "lsp7/contracts/extensions/LSP7CappedSupply.sol"; contract LSP7CappedSupplyTester is LSP7CappedSupply { constructor( diff --git a/contracts/Mocks/Tokens/LSP7InitTester.sol b/contracts/Mocks/Tokens/LSP7InitTester.sol index 731591bd1..3e3883802 100644 --- a/contracts/Mocks/Tokens/LSP7InitTester.sol +++ b/contracts/Mocks/Tokens/LSP7InitTester.sol @@ -5,10 +5,10 @@ pragma solidity ^0.8.4; // modules import { LSP7DigitalAssetInitAbstract -} from "../../LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol"; +} from "lsp7/contracts/LSP7DigitalAssetInitAbstract.sol"; import { LSP7BurnableInitAbstract -} from "../../LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol"; +} from "lsp7/contracts/extensions/LSP7BurnableInitAbstract.sol"; contract LSP7InitTester is LSP7DigitalAssetInitAbstract, diff --git a/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol b/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol index f90f5daf8..a98fd1c21 100644 --- a/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol +++ b/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.4; -import {LSP7DigitalAsset} from "../../LSP7DigitalAsset/LSP7DigitalAsset.sol"; +import {LSP7DigitalAsset} from "lsp7/contracts/LSP7DigitalAsset.sol"; contract LSP7MintWhenDeployed is LSP7DigitalAsset { constructor( diff --git a/contracts/Mocks/Tokens/LSP7Tester.sol b/contracts/Mocks/Tokens/LSP7Tester.sol index 76a1a4404..2a79e2861 100644 --- a/contracts/Mocks/Tokens/LSP7Tester.sol +++ b/contracts/Mocks/Tokens/LSP7Tester.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.4; // modules -import {LSP7DigitalAsset} from "../../LSP7DigitalAsset/LSP7DigitalAsset.sol"; -import {LSP7Burnable} from "../../LSP7DigitalAsset/extensions/LSP7Burnable.sol"; +import {LSP7DigitalAsset} from "lsp7/contracts/LSP7DigitalAsset.sol"; +import {LSP7Burnable} from "lsp7/contracts/extensions/LSP7Burnable.sol"; contract LSP7Tester is LSP7DigitalAsset, LSP7Burnable { constructor( diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol b/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol index 8ca1736e2..0a1a43aa2 100644 --- a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol +++ b/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol @@ -15,9 +15,7 @@ import { } from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; // constants -import { - _TYPEID_LSP7_TOKENSSENDER -} from "../../LSP7DigitalAsset/LSP7Constants.sol"; +import {_TYPEID_LSP7_TOKENSSENDER} from "lsp7/contracts/LSP7Constants.sol"; import {_INTERFACEID_LSP1_DELEGATE} from "lsp1/contracts/LSP1Constants.sol"; diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol b/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol index c5c447aff..4f59f66b4 100644 --- a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol +++ b/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol @@ -18,9 +18,7 @@ import { } from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol"; // constants -import { - _TYPEID_LSP7_TOKENSRECIPIENT -} from "../../LSP7DigitalAsset/LSP7Constants.sol"; +import {_TYPEID_LSP7_TOKENSRECIPIENT} from "lsp7/contracts/LSP7Constants.sol"; import { _TYPEID_LSP8_TOKENSRECIPIENT diff --git a/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md b/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md deleted file mode 100644 index 55f7a58aa..000000000 --- a/docs/contracts/LSP7DigitalAsset/presets/LSP7Mintable.md +++ /dev/null @@ -1,1933 +0,0 @@ - - - -# LSP7Mintable - -:::info Standard Specifications - -[`LSP-7-DigitalAsset`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md) - -::: -:::info Solidity implementation - -[`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - -::: - -> LSP7DigitalAsset deployable preset contract with a public [`mint`](#mint) function callable only by the contract [`owner`](#owner). - -## Public Methods - -Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. -When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. - -### constructor - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#constructor) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - -::: - -```solidity -constructor( - string name_, - string symbol_, - address newOwner_, - uint256 lsp4TokenType_, - bool isNonDivisible_ -); -``` - -_Deploying a `LSP7Mintable` token contract with: token name = `name_`, token symbol = `symbol_`, and address `newOwner_` as the token contract owner._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | :-------: | ---------------------------------------------------------------------------------------------------- | -| `name_` | `string` | The name of the token. | -| `symbol_` | `string` | The symbol of the token. | -| `newOwner_` | `address` | The owner of the token contract. | -| `lsp4TokenType_` | `uint256` | The type of token this digital asset contract represents (`0` = Token, `1` = NFT, `2` = Collection). | -| `isNonDivisible_` | `bool` | Specify if the LSP7 token is a fungible or non-fungible token. | - -
- -### fallback - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#fallback) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - -::: - -```solidity -fallback(bytes calldata callData) external payable returns (bytes memory); -``` - -_The `fallback` function was called with the following amount of native tokens: `msg.value`; and the following calldata: `callData`._ - -Achieves the goal of [LSP-17-ContractExtension] standard by extending the contract to handle calls of functions that do not exist natively, -forwarding the function call to the extension address mapped to the function being called. -This function is executed when: - -- Sending data of length less than 4 bytes to the contract. - -- The first 4 bytes of the calldata do not match any publicly callable functions from the contract ABI. - -- Receiving native tokens - -1. If the data is equal or longer than 4 bytes, the [ERC-725Y] storage is queried with the following data key: [_LSP17_EXTENSION_PREFIX] + `bytes4(msg.sig)` (Check [LSP-2-ERC725YJSONSchema] for encoding the data key) - -- If there is no address stored under the following data key, revert with [`NoExtensionFoundForFunctionSelector(bytes4)`](#noextensionfoundforfunctionselector). The data key relative to `bytes4(0)` is an exception, where no reverts occurs if there is no extension address stored under. This exception is made to allow users to send random data (graffiti) to the account and to be able to react on it. - -- If there is an address, forward the `msg.data` to the extension using the CALL opcode, appending 52 bytes (20 bytes of `msg.sender` and 32 bytes of `msg.value`). Return what the calls returns, or revert if the call failed. - -2. If the data sent to this function is of length less than 4 bytes (not a function selector), revert. - -
- -### receive - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#receive) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) - -::: - -```solidity -receive() external payable; -``` - -_LSP7 contract cannot receive native tokens._ - -Reverts whenever someone tries to send native tokens to a LSP7 contract. - -
- -### authorizeOperator - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `authorizeOperator(address,uint256,bytes)` -- Function selector: `0xb49506fd` - -::: - -:::danger - -To avoid front-running and Allowance Double-Spend Exploit when increasing or decreasing the authorized amount of an operator, it is advised to use the [`increaseAllowance`](#increaseallowance) and [`decreaseAllowance`](#decreaseallowance) functions. For more information, see: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/ - -::: - -```solidity -function authorizeOperator( - address operator, - uint256 amount, - bytes operatorNotificationData -) external nonpayable; -``` - -Sets an `amount` of tokens that an `operator` has access from the caller's balance (allowance). See [`authorizedAmountFor`](#authorizedamountfor). Notify the operator based on the LSP1-UniversalReceiver standard - -#### Parameters - -| Name | Type | Description | -| -------------------------- | :-------: | ------------------------------------------------------ | -| `operator` | `address` | The address to authorize as an operator. | -| `amount` | `uint256` | The allowance amount of tokens operator has access to. | -| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. | - -
- -### authorizedAmountFor - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `authorizedAmountFor(address,address)` -- Function selector: `0x65aeaa95` - -::: - -```solidity -function authorizedAmountFor( - address operator, - address tokenOwner -) external view returns (uint256); -``` - -Get the amount of tokens `operator` address has access to from `tokenOwner`. Operators can send and burn tokens on behalf of their owners. - -#### Parameters - -| Name | Type | Description | -| ------------ | :-------: | ---------------------------------------------------------- | -| `operator` | `address` | The operator's address to query the authorized amount for. | -| `tokenOwner` | `address` | The token owner that `operator` has allowance on. | - -#### Returns - -| Name | Type | Description | -| ---- | :-------: | --------------------------------------------------------------------------------------- | -| `0` | `uint256` | The amount of tokens the `operator`'s address has access on the `tokenOwner`'s balance. | - -
- -### balanceOf - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `balanceOf(address)` -- Function selector: `0x70a08231` - -::: - -```solidity -function balanceOf(address tokenOwner) external view returns (uint256); -``` - -Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [`decimals`](#decimals) function returns `18`), the amount returned should be divided by 1e18 to get a better picture of the actual balance of the `tokenOwner`. _Example:_ `balanceOf(someAddress) -> 42_000_000_000_000_000_000 / 1e18 = 42 tokens` - -#### Parameters - -| Name | Type | Description | -| ------------ | :-------: | --------------------------------------------------------- | -| `tokenOwner` | `address` | The address of the token holder to query the balance for. | - -#### Returns - -| Name | Type | Description | -| ---- | :-------: | ------------------------------------------- | -| `0` | `uint256` | The amount of tokens owned by `tokenOwner`. | - -
- -### batchCalls - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#batchcalls) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `batchCalls(bytes[])` -- Function selector: `0x6963d438` - -::: - -:::info - -It's not possible to send value along the functions call due to the use of `delegatecall`. - -::: - -```solidity -function batchCalls(bytes[] data) external nonpayable returns (bytes[] results); -``` - -_Executing the following batch of abi-encoded function calls on the contract: `data`._ - -Allows a caller to batch different function calls in one call. Perform a `delegatecall` on self, to call different functions with preserving the context. - -#### Parameters - -| Name | Type | Description | -| ------ | :-------: | -------------------------------------------------------------------- | -| `data` | `bytes[]` | An array of ABI encoded function calls to be called on the contract. | - -#### Returns - -| Name | Type | Description | -| --------- | :-------: | ---------------------------------------------------------------- | -| `results` | `bytes[]` | An array of abi-encoded data returned by the functions executed. | - -
- -### decimals - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `decimals()` -- Function selector: `0x313ce567` - -::: - -```solidity -function decimals() external view returns (uint8); -``` - -Returns the number of decimals used to get its user representation. If the asset contract has been set to be non-divisible via the `isNonDivisible_` parameter in the `constructor`, the decimals returned wiil be `0`. Otherwise `18` is the common value. - -#### Returns - -| Name | Type | Description | -| ---- | :-----: | ----------------------------------------------------------------------- | -| `0` | `uint8` | the number of decimals. If `0` is returned, the asset is non-divisible. | - -
- -### decreaseAllowance - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `decreaseAllowance(address,uint256,bytes)` -- Function selector: `0x7b204c4e` - -::: - -```solidity -function decreaseAllowance( - address operator, - uint256 subtractedAmount, - bytes operatorNotificationData -) external nonpayable; -``` - -_Decrease the allowance of `operator` by -`subtractedAmount`_ - -Atomically decreases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard - -#### Parameters - -| Name | Type | Description | -| -------------------------- | :-------: | ------------------------------------------------------ | -| `operator` | `address` | The operator to decrease allowance for `msg.sender` | -| `subtractedAmount` | `uint256` | The amount to decrease by in the operator's allowance. | -| `operatorNotificationData` | `bytes` | - | - -
- -### getData - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `getData(bytes32)` -- Function selector: `0x54f6127f` - -::: - -```solidity -function getData(bytes32 dataKey) external view returns (bytes dataValue); -``` - -_Reading the ERC725Y storage for data key `dataKey` returned the following value: `dataValue`._ - -Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey`. - -#### Parameters - -| Name | Type | Description | -| --------- | :-------: | --------------------------------------------- | -| `dataKey` | `bytes32` | The data key for which to retrieve the value. | - -#### Returns - -| Name | Type | Description | -| ----------- | :-----: | ---------------------------------------------------- | -| `dataValue` | `bytes` | The bytes value stored under the specified data key. | - -
- -### getDataBatch - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `getDataBatch(bytes32[])` -- Function selector: `0xdedff9c6` - -::: - -```solidity -function getDataBatch( - bytes32[] dataKeys -) external view returns (bytes[] dataValues); -``` - -_Reading the ERC725Y storage for data keys `dataKeys` returned the following values: `dataValues`._ - -Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys`. - -#### Parameters - -| Name | Type | Description | -| ---------- | :---------: | ------------------------------------------ | -| `dataKeys` | `bytes32[]` | The array of keys which values to retrieve | - -#### Returns - -| Name | Type | Description | -| ------------ | :-------: | ----------------------------------------- | -| `dataValues` | `bytes[]` | The array of data stored at multiple keys | - -
- -### getOperatorsOf - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `getOperatorsOf(address)` -- Function selector: `0xd72fc29a` - -::: - -```solidity -function getOperatorsOf(address tokenOwner) external view returns (address[]); -``` - -Returns all `operator` addresses that are allowed to transfer or burn on behalf of `tokenOwner`. - -#### Parameters - -| Name | Type | Description | -| ------------ | :-------: | ----------------------------------------- | -| `tokenOwner` | `address` | The token owner to get the operators for. | - -#### Returns - -| Name | Type | Description | -| ---- | :---------: | ----------------------------------------------------------------------------------- | -| `0` | `address[]` | An array of operators allowed to transfer or burn tokens on behalf of `tokenOwner`. | - -
- -### increaseAllowance - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `increaseAllowance(address,uint256,bytes)` -- Function selector: `0x2bc1da82` - -::: - -```solidity -function increaseAllowance( - address operator, - uint256 addedAmount, - bytes operatorNotificationData -) external nonpayable; -``` - -_Increase the allowance of `operator` by +`addedAmount`_ - -Atomically increases the allowance granted to `operator` by the caller. This is an alternative approach to [`authorizeOperator`](#authorizeoperator) that can be used as a mitigation for the double spending allowance problem. Notify the operator based on the LSP1-UniversalReceiver standard - -#### Parameters - -| Name | Type | Description | -| -------------------------- | :-------: | ----------------------------------------------------------------------- | -| `operator` | `address` | The operator to increase the allowance for `msg.sender` | -| `addedAmount` | `uint256` | The additional amount to add on top of the current operator's allowance | -| `operatorNotificationData` | `bytes` | - | - -
- -### mint - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#mint) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `mint(address,uint256,bool,bytes)` -- Function selector: `0x7580d920` - -::: - -```solidity -function mint( - address to, - uint256 amount, - bool force, - bytes data -) external nonpayable; -``` - -Public [`_mint`](#_mint) function only callable by the [`owner`](#owner). - -#### Parameters - -| Name | Type | Description | -| -------- | :-------: | ----------- | -| `to` | `address` | - | -| `amount` | `uint256` | - | -| `force` | `bool` | - | -| `data` | `bytes` | - | - -
- -### owner - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `owner()` -- Function selector: `0x8da5cb5b` - -::: - -```solidity -function owner() external view returns (address); -``` - -Returns the address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | :-------: | ----------- | -| `0` | `address` | - | - -
- -### renounceOwnership - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `renounceOwnership()` -- Function selector: `0x715018a6` - -::: - -```solidity -function renounceOwnership() external nonpayable; -``` - -Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner. - -
- -### revokeOperator - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `revokeOperator(address,bool,bytes)` -- Function selector: `0x4521748e` - -::: - -```solidity -function revokeOperator( - address operator, - bool notify, - bytes operatorNotificationData -) external nonpayable; -``` - -Removes the `operator` address as an operator of callers tokens, disallowing it to send any amount of tokens on behalf of the token owner (the caller of the function `msg.sender`). See also [`authorizedAmountFor`](#authorizedamountfor). - -#### Parameters - -| Name | Type | Description | -| -------------------------- | :-------: | --------------------------------------------------------- | -| `operator` | `address` | The address to revoke as an operator. | -| `notify` | `bool` | Boolean indicating whether to notify the operator or not. | -| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. | - -
- -### setData - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `setData(bytes32,bytes)` -- Function selector: `0x7f23690c` - -::: - -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - -```solidity -function setData(bytes32 dataKey, bytes dataValue) external payable; -``` - -_Setting the following data key value pair in the ERC725Y storage. Data key: `dataKey`, data value: `dataValue`._ - -Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data key `dataKey`. The function is marked as payable to enable flexibility on child contracts. For instance to implement a fee mechanism for setting specific data. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner). - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event. - -
- -#### Parameters - -| Name | Type | Description | -| ----------- | :-------: | ------------------------------------------ | -| `dataKey` | `bytes32` | The data key for which to set a new value. | -| `dataValue` | `bytes` | The new bytes value to set. | - -
- -### setDataBatch - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `setDataBatch(bytes32[],bytes[])` -- Function selector: `0x97902421` - -::: - -:::caution Warning - -**Note for developers:** despite the fact that this function is set as `payable`, if the function is not intended to receive value (= native tokens), **an additional check should be implemented to ensure that `msg.value` sent was equal to 0**. - -::: - -```solidity -function setDataBatch(bytes32[] dataKeys, bytes[] dataValues) external payable; -``` - -_Setting the following data key value pairs in the ERC725Y storage. Data keys: `dataKeys`, data values: `dataValues`._ - -Batch data setting function that behaves the same as [`setData`](#setdata) but allowing to set multiple data key/value pairs in the ERC725Y storage in the same transaction. - -
- -**Requirements:** - -- SHOULD only be callable by the [`owner`](#owner) of the contract. - -
- -
- -**Emitted events:** - -- [`DataChanged`](#datachanged) event **for each data key/value pair set**. - -
- -#### Parameters - -| Name | Type | Description | -| ------------ | :---------: | ---------------------------------------------------- | -| `dataKeys` | `bytes32[]` | An array of data keys to set bytes values for. | -| `dataValues` | `bytes[]` | An array of bytes values to set for each `dataKeys`. | - -
- -### supportsInterface - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `supportsInterface(bytes4)` -- Function selector: `0x01ffc9a7` - -::: - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool); -``` - -Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas. - -#### Parameters - -| Name | Type | Description | -| ------------- | :------: | ----------- | -| `interfaceId` | `bytes4` | - | - -#### Returns - -| Name | Type | Description | -| ---- | :----: | ----------- | -| `0` | `bool` | - | - -
- -### totalSupply - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `totalSupply()` -- Function selector: `0x18160ddd` - -::: - -```solidity -function totalSupply() external view returns (uint256); -``` - -Returns the number of existing tokens that have been minted in this contract. - -#### Returns - -| Name | Type | Description | -| ---- | :-------: | ------------------------------ | -| `0` | `uint256` | The number of existing tokens. | - -
- -### transfer - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `transfer(address,address,uint256,bool,bytes)` -- Function selector: `0x760d9bba` - -::: - -```solidity -function transfer( - address from, - address to, - uint256 amount, - bool force, - bytes data -) external nonpayable; -``` - -Transfers an `amount` of tokens from the `from` address to the `to` address and notify both sender and recipients via the LSP1 [`universalReceiver(...)`](#`universalreceiver) function. If the tokens are transferred by an operator on behalf of a token holder, the allowance for the operator will be decreased by `amount` once the token transfer has been completed (See [`authorizedAmountFor`](#authorizedamountfor)). - -#### Parameters - -| Name | Type | Description | -| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address` | The sender address. | -| `to` | `address` | The recipient address. | -| `amount` | `uint256` | The amount of tokens to transfer. | -| `force` | `bool` | When set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | -| `data` | `bytes` | Any additional data the caller wants included in the emitted event, and sent in the hooks of the `from` and `to` addresses. | - -
- -### transferBatch - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` -- Function selector: `0x2d7667c9` - -::: - -```solidity -function transferBatch( - address[] from, - address[] to, - uint256[] amount, - bool[] force, - bytes[] data -) external nonpayable; -``` - -Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the arrays of `from`, `to`, `amount`. - -#### Parameters - -| Name | Type | Description | -| -------- | :---------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address[]` | An array of sending addresses. | -| `to` | `address[]` | An array of receiving addresses. | -| `amount` | `uint256[]` | An array of amount of tokens to transfer for each `from -> to` transfer. | -| `force` | `bool[]` | For each transfer, when set to `true`, the `to` address CAN be any address. When set to `false`, the `to` address MUST be a contract that supports the LSP1 UniversalReceiver standard. | -| `data` | `bytes[]` | An array of additional data the caller wants included in the emitted event, and sent in the hooks to `from` and `to` addresses. | - -
- -### transferOwnership - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Function signature: `transferOwnership(address)` -- Function selector: `0xf2fde38b` - -::: - -```solidity -function transferOwnership(address newOwner) external nonpayable; -``` - -Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner. - -#### Parameters - -| Name | Type | Description | -| ---------- | :-------: | ----------- | -| `newOwner` | `address` | - | - -
- -## Internal Methods - -Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. - -Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. - -### \_checkOwner - -```solidity -function _checkOwner() internal view; -``` - -Throws if the sender is not the owner. - -
- -### \_setOwner - -```solidity -function _setOwner(address newOwner) internal nonpayable; -``` - -Changes the owner if `newOwner` and oldOwner are different -This pattern is useful in inheritance. - -
- -### \_getData - -```solidity -function _getData(bytes32 dataKey) internal view returns (bytes dataValue); -``` - -Read the value stored under a specific `dataKey` inside the underlying ERC725Y storage, -represented as a mapping of `bytes32` data keys mapped to their `bytes` data values. - -```solidity -mapping(bytes32 => bytes) _store -``` - -#### Parameters - -| Name | Type | Description | -| --------- | :-------: | ----------------------------------------------------------------------- | -| `dataKey` | `bytes32` | A bytes32 data key to read the associated `bytes` value from the store. | - -#### Returns - -| Name | Type | Description | -| ----------- | :-----: | ----------------------------------------------------------------------------- | -| `dataValue` | `bytes` | The `bytes` value associated with the given `dataKey` in the ERC725Y storage. | - -
- -### \_setData - -```solidity -function _setData(bytes32 dataKey, bytes dataValue) internal nonpayable; -``` - -The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed -via this function once the digital asset contract has been deployed. - -
- -### \_updateOperator - -```solidity -function _updateOperator( - address tokenOwner, - address operator, - uint256 allowance, - bool notified, - bytes operatorNotificationData -) internal nonpayable; -``` - -Changes token `amount` the `operator` has access to from `tokenOwner` tokens. -If the amount is zero the operator is removed from the list of operators, otherwise he is added to the list of operators. -If the amount is zero then the operator is being revoked, otherwise the operator amount is being modified. - -#### Parameters - -| Name | Type | Description | -| -------------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- | -| `tokenOwner` | `address` | The address that will give `operator` an allowance for on its balance. | -| `operator` | `address` | @param operatorNotificationData The data to send to the universalReceiver function of the operator in case of notifying | -| `allowance` | `uint256` | The maximum amount of token that `operator` can spend from the `tokenOwner`'s balance. | -| `notified` | `bool` | Boolean indicating whether the operator has been notified about the change of allowance | -| `operatorNotificationData` | `bytes` | The data to send to the universalReceiver function of the operator in case of notifying | - -
- -### \_mint - -:::info - -Any logic in the: - -- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. - -- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the recipient via LSP1**. - -::: - -```solidity -function _mint( - address to, - uint256 amount, - bool force, - bytes data -) internal nonpayable; -``` - -Mints `amount` of tokens and transfers it to `to`. - -
- -**Emitted events:** - -- [`Transfer`](#transfer) event with `address(0)` as `from`. - -
- -#### Parameters - -| Name | Type | Description | -| -------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | -| `to` | `address` | The address to mint tokens for. | -| `amount` | `uint256` | The amount of tokens to mint. | -| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | -| `data` | `bytes` | Additional data the caller wants included in the emitted [`Transfer`](#transfer) event, and sent in the LSP1 hook to the `to` address. | - -
- -### \_burn - -:::info - -Any logic in the: - -- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. - -- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender via LSP1**. - -::: - -:::tip Hint - -In dApps, you can know which address is burning tokens by listening for the `Transfer` event and filter with the zero address as `to`. - -::: - -```solidity -function _burn(address from, uint256 amount, bytes data) internal nonpayable; -``` - -Burns (= destroys) `amount` of tokens, decrease the `from` balance. This is done by sending them to the zero address. -Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) -function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive -all the parameters in the calldata packed encoded. - -
- -**Emitted events:** - -- [`Transfer`](#transfer) event with `address(0)` as the `to` address - -
- -#### Parameters - -| Name | Type | Description | -| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address` | The address to burn tokens from its balance. | -| `amount` | `uint256` | The amount of tokens to burn. | -| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | - -
- -### \_spendAllowance - -```solidity -function _spendAllowance( - address operator, - address tokenOwner, - uint256 amountToSpend -) internal nonpayable; -``` - -Spend `amountToSpend` from the `operator`'s authorized on behalf of the `tokenOwner`. - -#### Parameters - -| Name | Type | Description | -| --------------- | :-------: | ------------------------------------------------------------------- | -| `operator` | `address` | The address of the operator to decrease the allowance of. | -| `tokenOwner` | `address` | The address that granted an allowance on its balance to `operator`. | -| `amountToSpend` | `uint256` | The amount of tokens to substract in allowance of `operator`. | - -
- -### \_transfer - -:::info - -Any logic in the: - -- [`_beforeTokenTransfer`](#_beforetokentransfer) function will run before updating the balances. - -- [`_afterTokenTransfer`](#_aftertokentransfer) function will run after updating the balances, **but before notifying the sender/recipient via LSP1**. - -::: - -```solidity -function _transfer( - address from, - address to, - uint256 amount, - bool force, - bytes data -) internal nonpayable; -``` - -Transfer tokens from `from` to `to` by decreasing the balance of `from` by `-amount` and increasing the balance -of `to` by `+amount`. -Both the sender and recipient will be notified of the token transfer through the LSP1 [`universalReceiver`](#universalreceiver) -function, if they are contracts that support the LSP1 interface. Their `universalReceiver` function will receive -all the parameters in the calldata packed encoded. - -
- -**Emitted events:** - -- [`Transfer`](#transfer) event. - -
- -#### Parameters - -| Name | Type | Description | -| -------- | :-------: | ------------------------------------------------------------------------------------------------------------------------- | -| `from` | `address` | The address to decrease the balance. | -| `to` | `address` | The address to increase the balance. | -| `amount` | `uint256` | The amount of tokens to transfer from `from` to `to`. | -| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | -| `data` | `bytes` | Additional data the caller wants included in the emitted event, and sent in the LSP1 hook to the `from` and `to` address. | - -
- -### \_beforeTokenTransfer - -```solidity -function _beforeTokenTransfer( - address from, - address to, - uint256 amount, - bytes data -) internal nonpayable; -``` - -Hook that is called before any token transfer, including minting and burning. -Allows to run custom logic before updating balances and notifiying sender/recipient by overriding this function. - -#### Parameters - -| Name | Type | Description | -| -------- | :-------: | ------------------------------------ | -| `from` | `address` | The sender address | -| `to` | `address` | The recipient address | -| `amount` | `uint256` | The amount of token to transfer | -| `data` | `bytes` | The data sent alongside the transfer | - -
- -### \_afterTokenTransfer - -```solidity -function _afterTokenTransfer( - address from, - address to, - uint256 amount, - bytes data -) internal nonpayable; -``` - -Hook that is called after any token transfer, including minting and burning. -Allows to run custom logic after updating balances, but **before notifiying sender/recipient** by overriding this function. - -#### Parameters - -| Name | Type | Description | -| -------- | :-------: | ------------------------------------ | -| `from` | `address` | The sender address | -| `to` | `address` | The recipient address | -| `amount` | `uint256` | The amount of token to transfer | -| `data` | `bytes` | The data sent alongside the transfer | - -
- -### \_notifyTokenOperator - -```solidity -function _notifyTokenOperator( - address operator, - bytes lsp1Data -) internal nonpayable; -``` - -Attempt to notify the operator `operator` about the `amount` tokens being authorized with. -This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENOPERATOR` as typeId, if `operator` is a contract that supports the LSP1 interface. -If `operator` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. - -#### Parameters - -| Name | Type | Description | -| ---------- | :-------: | ------------------------------------------------------------------------------ | -| `operator` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. | -| `lsp1Data` | `bytes` | the data to be sent to the `operator` address in the `universalReceiver` call. | - -
- -### \_notifyTokenSender - -```solidity -function _notifyTokenSender(address from, bytes lsp1Data) internal nonpayable; -``` - -Attempt to notify the token sender `from` about the `amount` of tokens being transferred. -This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSSENDER` as typeId, if `from` is a contract that supports the LSP1 interface. -If `from` is an EOA or a contract that does not support the LSP1 interface, nothing will happen and no notification will be sent. - -#### Parameters - -| Name | Type | Description | -| ---------- | :-------: | ------------------------------------------------------------------------------ | -| `from` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. | -| `lsp1Data` | `bytes` | the data to be sent to the `from` address in the `universalReceiver` call. | - -
- -### \_notifyTokenReceiver - -```solidity -function _notifyTokenReceiver( - address to, - bool force, - bytes lsp1Data -) internal nonpayable; -``` - -Attempt to notify the token receiver `to` about the `amount` tokens being received. -This is done by calling its [`universalReceiver`](#universalreceiver) function with the `_TYPEID_LSP7_TOKENSRECIPIENT` as typeId, if `to` is a contract that supports the LSP1 interface. -If `to` is is an EOA or a contract that does not support the LSP1 interface, the behaviour will depend on the `force` boolean flag. - -- if `force` is set to `true`, nothing will happen and no notification will be sent. - -- if `force` is set to `false, the transaction will revert. - -#### Parameters - -| Name | Type | Description | -| ---------- | :-------: | --------------------------------------------------------------------------------------------------- | -| `to` | `address` | The address to call the [`universalReceiver`](#universalreceiver) function on. | -| `force` | `bool` | A boolean that describe if transfer to a `to` address that does not support LSP1 is allowed or not. | -| `lsp1Data` | `bytes` | The data to be sent to the `to` address in the `universalReceiver(...)` call. | - -
- -### \_supportsInterfaceInERC165Extension - -```solidity -function _supportsInterfaceInERC165Extension( - bytes4 interfaceId -) internal view returns (bool); -``` - -Returns whether the interfaceId being checked is supported in the extension of the -[`supportsInterface`](#supportsinterface) selector. -To be used by extendable contracts wishing to extend the ERC165 interfaceIds originally -supported by reading whether the interfaceId queried is supported in the `supportsInterface` -extension if the extension is set, if not it returns false. - -
- -### \_getExtensionAndForwardValue - -```solidity -function _getExtensionAndForwardValue( - bytes4 functionSelector -) internal view returns (address, bool); -``` - -Returns the extension address stored under the following data key: - -- [`_LSP17_EXTENSION_PREFIX`](#_lsp17_extension_prefix) + `` (Check [LSP2-ERC725YJSONSchema] for encoding the data key). - -- If no extension is stored, returns the address(0). - -- we do not check that payable bool as in lsp7 standard we will always forward the value to the extension - -
- -### \_fallbackLSP17Extendable - -:::info - -The LSP7 Token contract should not hold any native tokens. Any native tokens received by the contract -will be forwarded to the extension address mapped to the selector from `msg.sig`. - -::: - -```solidity -function _fallbackLSP17Extendable( - bytes callData -) internal nonpayable returns (bytes); -``` - -Forwards the call with the received value to an extension mapped to a function selector. -Calls [`_getExtensionAndForwardValue`](#_getextensionandforwardvalue) to get the address of the extension mapped to the function selector being -called on the account. If there is no extension, the address(0) will be returned. -Forwards the value if the extension is payable. -Reverts if there is no extension for the function being called. -If there is an extension for the function selector being called, it calls the extension with the -CALL opcode, passing the [`msg.data`](#msg.data) appended with the 20 bytes of the [`msg.sender`](#msg.sender) and -32 bytes of the [`msg.value`](#msg.value) - -
- -## Events - -### DataChanged - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Event signature: `DataChanged(bytes32,bytes)` -- Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` - -::: - -```solidity -event DataChanged(bytes32 indexed dataKey, bytes dataValue); -``` - -_The following data key/value pair has been changed in the ERC725Y storage: Data key: `dataKey`, data value: `dataValue`._ - -Emitted when data at a specific `dataKey` was changed to a new value `dataValue`. - -#### Parameters - -| Name | Type | Description | -| ----------------------- | :-------: | -------------------------------------------- | -| `dataKey` **`indexed`** | `bytes32` | The data key for which a bytes value is set. | -| `dataValue` | `bytes` | The value to set for the given data key. | - -
- -### OperatorAuthorizationChanged - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)` -- Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d` - -::: - -```solidity -event OperatorAuthorizationChanged( - address indexed operator, - address indexed tokenOwner, - uint256 indexed amount, - bytes operatorNotificationData -); -``` - -Emitted when `tokenOwner` enables `operator` for `amount` tokens. - -#### Parameters - -| Name | Type | Description | -| -------------------------- | :-------: | ----------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address authorized as an operator | -| `tokenOwner` **`indexed`** | `address` | The token owner | -| `amount` **`indexed`** | `uint256` | The amount of tokens `operator` address has access to from `tokenOwner` | -| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. | - -
- -### OperatorRevoked - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Event signature: `OperatorRevoked(address,address,bool,bytes)` -- Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167` - -::: - -```solidity -event OperatorRevoked( - address indexed operator, - address indexed tokenOwner, - bool indexed notified, - bytes operatorNotificationData -); -``` - -Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [`authorizedAmountFor(...)`](#`authorizedamountfor) to `0`. - -#### Parameters - -| Name | Type | Description | -| -------------------------- | :-------: | ------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address revoked from operating | -| `tokenOwner` **`indexed`** | `address` | The token owner | -| `notified` **`indexed`** | `bool` | Bool indicating whether the operator has been notified or not | -| `operatorNotificationData` | `bytes` | The data to notify the operator about via LSP1. | - -
- -### OwnershipTransferred - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Event signature: `OwnershipTransferred(address,address)` -- Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` - -::: - -```solidity -event OwnershipTransferred( - address indexed previousOwner, - address indexed newOwner -); -``` - -#### Parameters - -| Name | Type | Description | -| ----------------------------- | :-------: | ----------- | -| `previousOwner` **`indexed`** | `address` | - | -| `newOwner` **`indexed`** | `address` | - | - -
- -### Transfer - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Event signature: `Transfer(address,address,address,uint256,bool,bytes)` -- Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` - -::: - -```solidity -event Transfer( - address indexed operator, - address indexed from, - address indexed to, - uint256 amount, - bool force, - bytes data -); -``` - -Emitted when the `from` transferred successfully `amount` of tokens to `to`. - -#### Parameters - -| Name | Type | Description | -| ------------------------ | :-------: | ---------------------------------------------------------------------------------------------------------------------------- | -| `operator` **`indexed`** | `address` | The address of the operator that executed the transfer. | -| `from` **`indexed`** | `address` | The address which tokens were sent from (balance decreased by `-amount`). | -| `to` **`indexed`** | `address` | The address that received the tokens (balance increased by `+amount`). | -| `amount` | `uint256` | The amount of tokens transferred. | -| `force` | `bool` | if the transferred enforced the `to` recipient address to be a contract that implements the LSP1 standard or not. | -| `data` | `bytes` | Any additional data included by the caller during the transfer, and sent in the LSP1 hooks to the `from` and `to` addresses. | - -
- -## Errors - -### ERC725Y_DataKeysValuesEmptyArray - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `ERC725Y_DataKeysValuesEmptyArray()` -- Error hash: `0x97da5f95` - -::: - -```solidity -error ERC725Y_DataKeysValuesEmptyArray(); -``` - -Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabatch) function is an empty array. - -
- -### ERC725Y_DataKeysValuesLengthMismatch - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` -- Error hash: `0x3bcc8979` - -::: - -```solidity -error ERC725Y_DataKeysValuesLengthMismatch(); -``` - -Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. - -
- -### ERC725Y_MsgValueDisallowed - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `ERC725Y_MsgValueDisallowed()` -- Error hash: `0xf36ba737` - -::: - -```solidity -error ERC725Y_MsgValueDisallowed(); -``` - -Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#setdatabatch) function. - -
- -### InvalidExtensionAddress - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `InvalidExtensionAddress(bytes)` -- Error hash: `0x42bfe79f` - -::: - -```solidity -error InvalidExtensionAddress(bytes storedData); -``` - -reverts when the bytes retrieved from the LSP17 data key is not a valid address (not 20 bytes) - -#### Parameters - -| Name | Type | Description | -| ------------ | :-----: | ----------- | -| `storedData` | `bytes` | - | - -
- -### InvalidFunctionSelector - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `InvalidFunctionSelector(bytes)` -- Error hash: `0xe5099ee3` - -::: - -```solidity -error InvalidFunctionSelector(bytes data); -``` - -reverts when the contract is called with a function selector not valid (less than 4 bytes of data) - -#### Parameters - -| Name | Type | Description | -| ------ | :-----: | ----------- | -| `data` | `bytes` | - | - -
- -### LSP4TokenNameNotEditable - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP4TokenNameNotEditable()` -- Error hash: `0x85c169bd` - -::: - -```solidity -error LSP4TokenNameNotEditable(); -``` - -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. - -
- -### LSP4TokenSymbolNotEditable - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP4TokenSymbolNotEditable()` -- Error hash: `0x76755b38` - -::: - -```solidity -error LSP4TokenSymbolNotEditable(); -``` - -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. - -
- -### LSP4TokenTypeNotEditable - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP4TokenTypeNotEditable()` -- Error hash: `0x4ef6d7fb` - -::: - -```solidity -error LSP4TokenTypeNotEditable(); -``` - -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. - -
- -### LSP7AmountExceedsAuthorizedAmount - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` -- Error hash: `0xf3a6b691` - -::: - -```solidity -error LSP7AmountExceedsAuthorizedAmount( - address tokenOwner, - uint256 authorizedAmount, - address operator, - uint256 amount -); -``` - -reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than the `authorizedAmount`. - -#### Parameters - -| Name | Type | Description | -| ------------------ | :-------: | ----------- | -| `tokenOwner` | `address` | - | -| `authorizedAmount` | `uint256` | - | -| `operator` | `address` | - | -| `amount` | `uint256` | - | - -
- -### LSP7AmountExceedsBalance - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` -- Error hash: `0x08d47949` - -::: - -```solidity -error LSP7AmountExceedsBalance( - uint256 balance, - address tokenOwner, - uint256 amount -); -``` - -reverts when sending an `amount` of tokens larger than the current `balance` of the `tokenOwner`. - -#### Parameters - -| Name | Type | Description | -| ------------ | :-------: | ----------- | -| `balance` | `uint256` | - | -| `tokenOwner` | `address` | - | -| `amount` | `uint256` | - | - -
- -### LSP7BatchCallFailed - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7BatchCallFailed(uint256)` -- Error hash: `0xb774c284` - -::: - -```solidity -error LSP7BatchCallFailed(uint256 callIndex); -``` - -_Batch call failed._ - -Reverts when a batch call failed. - -#### Parameters - -| Name | Type | Description | -| ----------- | :-------: | ----------- | -| `callIndex` | `uint256` | - | - -
- -### LSP7CannotSendToSelf - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7CannotSendToSelf()` -- Error hash: `0xb9afb000` - -::: - -```solidity -error LSP7CannotSendToSelf(); -``` - -reverts when specifying the same address for `from` or `to` in a token transfer. - -
- -### LSP7CannotSendWithAddressZero - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7CannotSendWithAddressZero()` -- Error hash: `0xd2d5ec30` - -::: - -```solidity -error LSP7CannotSendWithAddressZero(); -``` - -reverts when trying to: - -- mint tokens to the zero address. - -- burn tokens from the zero address. - -- transfer tokens from or to the zero address. - -
- -### LSP7CannotUseAddressZeroAsOperator - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7CannotUseAddressZeroAsOperator()` -- Error hash: `0x6355e766` - -::: - -```solidity -error LSP7CannotUseAddressZeroAsOperator(); -``` - -reverts when trying to set the zero address as an operator. - -
- -### LSP7DecreasedAllowanceBelowZero - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7DecreasedAllowanceBelowZero()` -- Error hash: `0x0ef76c35` - -::: - -```solidity -error LSP7DecreasedAllowanceBelowZero(); -``` - -Reverts when trying to decrease an operator's allowance to more than its current allowance. - -
- -### LSP7InvalidTransferBatch - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7InvalidTransferBatch()` -- Error hash: `0x263eee8d` - -::: - -```solidity -error LSP7InvalidTransferBatch(); -``` - -reverts when the array parameters used in [`transferBatch`](#transferbatch) have different lengths. - -
- -### LSP7NotifyTokenReceiverContractMissingLSP1Interface - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` -- Error hash: `0xa608fbb6` - -::: - -```solidity -error LSP7NotifyTokenReceiverContractMissingLSP1Interface( - address tokenReceiver -); -``` - -reverts if the `tokenReceiver` does not implement LSP1 when minting or transferring tokens with `bool force` set as `false`. - -#### Parameters - -| Name | Type | Description | -| --------------- | :-------: | ----------- | -| `tokenReceiver` | `address` | - | - -
- -### LSP7NotifyTokenReceiverIsEOA - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` -- Error hash: `0x26c247f4` - -::: - -```solidity -error LSP7NotifyTokenReceiverIsEOA(address tokenReceiver); -``` - -reverts if the `tokenReceiver` is an EOA when minting or transferring tokens with `bool force` set as `false`. - -#### Parameters - -| Name | Type | Description | -| --------------- | :-------: | ----------- | -| `tokenReceiver` | `address` | - | - -
- -### LSP7TokenContractCannotHoldValue - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7TokenContractCannotHoldValue()` -- Error hash: `0x388f5adc` - -::: - -```solidity -error LSP7TokenContractCannotHoldValue(); -``` - -_LSP7 contract cannot receive native tokens._ - -Error occurs when sending native tokens to the LSP7 contract without sending any data. E.g. Sending value without passing a bytes4 function selector to call a LSP17 Extension. - -
- -### LSP7TokenOwnerCannotBeOperator - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `LSP7TokenOwnerCannotBeOperator()` -- Error hash: `0xdab75047` - -::: - -```solidity -error LSP7TokenOwnerCannotBeOperator(); -``` - -reverts when trying to authorize or revoke the token's owner as an operator. - -
- -### NoExtensionFoundForFunctionSelector - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `NoExtensionFoundForFunctionSelector(bytes4)` -- Error hash: `0xbb370b2b` - -::: - -```solidity -error NoExtensionFoundForFunctionSelector(bytes4 functionSelector); -``` - -reverts when there is no extension for the function selector being called with - -#### Parameters - -| Name | Type | Description | -| ------------------ | :------: | ----------- | -| `functionSelector` | `bytes4` | - | - -
- -### OperatorAllowanceCannotBeIncreasedFromZero - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)` -- Error hash: `0xcba6e977` - -::: - -```solidity -error OperatorAllowanceCannotBeIncreasedFromZero(address operator); -``` - -Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an operator that does not have any allowance - -#### Parameters - -| Name | Type | Description | -| ---------- | :-------: | ----------- | -| `operator` | `address` | - | - -
- -### OwnableCallerNotTheOwner - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `OwnableCallerNotTheOwner(address)` -- Error hash: `0xbf1169c5` - -::: - -```solidity -error OwnableCallerNotTheOwner(address callerAddress); -``` - -Reverts when only the owner is allowed to call the function. - -#### Parameters - -| Name | Type | Description | -| --------------- | :-------: | ---------------------------------------- | -| `callerAddress` | `address` | The address that tried to make the call. | - -
- -### OwnableCannotSetZeroAddressAsOwner - -:::note References - -- Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner) -- Solidity implementation: [`LSP7Mintable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol) -- Error signature: `OwnableCannotSetZeroAddressAsOwner()` -- Error hash: `0x1ad8836c` - -::: - -```solidity -error OwnableCannotSetZeroAddressAsOwner(); -``` - -Reverts when trying to set `address(0)` as the contract owner when deploying the contract, initializing it or transferring ownership of the contract. - -
diff --git a/docs/contracts/lsp6/contracts/LSP6KeyManager.md b/docs/contracts/lsp6/contracts/LSP6KeyManager.md new file mode 100644 index 000000000..2075cdebe --- /dev/null +++ b/docs/contracts/lsp6/contracts/LSP6KeyManager.md @@ -0,0 +1,1969 @@ + + + +# LSP6KeyManager + +:::info Standard Specifications + +[`LSP-6-KeyManager.sol`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md) + +::: +:::info Solidity implementation + +[`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) + +::: + +> Implementation of a contract acting as a controller of an ERC725 Account, using permissions stored in the ERC725Y storage. + +All the permissions can be set on the ERC725 Account using `setData(bytes32,bytes)` or `setData(bytes32[],bytes[])`. + +## Public Methods + +Public methods are accessible externally from users, allowing interaction with this function from dApps or other smart contracts. +When marked as 'public', a method can be called both externally and internally, on the other hand, when marked as 'external', a method can only be called externally. + +### constructor + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#constructor) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) + +::: + +```solidity +constructor(address target_); +``` + +_Deploying a LSP6KeyManager linked to the contract at address `target_`._ + +Deploy a Key Manager and set the `target_` address in the contract storage, making this Key Manager linked to this `target_` contract. + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ------------------------------------------------------------------------ | +| `target_` | `address` | The address of the contract to control and forward calldata payloads to. | + +
+ +### VERSION + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#version) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `VERSION()` +- Function selector: `0xffa1ad74` + +::: + +```solidity +function VERSION() external view returns (string); +``` + +_Contract version._ + +#### Returns + +| Name | Type | Description | +| ---- | :------: | ----------- | +| `0` | `string` | - | + +
+ +### execute + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#execute) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `execute(bytes)` +- Function selector: `0x09c5eabe` + +::: + +```solidity +function execute(bytes payload) external payable returns (bytes); +``` + +_Executing the following payload on the linked contract: `payload`_ + +Execute A `payload` on the linked [`target`](#target) contract after having verified the permissions associated with the function being run. The `payload` MUST be a valid abi-encoded function call of one of the functions present in the linked [`target`](#target), otherwise the call will fail. The linked [`target`](#target) will return some data on successful execution, or revert on failure. + +
+ +**Emitted events:** + +- [`PermissionsVerified`](#permissionsverified) event when the permissions related to `payload` have been verified successfully. + +
+ +#### Parameters + +| Name | Type | Description | +| --------- | :-----: | --------------------------------------------------------------------------- | +| `payload` | `bytes` | The abi-encoded function call to execute on the linked [`target`](#target). | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | --------------------------------------------------------------------------------------- | +| `0` | `bytes` | The abi-decoded data returned by the function called on the linked [`target`](#target). | + +
+ +### executeBatch + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#executebatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `executeBatch(uint256[],bytes[])` +- Function selector: `0xbf0176ff` + +::: + +```solidity +function executeBatch( + uint256[] values, + bytes[] payloads +) external payable returns (bytes[]); +``` + +\*Executing the following batch of payloads and sensind on the linked contract. + +- payloads: `payloads` + +- values transferred for each payload: `values`\* + +Same as [`execute`](#execute) but execute a batch of payloads (abi-encoded function calls) in a single transaction. + +
+ +**Emitted events:** + +- [`PermissionsVerified`](#permissionsverified) event for each permissions related to each `payload` that have been verified successfully. + +
+ +#### Parameters + +| Name | Type | Description | +| ---------- | :---------: | ------------------------------------------------------------------------------------------------- | +| `values` | `uint256[]` | An array of amount of native tokens to be transferred for each `payload`. | +| `payloads` | `bytes[]` | An array of abi-encoded function calls to execute successively on the linked [`target`](#target). | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------------------------------ | +| `0` | `bytes[]` | An array of abi-decoded data returned by the functions called on the linked [`target`](#target). | + +
+ +### executeRelayCall + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#executerelaycall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `executeRelayCall(bytes,uint256,uint256,bytes)` +- Function selector: `0x4c8a4e74` + +::: + +:::tip Hint + +If you are looking to learn how to sign and execute relay transactions via the Key Manager, see our Javascript step by step guide [_"Execute Relay Transactions"_](../../../learn/expert-guides/key-manager/execute-relay-transactions.md). See the LSP6 Standard page for more details on how to [generate a valid signature for Execute Relay Call](../../../standards/universal-profile/lsp6-key-manager.md#how-to-sign-relay-transactions). + +::: + +```solidity +function executeRelayCall( + bytes signature, + uint256 nonce, + uint256 validityTimestamps, + bytes payload +) external payable returns (bytes); +``` + +_Executing the following payload given the nonce `nonce` and signature `signature`. Payload: `payload`_ + +Allows any address (executor) to execute a payload (= abi-encoded function call), given they have a valid signature from a signer address and a valid `nonce` for this signer. The signature MUST be generated according to the signature format defined by the LSP25 standard. The signer that generated the `signature` MUST be a controller with some permissions on the linked [`target`](#target). The `payload` will be executed on the [`target`](#target) contract once the LSP25 signature and the permissions of the signer have been verified. + +
+ +**Emitted events:** + +- [`PermissionsVerified`](#permissionsverified) event when the permissions related to `payload` have been verified successfully. + +
+ +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | A 65 bytes long signature for a meta transaction according to LSP25. | +| `nonce` | `uint256` | The nonce of the address that signed the calldata (in a specific `_channel`), obtained via [`getNonce`](#getnonce). Used to prevent replay attack. | +| `validityTimestamps` | `uint256` | Two `uint128` timestamps concatenated together that describes when the relay transaction is valid "from" (left `uint128`) and "until" as a deadline (right `uint128`). | +| `payload` | `bytes` | The abi-encoded function call to execute. | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | ------------------------------------------------- | +| `0` | `bytes` | The data being returned by the function executed. | + +
+ +### executeRelayCallBatch + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#executerelaycallbatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `executeRelayCallBatch(bytes[],uint256[],uint256[],uint256[],bytes[])` +- Function selector: `0xa20856a5` + +::: + +```solidity +function executeRelayCallBatch( + bytes[] signatures, + uint256[] nonces, + uint256[] validityTimestamps, + uint256[] values, + bytes[] payloads +) external payable returns (bytes[]); +``` + +_Executing a batch of relay calls (= meta-transactions)._ + +Same as [`executeRelayCall`](#executerelaycall) but execute a batch of signed calldata payloads (abi-encoded function calls) in a single transaction. The `signatures` can be from multiple controllers, not necessarely the same controller, as long as each of these controllers that signed have the right permissions related to the calldata `payload` they signed. + +
+ +**Requirements:** + +- the length of `signatures`, `nonces`, `validityTimestamps`, `values` and `payloads` MUST be the same. +- the value sent to this function (`msg.value`) MUST be equal to the sum of all `values` in the batch. There should not be any excess value sent to this function. + +
+ +#### Parameters + +| Name | Type | Description | +| -------------------- | :---------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `signatures` | `bytes[]` | An array of 65 bytes long signatures for meta transactions according to LSP25. | +| `nonces` | `uint256[]` | An array of nonces of the addresses that signed the calldata payloads (in specific channels). Obtained via [`getNonce`](#getnonce). Used to prevent replay attack. | +| `validityTimestamps` | `uint256[]` | An array of two `uint128` concatenated timestamps that describe when the relay transaction is valid "from" (left `uint128`) and "until" (right `uint128`). | +| `values` | `uint256[]` | An array of amount of native tokens to be transferred for each calldata `payload`. | +| `payloads` | `bytes[]` | An array of abi-encoded function calls to be executed successively. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ---------------------------------------------------------------- | +| `0` | `bytes[]` | An array of abi-decoded data returned by the functions executed. | + +
+ +### getNonce + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#getnonce) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `getNonce(address,uint128)` +- Function selector: `0xb44581d9` + +::: + +:::tip Hint + +A signer can choose its channel number arbitrarily. The recommended practice is to: + +- use `channelId == 0` for transactions for which the ordering of execution matters.abi _Example: you have two transactions A and B, and transaction A must be executed first and complete successfully before transaction B should be executed)._ +- use any other `channelId` number for transactions that you want to be order independant (out-of-order execution, execution _"in parallel"_). \_Example: you have two transactions A and B. You want transaction B to be executed a) without having to wait for transaction A to complete, or b) regardless if transaction A completed successfully or not. + +::: + +```solidity +function getNonce( + address from, + uint128 channelId +) external view returns (uint256); +``` + +_Reading the latest nonce of address `from` in the channel ID `channelId`._ + +Get the nonce for a specific `from` address that can be used for signing relay transactions via [`executeRelayCall`](#executerelaycall). + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | -------------------------------------------------------------------------- | +| `from` | `address` | The address of the signer of the transaction. | +| `channelId` | `uint128` | The channel id that the signer wants to use for executing the transaction. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | -------------------------------------------- | +| `0` | `uint256` | The current nonce on a specific `channelId`. | + +
+ +### isValidSignature + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#isvalidsignature) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `isValidSignature(bytes32,bytes)` +- Function selector: `0x1626ba7e` + +::: + +:::caution Warning + +This function does not enforce by default the inclusion of the address of this contract in the signature digest. It is recommended that protocols or applications using this contract include the targeted address (= this contract) in the data to sign. To ensure that a signature is valid for a specific LSP6KeyManager and prevent signatures from the same EOA to be replayed across different LSP6KeyManager. + +::: + +```solidity +function isValidSignature( + bytes32 dataHash, + bytes signature +) external view returns (bytes4 returnedStatus); +``` + +Checks if a signature was signed by a controller that has the permission `SIGN`. If the signer is a controller with the permission `SIGN`, it will return the ERC1271 success value. + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ------------------------------------------- | +| `dataHash` | `bytes32` | - | +| `signature` | `bytes` | Signature byte array associated with \_data | + +#### Returns + +| Name | Type | Description | +| ---------------- | :------: | ---------------------------------------------------- | +| `returnedStatus` | `bytes4` | `0x1626ba7e` on success, or `0xffffffff` on failure. | + +
+ +### lsp20VerifyCall + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#lsp20verifycall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `lsp20VerifyCall(address,address,address,uint256,bytes)` +- Function selector: `0xde928f14` + +::: + +:::tip Hint + +This function can call by any other address than the [`target`](#`target`). This allows to verify permissions in a _"read-only"_ manner. Anyone can call this function to verify if the `caller` has the right permissions to perform the abi-encoded function call `data` on the [`target`](#`target`) contract (while sending `msgValue` alongside the call). If the permissions have been verified successfully and `caller` is authorized, one of the following two LSP20 success value will be returned: + +- `0x1a238000`: LSP20 success value **without** post verification (last byte is `0x00`). +- `0x1a238001`: LSP20 success value **with** post-verification (last byte is `0x01`). + +::: + +```solidity +function lsp20VerifyCall( + address, + address targetContract, + address caller, + uint256 msgValue, + bytes callData +) external nonpayable returns (bytes4); +``` + +#### Parameters + +| Name | Type | Description | +| ---------------- | :-------: | ------------------------------------------------------------- | +| `_0` | `address` | - | +| `targetContract` | `address` | - | +| `caller` | `address` | The address who called the function on the `target` contract. | +| `msgValue` | `uint256` | - | +| `callData` | `bytes` | The calldata sent by the caller to the msg.sender | + +#### Returns + +| Name | Type | Description | +| ---- | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `0` | `bytes4` | MUST return the first 3 bytes of `lsp20VerifyCall(address,uint256,bytes)` function selector if the call to the function is allowed, concatened with a byte that determines if the lsp20VerifyCallResult function should be called after the original function call. The byte that invoke the lsp20VerifyCallResult function is strictly `0x01`. | + +
+ +### lsp20VerifyCallResult + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#lsp20verifycallresult) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `lsp20VerifyCallResult(bytes32,bytes)` +- Function selector: `0xd3fc45d3` + +::: + +```solidity +function lsp20VerifyCallResult( + bytes32, + bytes +) external nonpayable returns (bytes4); +``` + +#### Parameters + +| Name | Type | Description | +| ---- | :-------: | ----------- | +| `_0` | `bytes32` | - | +| `_1` | `bytes` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :------: | ---------------------------------------------------------------------------------------------- | +| `0` | `bytes4` | MUST return the lsp20VerifyCallResult function selector if the call to the function is allowed | + +
+ +### supportsInterface + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#supportsinterface) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `supportsInterface(bytes4)` +- Function selector: `0x01ffc9a7` + +::: + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool); +``` + +See [`IERC165-supportsInterface`](#ierc165-supportsinterface). + +#### Parameters + +| Name | Type | Description | +| ------------- | :------: | ----------- | +| `interfaceId` | `bytes4` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ----------- | +| `0` | `bool` | - | + +
+ +### target + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#target) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Function signature: `target()` +- Function selector: `0xd4b83992` + +::: + +```solidity +function target() external view returns (address); +``` + +Get The address of the contract linked to this Key Manager. + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ---------------------------------- | +| `0` | `address` | The address of the linked contract | + +
+ +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### \_verifyCanSetData + +```solidity +function _verifyCanSetData( + address controlledContract, + address controllerAddress, + bytes32 controllerPermissions, + bytes32 inputDataKey, + bytes inputDataValue +) internal view; +``` + +verify if the `controllerAddress` has the permissions required to set a data key on the ERC725Y storage of the `controlledContract`. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | -------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is set. | +| `controllerAddress` | `address` | the address of the controller who wants to set the data key. | +| `controllerPermissions` | `bytes32` | the permissions of the controller address. | +| `inputDataKey` | `bytes32` | the data key to set on the `controlledContract`. | +| `inputDataValue` | `bytes` | the data value to set for the `inputDataKey`. | + +
+ +### \_verifyCanSetData + +```solidity +function _verifyCanSetData( + address controlledContract, + address controller, + bytes32 permissions, + bytes32[] inputDataKeys, + bytes[] inputDataValues +) internal view; +``` + +verify if the `controllerAddress` has the permissions required to set an array of data keys on the ERC725Y storage of the `controlledContract`. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :---------: | -------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is set. | +| `controller` | `address` | the address of the controller who wants to set the data key. | +| `permissions` | `bytes32` | the permissions of the controller address. | +| `inputDataKeys` | `bytes32[]` | an array of data keys to set on the `controlledContract`. | +| `inputDataValues` | `bytes[]` | an array of data values to set for the `inputDataKeys`. | + +
+ +### \_getPermissionRequiredToSetDataKey + +```solidity +function _getPermissionRequiredToSetDataKey( + address controlledContract, + bytes32 controllerPermissions, + bytes32 inputDataKey, + bytes inputDataValue +) internal view returns (bytes32); +``` + +retrieve the permission required based on the data key to be set on the `controlledContract`. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ----------------------------------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `controllerPermissions` | `bytes32` | - | +| `inputDataKey` | `bytes32` | the data key to set on the `controlledContract`. Can be related to LSP6 Permissions, LSP1 Delegate or LSP17 Extensions. | +| `inputDataValue` | `bytes` | the data value to set for the `inputDataKey`. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------------ | +| `0` | `bytes32` | the permission required to set the `inputDataKey` on the `controlledContract`. | + +
+ +### \_getPermissionToSetPermissionsArray + +```solidity +function _getPermissionToSetPermissionsArray( + address controlledContract, + bytes32 inputDataKey, + bytes inputDataValue, + bool hasBothAddControllerAndEditPermissions +) internal view returns (bytes32); +``` + +retrieve the permission required to update the `AddressPermissions[]` array data key defined in LSP6. + +#### Parameters + +| Name | Type | Description | +| ---------------------------------------- | :-------: | ----------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `inputDataKey` | `bytes32` | either `AddressPermissions[]` (array length) or `AddressPermissions[index]` (array index) | +| `inputDataValue` | `bytes` | the updated value for the `inputDataKey`. MUST be: | +| `hasBothAddControllerAndEditPermissions` | `bool` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | --------------------------------- | +| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. | + +
+ +### \_getPermissionToSetControllerPermissions + +```solidity +function _getPermissionToSetControllerPermissions( + address controlledContract, + bytes32 inputPermissionDataKey +) internal view returns (bytes32); +``` + +retrieve the permission required to set permissions for a controller address. + +#### Parameters + +| Name | Type | Description | +| ------------------------ | :-------: | ------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `inputPermissionDataKey` | `bytes32` | `AddressPermissions:Permissions:`. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | --------------------------------- | +| `0` | `bytes32` | either ADD or CHANGE PERMISSIONS. | + +
+ +### \_getPermissionToSetAllowedCalls + +```solidity +function _getPermissionToSetAllowedCalls( + address controlledContract, + bytes32 dataKey, + bytes dataValue, + bool hasBothAddControllerAndEditPermissions +) internal view returns (bytes32); +``` + +Retrieve the permission required to set some AllowedCalls for a controller. + +#### Parameters + +| Name | Type | Description | +| ---------------------------------------- | :-------: | ------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | The address of the ERC725Y contract from which to fetch the value of `dataKey`. | +| `dataKey` | `bytes32` | A data key ion the format `AddressPermissions:AllowedCalls:`. | +| `dataValue` | `bytes` | The updated value for the `dataKey`. MUST be a bytes32[CompactBytesArray] of Allowed Calls. | +| `hasBothAddControllerAndEditPermissions` | `bool` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------- | +| `0` | `bytes32` | Either ADD or EDIT PERMISSIONS. | + +
+ +### \_getPermissionToSetAllowedERC725YDataKeys + +```solidity +function _getPermissionToSetAllowedERC725YDataKeys( + address controlledContract, + bytes32 dataKey, + bytes dataValue, + bool hasBothAddControllerAndEditPermissions +) internal view returns (bytes32); +``` + +Retrieve the permission required to set some Allowed ERC725Y Data Keys for a controller. + +#### Parameters + +| Name | Type | Description | +| ---------------------------------------- | :-------: | ----------------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract from which to fetch the value of `dataKey`. | +| `dataKey` | `bytes32` | A data key in the format `AddressPermissions:AllowedERC725YDataKeys:`. | +| `dataValue` | `bytes` | The updated value for the `dataKey`. MUST be a bytes[CompactBytesArray] of Allowed ERC725Y Data Keys. | +| `hasBothAddControllerAndEditPermissions` | `bool` | - | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------- | +| `0` | `bytes32` | Either ADD or EDIT PERMISSIONS. | + +
+ +### \_getPermissionToSetLSP1Delegate + +```solidity +function _getPermissionToSetLSP1Delegate( + address controlledContract, + bytes32 lsp1DelegateDataKey +) internal view returns (bytes32); +``` + +retrieve the permission required to either add or change the address +of a LSP1 Universal Receiver Delegate stored under a specific LSP1 data key. + +#### Parameters + +| Name | Type | Description | +| --------------------- | :-------: | -------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `lsp1DelegateDataKey` | `bytes32` | either the data key for the default `LSP1UniversalReceiverDelegate`, | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ----------------------------------------------- | +| `0` | `bytes32` | either ADD or CHANGE UNIVERSALRECEIVERDELEGATE. | + +
+ +### \_getPermissionToSetLSP17Extension + +```solidity +function _getPermissionToSetLSP17Extension( + address controlledContract, + bytes32 lsp17ExtensionDataKey +) internal view returns (bytes32); +``` + +Verify if `controller` has the required permissions to either add or change the address +of an LSP0 Extension stored under a specific LSP17Extension data key + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | ------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725Y contract where the data key is verified. | +| `lsp17ExtensionDataKey` | `bytes32` | the dataKey to set with `_LSP17_EXTENSION_PREFIX` as prefix. | + +
+ +### \_verifyAllowedERC725YSingleKey + +```solidity +function _verifyAllowedERC725YSingleKey( + address controllerAddress, + bytes32 inputDataKey, + bytes allowedERC725YDataKeysCompacted +) internal pure; +``` + +Verify if the `inputKey` is present in the list of `allowedERC725KeysCompacted` for the `controllerAddress`. + +#### Parameters + +| Name | Type | Description | +| --------------------------------- | :-------: | ----------------------------------------------------------------------------------------- | +| `controllerAddress` | `address` | the address of the controller. | +| `inputDataKey` | `bytes32` | the data key to verify against the allowed ERC725Y Data Keys for the `controllerAddress`. | +| `allowedERC725YDataKeysCompacted` | `bytes` | a CompactBytesArray of allowed ERC725Y Data Keys for the `controllerAddress`. | + +
+ +### \_verifyAllowedERC725YDataKeys + +```solidity +function _verifyAllowedERC725YDataKeys( + address controllerAddress, + bytes32[] inputDataKeys, + bytes allowedERC725YDataKeysCompacted, + bool[] validatedInputKeysList, + uint256 allowedDataKeysFound +) internal pure; +``` + +Verify if all the `inputDataKeys` are present in the list of `allowedERC725KeysCompacted` of the `controllerAddress`. + +#### Parameters + +| Name | Type | Description | +| --------------------------------- | :---------: | ---------------------------------------------------------------------------------------------------------------------------- | +| `controllerAddress` | `address` | the address of the controller. | +| `inputDataKeys` | `bytes32[]` | the data keys to verify against the allowed ERC725Y Data Keys of the `controllerAddress`. | +| `allowedERC725YDataKeysCompacted` | `bytes` | a CompactBytesArray of allowed ERC725Y Data Keys of the `controllerAddress`. | +| `validatedInputKeysList` | `bool[]` | an array of booleans to store the result of the verification of each data keys checked. | +| `allowedDataKeysFound` | `uint256` | the number of data keys that were previously validated for other permissions like `ADDCONTROLLER`, `EDITPERMISSIONS`, etc... | + +
+ +### \_requirePermissions + +```solidity +function _requirePermissions( + address controller, + bytes32 addressPermissions, + bytes32 permissionRequired +) internal pure; +``` + +Check if the `controller` has the `permissionRequired` among its permission listed in `controllerPermissions` +If not, this function will revert with the error `NotAuthorised` and the name of the permission missing by the controller. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | --------------------------------- | +| `controller` | `address` | the caller address | +| `addressPermissions` | `bytes32` | the caller's permissions BitArray | +| `permissionRequired` | `bytes32` | the required permission | + +
+ +### \_verifyCanExecute + +```solidity +function _verifyCanExecute( + address controlledContract, + address controller, + bytes32 permissions, + uint256 operationType, + address to, + uint256 value, + bytes data +) internal view; +``` + +verify if `controllerAddress` has the required permissions to interact with other addresses using the controlledContract. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------- | +| `controlledContract` | `address` | the address of the ERC725 contract where the payload is executed and where the permissions are verified. | +| `controller` | `address` | the address who want to run the execute function on the ERC725Account. | +| `permissions` | `bytes32` | the permissions of the controller address. | +| `operationType` | `uint256` | - | +| `to` | `address` | - | +| `value` | `uint256` | - | +| `data` | `bytes` | - | + +
+ +### \_verifyCanDeployContract + +```solidity +function _verifyCanDeployContract( + address controller, + bytes32 permissions, + bool isFundingContract +) internal view; +``` + +
+ +### \_verifyCanStaticCall + +```solidity +function _verifyCanStaticCall( + address controlledContract, + address controller, + bytes32 permissions, + address to, + uint256 value, + bytes data +) internal view; +``` + +
+ +### \_verifyCanCall + +```solidity +function _verifyCanCall( + address controlledContract, + address controller, + bytes32 permissions, + address to, + uint256 value, + bytes data +) internal view; +``` + +
+ +### \_verifyAllowedCall + +```solidity +function _verifyAllowedCall( + address controlledContract, + address controllerAddress, + uint256 operationType, + address to, + uint256 value, + bytes data +) internal view; +``` + +
+ +### \_extractCallType + +```solidity +function _extractCallType( + uint256 operationType, + uint256 value, + bytes data +) internal pure returns (bytes4 requiredCallTypes); +``` + +extract the bytes4 representation of a single bit for the type of call according to the `operationType` + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | -------------------------------------------- | +| `operationType` | `uint256` | 0 = CALL, 3 = STATICCALL or 3 = DELEGATECALL | +| `value` | `uint256` | - | +| `data` | `bytes` | - | + +#### Returns + +| Name | Type | Description | +| ------------------- | :------: | --------------------------------------------------------- | +| `requiredCallTypes` | `bytes4` | a bytes4 value containing a single 1 bit for the callType | + +
+ +### \_isAllowedAddress + +```solidity +function _isAllowedAddress( + bytes allowedCall, + address to +) internal pure returns (bool); +``` + +
+ +### \_isAllowedStandard + +```solidity +function _isAllowedStandard( + bytes allowedCall, + address to +) internal view returns (bool); +``` + +
+ +### \_isAllowedFunction + +```solidity +function _isAllowedFunction( + bytes allowedCall, + bytes data +) internal pure returns (bool); +``` + +
+ +### \_isAllowedCallType + +```solidity +function _isAllowedCallType( + bytes allowedCall, + bytes4 requiredCallTypes +) internal pure returns (bool); +``` + +
+ +### \_verifyExecuteRelayCallPermission + +```solidity +function _verifyExecuteRelayCallPermission( + address controllerAddress, + bytes32 controllerPermissions +) internal pure; +``` + +
+ +### \_verifyOwnershipPermissions + +```solidity +function _verifyOwnershipPermissions( + address controllerAddress, + bytes32 controllerPermissions +) internal pure; +``` + +
+ +### \_getNonce + +```solidity +function _getNonce( + address from, + uint128 channelId +) internal view returns (uint256 idx); +``` + +Read the nonce for a `from` address on a specific `channelId`. +This will return an `idx`, which is the concatenation of two `uint128` as follow: + +1. the `channelId` where the nonce was queried for. + +2. the actual nonce of the given `channelId`. + For example, if on `channelId` number `5`, the latest nonce is `1`, the `idx` returned by this function will be: + +``` +// in decimals = 1701411834604692317316873037158841057281 +idx = 0x0000000000000000000000000000000500000000000000000000000000000001 +``` + +This idx can be described as follow: + +``` + channelId => 5 nonce in this channel => 1 + v------------------------------v-------------------------------v +0x0000000000000000000000000000000500000000000000000000000000000001 +``` + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ------------------------------------------ | +| `from` | `address` | The address to read the nonce for. | +| `channelId` | `uint128` | The channel in which to extract the nonce. | + +#### Returns + +| Name | Type | Description | +| ----- | :-------: | ---------------------------------------------------------------------------------------------------------------------- | +| `idx` | `uint256` | The idx composed of two `uint128`: the channelId + nonce in channel concatenated together in a single `uint256` value. | + +
+ +### \_recoverSignerFromLSP25Signature + +```solidity +function _recoverSignerFromLSP25Signature( + bytes signature, + uint256 nonce, + uint256 validityTimestamps, + uint256 msgValue, + bytes callData +) internal view returns (address); +``` + +Recover the address of the signer that generated a `signature` using the parameters provided `nonce`, `validityTimestamps`, `msgValue` and `callData`. +The address of the signer will be recovered using the LSP25 signature format. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | A 65 bytes long signature generated according to the signature format specified in the LSP25 standard. | +| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. | +| `validityTimestamps` | `uint256` | The validity timestamp that the signer used to generate the signature (See [`_verifyValidityTimestamps`](#_verifyvaliditytimestamps) to learn more). | +| `msgValue` | `uint256` | The amount of native tokens intended to be sent for the relay transaction. | +| `callData` | `bytes` | The calldata to execute as a relay transaction that the signer signed for. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | -------------------------------------------------------- | +| `0` | `address` | The address that signed, recovered from the `signature`. | + +
+ +### \_verifyValidityTimestamps + +```solidity +function _verifyValidityTimestamps(uint256 validityTimestamps) internal view; +``` + +Verify that the current timestamp is within the date and time range provided by `validityTimestamps`. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, | + +
+ +### \_isValidNonce + +```solidity +function _isValidNonce(address from, uint256 idx) internal view returns (bool); +``` + +Verify that the nonce `_idx` for `_from` (obtained via [`getNonce`](#getnonce)) is valid in its channel ID. +The "idx" is a 256bits (unsigned) integer, where: + +- the 128 leftmost bits = channelId + +- and the 128 rightmost bits = nonce within the channel + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ---------------------------------------------------------------------------- | +| `from` | `address` | The signer's address. | +| `idx` | `uint256` | The concatenation of the `channelId` + `nonce` within a specific channel ID. | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------ | +| `0` | `bool` | true if the nonce is the latest nonce for the `signer`, false otherwise. | + +
+ +### \_execute + +```solidity +function _execute( + uint256 msgValue, + bytes payload +) internal nonpayable returns (bytes); +``` + +
+ +### \_executeRelayCall + +:::caution Warning + +Be aware that this function can also throw an error if the `callData` was signed incorrectly (not conforming to the signature format defined in the LSP25 standard). +This is because the contract cannot distinguish if the data is signed correctly or not. Instead, it will recover an incorrect signer address from the signature +and throw an [`InvalidRelayNonce`](#invalidrelaynonce) error with the incorrect signer address as the first parameter. + +::: + +```solidity +function _executeRelayCall( + bytes signature, + uint256 nonce, + uint256 validityTimestamps, + uint256 msgValue, + bytes payload +) internal nonpayable returns (bytes); +``` + +Validate that the `nonce` given for the `signature` signed and the `payload` to execute is valid +and conform to the signature format according to the LSP25 standard. + +#### Parameters + +| Name | Type | Description | +| -------------------- | :-------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `signature` | `bytes` | A valid signature for a signer, generated according to the signature format specified in the LSP25 standard. | +| `nonce` | `uint256` | The nonce that the signer used to generate the `signature`. | +| `validityTimestamps` | `uint256` | Two `uint128` concatenated together, where the left-most `uint128` represent the timestamp from which the transaction can be executed, | +| `msgValue` | `uint256` | - | +| `payload` | `bytes` | The abi-encoded function call to execute. | + +
+ +### \_executePayload + +```solidity +function _executePayload( + address targetContract, + uint256 msgValue, + bytes payload +) internal nonpayable returns (bytes); +``` + +_Execute the `payload` passed to `execute(...)` or `executeRelayCall(...)`_ + +#### Parameters + +| Name | Type | Description | +| ---------------- | :-------: | ----------------------------------------------------------------------------- | +| `targetContract` | `address` | - | +| `msgValue` | `uint256` | - | +| `payload` | `bytes` | The abi-encoded function call to execute on the [`target`](#target) contract. | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | ------------------------------------------------------------------------------------ | +| `0` | `bytes` | bytes The data returned by the call made to the linked [`target`](#target) contract. | + +
+ +### \_verifyPermissions + +```solidity +function _verifyPermissions( + address targetContract, + address from, + bool isRelayedCall, + bytes payload +) internal view; +``` + +Verify if the `from` address is allowed to execute the `payload` on the [`target`](#target) contract linked to this Key Manager. + +#### Parameters + +| Name | Type | Description | +| ---------------- | :-------: | ---------------------------------------------------------------------------------------------------- | +| `targetContract` | `address` | The contract that is owned by the Key Manager | +| `from` | `address` | Either the caller of [`execute`](#execute) or the signer of [`executeRelayCall`](#executerelaycall). | +| `isRelayedCall` | `bool` | - | +| `payload` | `bytes` | The abi-encoded function call to execute on the [`target`](#target) contract. | + +
+ +### \_nonReentrantBefore + +```solidity +function _nonReentrantBefore( + address targetContract, + bool isSetData, + address from +) internal nonpayable returns (bool reentrancyStatus); +``` + +Check if we are in the context of a reentrant call, by checking if the reentrancy status is `true`. + +- If the status is `true`, the caller (or signer for relay call) MUST have the `REENTRANCY` permission. Otherwise, the call is reverted. + +- If the status is `false`, it is set to `true` only if we are not dealing with a call to the functions `setData` or `setDataBatch`. + Used at the beginning of the [`lsp20VerifyCall`](#`lsp20verifycall`), [`_execute`](#`_execute`) and [`_executeRelayCall`](#`_executerelaycall`) functions, before the methods execution starts. + +
+ +### \_nonReentrantAfter + +```solidity +function _nonReentrantAfter(address targetContract) internal nonpayable; +``` + +Resets the reentrancy status to `false` +Used at the end of the [`lsp20VerifyCall`](#`lsp20verifycall`), [`_execute`](#`_execute`) and [`_executeRelayCall`](#`_executerelaycall`) functions after the functions' execution is terminated. + +
+ +## Events + +### PermissionsVerified + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#permissionsverified) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Event signature: `PermissionsVerified(address,uint256,bytes4)` +- Event topic hash: `0xc0a62328f6bf5e3172bb1fcb2019f54b2c523b6a48e3513a2298fbf0150b781e` + +::: + +```solidity +event PermissionsVerified( + address indexed signer, + uint256 indexed value, + bytes4 indexed selector +); +``` + +_Verified the permissions of `signer` for calling function `selector` on the linked account and sending `value` of native token._ + +Emitted when the LSP6KeyManager contract verified the permissions of the `signer` successfully. + +#### Parameters + +| Name | Type | Description | +| ------------------------ | :-------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signer` **`indexed`** | `address` | The address of the controller that executed the calldata payload (either directly via [`execute`](#execute) or via meta transaction using [`executeRelayCall`](#executerelaycall)). | +| `value` **`indexed`** | `uint256` | The amount of native token to be transferred in the calldata payload. | +| `selector` **`indexed`** | `bytes4` | The bytes4 function of the function that was executed on the linked [`target`](#target) | + +
+ +## Errors + +### BatchExecuteParamsLengthMismatch + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#batchexecuteparamslengthmismatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `BatchExecuteParamsLengthMismatch()` +- Error hash: `0x55a187db` + +::: + +```solidity +error BatchExecuteParamsLengthMismatch(); +``` + +_The array parameters provided to the function `executeBatch(...)` do not have the same number of elements. (Different array param's length)._ + +Reverts when the array parameters `uint256[] value` and `bytes[] payload` have different sizes. There should be the same number of elements for each array parameters. + +
+ +### BatchExecuteRelayCallParamsLengthMismatch + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#batchexecuterelaycallparamslengthmismatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `BatchExecuteRelayCallParamsLengthMismatch()` +- Error hash: `0xb4d50d21` + +::: + +```solidity +error BatchExecuteRelayCallParamsLengthMismatch(); +``` + +_The array parameters provided to the function `executeRelayCallBatch(...)` do not have the same number of elements. (Different array param's length)._ + +Reverts when providing array parameters of different sizes to `executeRelayCallBatch(bytes[],uint256[],bytes[])` + +
+ +### CallingKeyManagerNotAllowed + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#callingkeymanagernotallowed) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `CallingKeyManagerNotAllowed()` +- Error hash: `0xa431b236` + +::: + +```solidity +error CallingKeyManagerNotAllowed(); +``` + +_Calling the Key Manager address for this transaction is disallowed._ + +Reverts when calling the KeyManager through `execute(uint256,address,uint256,bytes)`. + +
+ +### DelegateCallDisallowedViaKeyManager + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#delegatecalldisallowedviakeymanager) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `DelegateCallDisallowedViaKeyManager()` +- Error hash: `0x80d6ebae` + +::: + +```solidity +error DelegateCallDisallowedViaKeyManager(); +``` + +_Performing DELEGATE CALLS via the Key Manager is currently disallowed._ + +Reverts when trying to do a `delegatecall` via the ERC725X.execute(uint256,address,uint256,bytes) (operation type 4) function of the linked [`target`](#target). `DELEGATECALL` is disallowed by default on the LSP6KeyManager. + +
+ +### ERC725X_ExecuteParametersEmptyArray + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#erc725x_executeparametersemptyarray) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `ERC725X_ExecuteParametersEmptyArray()` +- Error hash: `0xe9ad2b5f` + +::: + +```solidity +error ERC725X_ExecuteParametersEmptyArray(); +``` + +Reverts when one of the array parameter provided to the [`executeBatch`](#executebatch) function is an empty array. + +
+ +### ERC725X_ExecuteParametersLengthMismatch + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#erc725x_executeparameterslengthmismatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `ERC725X_ExecuteParametersLengthMismatch()` +- Error hash: `0x3ff55f4d` + +::: + +```solidity +error ERC725X_ExecuteParametersLengthMismatch(); +``` + +Reverts when there is not the same number of elements in the `operationTypes`, `targets` addresses, `values`, and `datas` array parameters provided when calling the [`executeBatch`](#executebatch) function. + +
+ +### ERC725Y_DataKeysValuesLengthMismatch + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#erc725y_datakeysvalueslengthmismatch) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` +- Error hash: `0x3bcc8979` + +::: + +```solidity +error ERC725Y_DataKeysValuesLengthMismatch(); +``` + +Reverts when there is not the same number of elements in the `datakeys` and `dataValues` array parameters provided when calling the [`setDataBatch`](#setdatabatch) function. + +
+ +### InvalidDataValuesForDataKeys + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invaliddatavaluesfordatakeys) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidDataValuesForDataKeys(bytes32,bytes)` +- Error hash: `0x1fa41397` + +::: + +```solidity +error InvalidDataValuesForDataKeys(bytes32 dataKey, bytes dataValue); +``` + +_Data value: `dataValue` length is different from the required length for the data key which is set._ + +Reverts when the data value length is not one of the required lengths for the specific data key. + +#### Parameters + +| Name | Type | Description | +| ----------- | :-------: | ----------------------------------------------------------- | +| `dataKey` | `bytes32` | The data key that has a required length for the data value. | +| `dataValue` | `bytes` | The data value that has an invalid length. | + +
+ +### InvalidERC725Function + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invaliderc725function) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidERC725Function(bytes4)` +- Error hash: `0x2ba8851c` + +::: + +```solidity +error InvalidERC725Function(bytes4 invalidFunction); +``` + +_The Key Manager could not verify the calldata of the transaction because it could not recognise the function being called. Invalid function selector: `invalidFunction`._ + +Reverts when trying to call a function on the linked [`target`](#target), that is not any of the following: + +- `setData(bytes32,bytes)` (ERC725Y) + +- `setDataBatch(bytes32[],bytes[])` (ERC725Y) + +- `execute(uint256,address,uint256,bytes)` (ERC725X) + +- `transferOwnership(address)` (LSP14) + +- `acceptOwnership()` (LSP14) + +- `renounceOwnership()` (LSP14) + +#### Parameters + +| Name | Type | Description | +| ----------------- | :------: | --------------------------------------------------------------------------------------------------------------------------- | +| `invalidFunction` | `bytes4` | The `bytes4` selector of the function that was attempted to be called on the linked [`target`](#target) but not recognised. | + +
+ +### InvalidEncodedAllowedCalls + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invalidencodedallowedcalls) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidEncodedAllowedCalls(bytes)` +- Error hash: `0x187e77ab` + +::: + +```solidity +error InvalidEncodedAllowedCalls(bytes allowedCallsValue); +``` + +_Could not decode the Allowed Calls. Value = `allowedCallsValue`._ + +Reverts when `allowedCallsValue` is not properly encoded as a `(bytes4,address,bytes4,bytes4)[CompactBytesArray]` (CompactBytesArray made of tuples that are 32 bytes long each). See LSP2 value type `CompactBytesArray` for more infos. + +#### Parameters + +| Name | Type | Description | +| ------------------- | :-----: | ----------------------------------------------------------------------------------------------------------------- | +| `allowedCallsValue` | `bytes` | The list of allowedCalls that are not encoded correctly as a `(bytes4,address,bytes4,bytes4)[CompactBytesArray]`. | + +
+ +### InvalidEncodedAllowedERC725YDataKeys + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invalidencodedallowederc725ydatakeys) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidEncodedAllowedERC725YDataKeys(bytes,string)` +- Error hash: `0xae6cbd37` + +::: + +```solidity +error InvalidEncodedAllowedERC725YDataKeys(bytes value, string context); +``` + +_Error when reading the Allowed ERC725Y Data Keys. Reason: `context`, Allowed ERC725Y Data Keys value read: `value`._ + +Reverts when `value` is not encoded properly as a `bytes32[CompactBytesArray]`. The `context` string provides context on when this error occurred (\_e.g: when fetching the `AllowedERC725YDataKeys` to verify the permissions of a controller, or when validating the `AllowedERC725YDataKeys` when setting them for a controller). + +#### Parameters + +| Name | Type | Description | +| --------- | :------: | ---------------------------------------------------------- | +| `value` | `bytes` | The value that is not a valid `bytes32[CompactBytesArray]` | +| `context` | `string` | A brief description of where the error occurred. | + +
+ +### InvalidLSP6Target + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invalidlsp6target) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidLSP6Target()` +- Error hash: `0xfc854579` + +::: + +```solidity +error InvalidLSP6Target(); +``` + +_Invalid address supplied to link this Key Manager to (`address(0)`)._ + +Reverts when the address provided to set as the [`target`](#target) linked to this KeyManager is invalid (_e.g. `address(0)`_). + +
+ +### InvalidPayload + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invalidpayload) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidPayload(bytes)` +- Error hash: `0x3621bbcc` + +::: + +```solidity +error InvalidPayload(bytes payload); +``` + +_Invalid calldata payload sent._ + +Reverts when the payload is invalid. + +#### Parameters + +| Name | Type | Description | +| --------- | :-----: | ----------- | +| `payload` | `bytes` | - | + +
+ +### InvalidRelayNonce + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invalidrelaynonce) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidRelayNonce(address,uint256,bytes)` +- Error hash: `0xc9bd9eb9` + +::: + +```solidity +error InvalidRelayNonce(address signer, uint256 invalidNonce, bytes signature); +``` + +_The relay call failed because an invalid nonce was provided for the address `signer` that signed the execute relay call. Invalid nonce: `invalidNonce`, signature of signer: `signature`._ + +Reverts when the `signer` address retrieved from the `signature` has an invalid nonce: `invalidNonce`. + +#### Parameters + +| Name | Type | Description | +| -------------- | :-------: | ---------------------------------------------------- | +| `signer` | `address` | The address of the signer. | +| `invalidNonce` | `uint256` | The nonce retrieved for the `signer` address. | +| `signature` | `bytes` | The signature used to retrieve the `signer` address. | + +
+ +### InvalidWhitelistedCall + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#invalidwhitelistedcall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `InvalidWhitelistedCall(address)` +- Error hash: `0x6fd203c5` + +::: + +```solidity +error InvalidWhitelistedCall(address from); +``` + +_Invalid allowed calls (`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff`) set for address `from`. Could not perform external call._ + +Reverts when a `from` address has _"any whitelisted call"_ as allowed call set. This revert happens during the verification of the permissions of the address for its allowed calls. A `from` address is not allowed to have 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff in its list of `AddressPermissions:AllowedCalls:
`, as this allows any STANDARD:ADDRESS:FUNCTION. This is equivalent to granting the SUPER permission and should never be valid. + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ---------------------------------------------------------------------- | +| `from` | `address` | The controller address that has _"any allowed calls"_ whitelisted set. | + +
+ +### KeyManagerCannotBeSetAsExtensionForLSP20Functions + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#keymanagercannotbesetasextensionforlsp20functions) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `KeyManagerCannotBeSetAsExtensionForLSP20Functions()` +- Error hash: `0x4a9fa8cf` + +::: + +```solidity +error KeyManagerCannotBeSetAsExtensionForLSP20Functions(); +``` + +_Key Manager cannot be used as an LSP17 extension for LSP20 functions._ + +Reverts when the address of the Key Manager is being set as extensions for lsp20 functions + +
+ +### LSP6BatchExcessiveValueSent + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#lsp6batchexcessivevaluesent) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `LSP6BatchExcessiveValueSent(uint256,uint256)` +- Error hash: `0xa51868b6` + +::: + +```solidity +error LSP6BatchExcessiveValueSent(uint256 totalValues, uint256 msgValue); +``` + +_Too much funds sent to forward each amount in the batch. No amount of native tokens should stay in the Key Manager._ + +This error occurs when there was too much funds sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])` to cover the sum of all the values forwarded on Reverts to avoid the KeyManager to holds some remaining funds sent to the following batch functions: + +- execute(uint256[],bytes[]) + +- executeRelayCall(bytes[],uint256[],uint256[],bytes[]) This error occurs when `msg.value` is more than the sum of all the values being forwarded on each payloads (`values[]` parameter from the batch functions above). + +#### Parameters + +| Name | Type | Description | +| ------------- | :-------: | ----------- | +| `totalValues` | `uint256` | - | +| `msgValue` | `uint256` | - | + +
+ +### LSP6BatchInsufficientValueSent + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#lsp6batchinsufficientvaluesent) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `LSP6BatchInsufficientValueSent(uint256,uint256)` +- Error hash: `0x30a324ac` + +::: + +```solidity +error LSP6BatchInsufficientValueSent(uint256 totalValues, uint256 msgValue); +``` + +_Not enough funds sent to forward each amount in the batch._ + +This error occurs when there was not enough funds sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])` to cover the sum of all the values forwarded on each payloads (`values[]` parameter from the batch functions above). This mean that `msg.value` is less than the sum of all the values being forwarded on each payloads (`values[]` parameters). + +#### Parameters + +| Name | Type | Description | +| ------------- | :-------: | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `totalValues` | `uint256` | The sum of all the values forwarded on each payloads (`values[]` parameter from the batch functions above). | +| `msgValue` | `uint256` | The amount of native tokens sent to the batch functions `execute(uint256[],bytes[])` or `executeRelayCall(bytes[],uint256[],uint256[],bytes[])`. | + +
+ +### NoCallsAllowed + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#nocallsallowed) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `NoCallsAllowed(address)` +- Error hash: `0x6cb60587` + +::: + +```solidity +error NoCallsAllowed(address from); +``` + +_The address `from` is not authorised to use the linked account contract to make external calls, because it has no Allowed Calls set._ + +Reverts when the `from` address has no `AllowedCalls` set and cannot interact with any address using the linked [`target`](#target). + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ------------------------------------- | +| `from` | `address` | The address that has no AllowedCalls. | + +
+ +### NoERC725YDataKeysAllowed + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#noerc725ydatakeysallowed) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `NoERC725YDataKeysAllowed(address)` +- Error hash: `0xed7fa509` + +::: + +```solidity +error NoERC725YDataKeysAllowed(address from); +``` + +_The address `from` is not authorised to set data, because it has no ERC725Y Data Key allowed._ + +Reverts when the `from` address has no AllowedERC725YDataKeys set and cannot set any ERC725Y data key on the ERC725Y storage of the linked [`target`](#target). + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ----------------------------------------------------- | +| `from` | `address` | The address that has no `AllowedERC725YDataKeys` set. | + +
+ +### NoPermissionsSet + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#nopermissionsset) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `NoPermissionsSet(address)` +- Error hash: `0xf292052a` + +::: + +```solidity +error NoPermissionsSet(address from); +``` + +_The address `from` does not have any permission set on the contract linked to the Key Manager._ + +Reverts when address `from` does not have any permissions set on the account linked to this Key Manager + +#### Parameters + +| Name | Type | Description | +| ------ | :-------: | ------------------------------------------ | +| `from` | `address` | the address that does not have permissions | + +
+ +### NotAllowedCall + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#notallowedcall) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `NotAllowedCall(address,address,bytes4)` +- Error hash: `0x45147bce` + +::: + +```solidity +error NotAllowedCall(address from, address to, bytes4 selector); +``` + +_The address `from` is not authorised to call the function `selector` on the `to` address._ + +Reverts when `from` is not authorised to call the `execute(uint256,address,uint256,bytes)` function because of a not allowed callType, address, standard or function. + +#### Parameters + +| Name | Type | Description | +| ---------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | The controller that tried to call the `execute(uint256,address,uint256,bytes)` function. | +| `to` | `address` | The address of an EOA or contract that `from` tried to call using the linked [`target`](#target) | +| `selector` | `bytes4` | If `to` is a contract, the bytes4 selector of the function that `from` is trying to call. If no function is called (_e.g: a native token transfer_), selector = `0x00000000` | + +
+ +### NotAllowedERC725YDataKey + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#notallowederc725ydatakey) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `NotAllowedERC725YDataKey(address,bytes32)` +- Error hash: `0x557ae079` + +::: + +```solidity +error NotAllowedERC725YDataKey(address from, bytes32 disallowedKey); +``` + +_The address `from` is not authorised to set the data key `disallowedKey` on the contract linked to the Key Manager._ + +Reverts when address `from` is not authorised to set the key `disallowedKey` on the linked [`target`](#target). + +#### Parameters + +| Name | Type | Description | +| --------------- | :-------: | ----------------------------------------------------------------------------------------------------------------- | +| `from` | `address` | address The controller that tried to `setData` on the linked [`target`](#target). | +| `disallowedKey` | `bytes32` | A bytes32 data key that `from` is not authorised to set on the ERC725Y storage of the linked [`target`](#target). | + +
+ +### NotAuthorised + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#notauthorised) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `NotAuthorised(address,string)` +- Error hash: `0x3bdad6e6` + +::: + +```solidity +error NotAuthorised(address from, string permission); +``` + +_The address `from` is not authorised to `permission` on the contract linked to the Key Manager._ + +Reverts when address `from` is not authorised and does not have `permission` on the linked [`target`](#target) + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ------------------------------------------------------------------------------ | +| `from` | `address` | address The address that was not authorised. | +| `permission` | `string` | permission The permission required (\_e.g: `SETDATA`, `CALL`, `TRANSFERVALUE`) | + +
+ +### NotRecognisedPermissionKey + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#notrecognisedpermissionkey) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `NotRecognisedPermissionKey(bytes32)` +- Error hash: `0x0f7d735b` + +::: + +```solidity +error NotRecognisedPermissionKey(bytes32 dataKey); +``` + +_The data key `dataKey` starts with `AddressPermissions` prefix but is none of the permission data keys defined in LSP6._ + +Reverts when `dataKey` is a `bytes32` value that does not adhere to any of the permission data keys defined by the LSP6 standard + +#### Parameters + +| Name | Type | Description | +| --------- | :-------: | ------------------------------------------------------------------------------ | +| `dataKey` | `bytes32` | The dataKey that does not match any of the standard LSP6 permission data keys. | + +
+ +### RelayCallBeforeStartTime + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#relaycallbeforestarttime) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `RelayCallBeforeStartTime()` +- Error hash: `0x00de4b8a` + +::: + +```solidity +error RelayCallBeforeStartTime(); +``` + +_Relay call not valid yet._ + +Reverts when the relay call is cannot yet bet executed. This mean that the starting timestamp provided to [`executeRelayCall`](#executerelaycall) function is bigger than the current timestamp. + +
+ +### RelayCallExpired + +:::note References + +- Specification details: [**LSP-6-KeyManager.sol**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-KeyManager.sol.md#relaycallexpired) +- Solidity implementation: [`LSP6KeyManager.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6KeyManager.sol) +- Error signature: `RelayCallExpired()` +- Error hash: `0x5c53a98c` + +::: + +```solidity +error RelayCallExpired(); +``` + +_Relay call expired (deadline passed)._ + +Reverts when the period to execute the relay call has expired. + +
diff --git a/docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md b/docs/contracts/lsp7/contracts/LSP7DigitalAsset.md similarity index 92% rename from docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md rename to docs/contracts/lsp7/contracts/LSP7DigitalAsset.md index 40686d9e4..d06c27c44 100644 --- a/docs/contracts/LSP7DigitalAsset/LSP7DigitalAsset.md +++ b/docs/contracts/lsp7/contracts/LSP7DigitalAsset.md @@ -10,7 +10,7 @@ ::: :::info Solidity implementation -[`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +[`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) ::: @@ -28,7 +28,7 @@ When marked as 'public', a method can be called both externally and internally, :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#fallback) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) ::: @@ -63,7 +63,7 @@ This function is executed when: :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#receive) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) ::: @@ -82,7 +82,7 @@ Reverts whenever someone tries to send native tokens to a LSP7 contract. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `authorizeOperator(address,uint256,bytes)` - Function selector: `0xb49506fd` @@ -119,7 +119,7 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -154,7 +154,7 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -185,7 +185,7 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#batchcalls) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `batchCalls(bytes[])` - Function selector: `0x6963d438` @@ -224,7 +224,7 @@ Allows a caller to batch different function calls in one call. Perform a `delega :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -249,7 +249,7 @@ Returns the number of decimals used to get its user representation. If the asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `decreaseAllowance(address,uint256,bytes)` - Function selector: `0x7b204c4e` @@ -282,7 +282,7 @@ Atomically decreases the allowance granted to `operator` by the caller. This is :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -315,7 +315,7 @@ Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -350,7 +350,7 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `getOperatorsOf(address)` - Function selector: `0xd72fc29a` @@ -381,7 +381,7 @@ Returns all `operator` addresses that are allowed to transfer or burn on behalf :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `increaseAllowance(address,uint256,bytes)` - Function selector: `0x2bc1da82` @@ -414,7 +414,7 @@ Atomically increases the allowance granted to `operator` by the caller. This is :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -439,7 +439,7 @@ Returns the address of the current owner. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -458,7 +458,7 @@ Leaves the contract without owner. It will not be possible to call `onlyOwner` f :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `revokeOperator(address,bool,bytes)` - Function selector: `0x4521748e` @@ -489,7 +489,7 @@ Removes the `operator` address as an operator of callers tokens, disallowing it :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -539,7 +539,7 @@ Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -589,7 +589,7 @@ Batch data setting function that behaves the same as [`setData`](#setdata) but a :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -620,7 +620,7 @@ Returns true if this contract implements the interface defined by `interfaceId`. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -645,7 +645,7 @@ Returns the number of existing tokens that have been minted in this contract. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -680,7 +680,7 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -715,7 +715,7 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -1171,7 +1171,7 @@ CALL opcode, passing the [`msg.data`](#msg.data) appended with the 20 bytes of t :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Event signature: `DataChanged(bytes32,bytes)` - Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` @@ -1199,7 +1199,7 @@ Emitted when data at a specific `dataKey` was changed to a new value `dataValue` :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)` - Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d` @@ -1232,7 +1232,7 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Event signature: `OperatorRevoked(address,address,bool,bytes)` - Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167` @@ -1265,7 +1265,7 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Event signature: `OwnershipTransferred(address,address)` - Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` @@ -1292,7 +1292,7 @@ event OwnershipTransferred( :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` - Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` @@ -1331,7 +1331,7 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -1350,7 +1350,7 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1369,7 +1369,7 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -1388,7 +1388,7 @@ Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#set :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `InvalidExtensionAddress(bytes)` - Error hash: `0x42bfe79f` @@ -1413,7 +1413,7 @@ reverts when the bytes retrieved from the LSP17 data key is not a valid address :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `InvalidFunctionSelector(bytes)` - Error hash: `0xe5099ee3` @@ -1438,7 +1438,7 @@ reverts when the contract is called with a function selector not valid (less tha :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -1457,7 +1457,7 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -1476,7 +1476,7 @@ Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital ass :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP4TokenTypeNotEditable()` - Error hash: `0x4ef6d7fb` @@ -1495,7 +1495,7 @@ Reverts when trying to edit the data key `LSP4TokenType` after the digital asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -1528,7 +1528,7 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -1559,7 +1559,7 @@ reverts when sending an `amount` of tokens larger than the current `balance` of :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7BatchCallFailed(uint256)` - Error hash: `0xb774c284` @@ -1586,7 +1586,7 @@ Reverts when a batch call failed. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -1605,7 +1605,7 @@ reverts when specifying the same address for `from` or `to` in a token transfer. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -1630,7 +1630,7 @@ reverts when trying to: :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -1649,7 +1649,7 @@ reverts when trying to set the zero address as an operator. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -1668,7 +1668,7 @@ Reverts when trying to decrease an operator's allowance to more than its current :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -1687,7 +1687,7 @@ reverts when the array parameters used in [`transferBatch`](#transferbatch) have :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1714,7 +1714,7 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1739,7 +1739,7 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7TokenContractCannotHoldValue()` - Error hash: `0x388f5adc` @@ -1760,7 +1760,7 @@ Error occurs when sending native tokens to the LSP7 contract without sending any :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1779,7 +1779,7 @@ reverts when trying to authorize or revoke the token's owner as an operator. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `NoExtensionFoundForFunctionSelector(bytes4)` - Error hash: `0xbb370b2b` @@ -1804,7 +1804,7 @@ reverts when there is no extension for the function selector being called with :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)` - Error hash: `0xcba6e977` @@ -1829,7 +1829,7 @@ Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an o :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `OwnableCallerNotTheOwner(address)` - Error hash: `0xbf1169c5` @@ -1854,7 +1854,7 @@ Reverts when only the owner is allowed to call the function. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner) -- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol) +- Solidity implementation: [`LSP7DigitalAsset.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/LSP7DigitalAsset.sol) - Error signature: `OwnableCannotSetZeroAddressAsOwner()` - Error hash: `0x1ad8836c` diff --git a/docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md b/docs/contracts/lsp7/contracts/extensions/LSP7Burnable.md similarity index 92% rename from docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md rename to docs/contracts/lsp7/contracts/extensions/LSP7Burnable.md index 1a572a618..accee44f5 100644 --- a/docs/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.md +++ b/docs/contracts/lsp7/contracts/extensions/LSP7Burnable.md @@ -10,7 +10,7 @@ ::: :::info Solidity implementation -[`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +[`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) ::: @@ -26,7 +26,7 @@ When marked as 'public', a method can be called both externally and internally, :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#fallback) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) ::: @@ -61,7 +61,7 @@ This function is executed when: :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#receive) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) ::: @@ -80,7 +80,7 @@ Reverts whenever someone tries to send native tokens to a LSP7 contract. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `authorizeOperator(address,uint256,bytes)` - Function selector: `0xb49506fd` @@ -117,7 +117,7 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -152,7 +152,7 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -183,7 +183,7 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#batchcalls) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `batchCalls(bytes[])` - Function selector: `0x6963d438` @@ -222,7 +222,7 @@ Allows a caller to batch different function calls in one call. Perform a `delega :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#burn) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `burn(address,uint256,bytes)` - Function selector: `0x44d17187` @@ -249,7 +249,7 @@ See internal [`_burn`](#_burn) function for details. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -274,7 +274,7 @@ Returns the number of decimals used to get its user representation. If the asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `decreaseAllowance(address,uint256,bytes)` - Function selector: `0x7b204c4e` @@ -307,7 +307,7 @@ Atomically decreases the allowance granted to `operator` by the caller. This is :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -340,7 +340,7 @@ Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -375,7 +375,7 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `getOperatorsOf(address)` - Function selector: `0xd72fc29a` @@ -406,7 +406,7 @@ Returns all `operator` addresses that are allowed to transfer or burn on behalf :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `increaseAllowance(address,uint256,bytes)` - Function selector: `0x2bc1da82` @@ -439,7 +439,7 @@ Atomically increases the allowance granted to `operator` by the caller. This is :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -464,7 +464,7 @@ Returns the address of the current owner. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -483,7 +483,7 @@ Leaves the contract without owner. It will not be possible to call `onlyOwner` f :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `revokeOperator(address,bool,bytes)` - Function selector: `0x4521748e` @@ -514,7 +514,7 @@ Removes the `operator` address as an operator of callers tokens, disallowing it :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -564,7 +564,7 @@ Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -614,7 +614,7 @@ Batch data setting function that behaves the same as [`setData`](#setdata) but a :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -645,7 +645,7 @@ Returns true if this contract implements the interface defined by `interfaceId`. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -670,7 +670,7 @@ Returns the number of existing tokens that have been minted in this contract. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -705,7 +705,7 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -740,7 +740,7 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -1196,7 +1196,7 @@ CALL opcode, passing the [`msg.data`](#msg.data) appended with the 20 bytes of t :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Event signature: `DataChanged(bytes32,bytes)` - Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` @@ -1224,7 +1224,7 @@ Emitted when data at a specific `dataKey` was changed to a new value `dataValue` :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)` - Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d` @@ -1257,7 +1257,7 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Event signature: `OperatorRevoked(address,address,bool,bytes)` - Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167` @@ -1290,7 +1290,7 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Event signature: `OwnershipTransferred(address,address)` - Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` @@ -1317,7 +1317,7 @@ event OwnershipTransferred( :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` - Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` @@ -1356,7 +1356,7 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -1375,7 +1375,7 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1394,7 +1394,7 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -1413,7 +1413,7 @@ Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#set :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `InvalidExtensionAddress(bytes)` - Error hash: `0x42bfe79f` @@ -1438,7 +1438,7 @@ reverts when the bytes retrieved from the LSP17 data key is not a valid address :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `InvalidFunctionSelector(bytes)` - Error hash: `0xe5099ee3` @@ -1463,7 +1463,7 @@ reverts when the contract is called with a function selector not valid (less tha :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -1482,7 +1482,7 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -1501,7 +1501,7 @@ Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital ass :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP4TokenTypeNotEditable()` - Error hash: `0x4ef6d7fb` @@ -1520,7 +1520,7 @@ Reverts when trying to edit the data key `LSP4TokenType` after the digital asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -1553,7 +1553,7 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -1584,7 +1584,7 @@ reverts when sending an `amount` of tokens larger than the current `balance` of :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7BatchCallFailed(uint256)` - Error hash: `0xb774c284` @@ -1611,7 +1611,7 @@ Reverts when a batch call failed. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -1630,7 +1630,7 @@ reverts when specifying the same address for `from` or `to` in a token transfer. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -1655,7 +1655,7 @@ reverts when trying to: :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -1674,7 +1674,7 @@ reverts when trying to set the zero address as an operator. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -1693,7 +1693,7 @@ Reverts when trying to decrease an operator's allowance to more than its current :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -1712,7 +1712,7 @@ reverts when the array parameters used in [`transferBatch`](#transferbatch) have :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1739,7 +1739,7 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1764,7 +1764,7 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7TokenContractCannotHoldValue()` - Error hash: `0x388f5adc` @@ -1785,7 +1785,7 @@ Error occurs when sending native tokens to the LSP7 contract without sending any :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1804,7 +1804,7 @@ reverts when trying to authorize or revoke the token's owner as an operator. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `NoExtensionFoundForFunctionSelector(bytes4)` - Error hash: `0xbb370b2b` @@ -1829,7 +1829,7 @@ reverts when there is no extension for the function selector being called with :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)` - Error hash: `0xcba6e977` @@ -1854,7 +1854,7 @@ Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an o :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `OwnableCallerNotTheOwner(address)` - Error hash: `0xbf1169c5` @@ -1879,7 +1879,7 @@ Reverts when only the owner is allowed to call the function. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner) -- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol) +- Solidity implementation: [`LSP7Burnable.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7Burnable.sol) - Error signature: `OwnableCannotSetZeroAddressAsOwner()` - Error hash: `0x1ad8836c` diff --git a/docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md b/docs/contracts/lsp7/contracts/extensions/LSP7CappedSupply.md similarity index 91% rename from docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md rename to docs/contracts/lsp7/contracts/extensions/LSP7CappedSupply.md index 826b6595b..54984b298 100644 --- a/docs/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.md +++ b/docs/contracts/lsp7/contracts/extensions/LSP7CappedSupply.md @@ -10,7 +10,7 @@ ::: :::info Solidity implementation -[`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +[`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) ::: @@ -26,7 +26,7 @@ When marked as 'public', a method can be called both externally and internally, :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#fallback) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) ::: @@ -61,7 +61,7 @@ This function is executed when: :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#receive) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) ::: @@ -80,7 +80,7 @@ Reverts whenever someone tries to send native tokens to a LSP7 contract. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizeoperator) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `authorizeOperator(address,uint256,bytes)` - Function selector: `0xb49506fd` @@ -117,7 +117,7 @@ Sets an `amount` of tokens that an `operator` has access from the caller's balan :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#authorizedamountfor) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `authorizedAmountFor(address,address)` - Function selector: `0x65aeaa95` @@ -152,7 +152,7 @@ Get the amount of tokens `operator` address has access to from `tokenOwner`. Ope :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#balanceof) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `balanceOf(address)` - Function selector: `0x70a08231` @@ -183,7 +183,7 @@ Get the number of tokens owned by `tokenOwner`. If the token is divisible (the [ :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#batchcalls) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `batchCalls(bytes[])` - Function selector: `0x6963d438` @@ -222,7 +222,7 @@ Allows a caller to batch different function calls in one call. Perform a `delega :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decimals) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `decimals()` - Function selector: `0x313ce567` @@ -247,7 +247,7 @@ Returns the number of decimals used to get its user representation. If the asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#decreaseallowance) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `decreaseAllowance(address,uint256,bytes)` - Function selector: `0x7b204c4e` @@ -280,7 +280,7 @@ Atomically decreases the allowance granted to `operator` by the caller. This is :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdata) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `getData(bytes32)` - Function selector: `0x54f6127f` @@ -313,7 +313,7 @@ Get in the ERC725Y storage the bytes data stored at a specific data key `dataKey :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getdatabatch) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `getDataBatch(bytes32[])` - Function selector: `0xdedff9c6` @@ -348,7 +348,7 @@ Get in the ERC725Y storage the bytes data stored at multiple data keys `dataKeys :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#getoperatorsof) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `getOperatorsOf(address)` - Function selector: `0xd72fc29a` @@ -379,7 +379,7 @@ Returns all `operator` addresses that are allowed to transfer or burn on behalf :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#increaseallowance) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `increaseAllowance(address,uint256,bytes)` - Function selector: `0x2bc1da82` @@ -412,7 +412,7 @@ Atomically increases the allowance granted to `operator` by the caller. This is :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#owner) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `owner()` - Function selector: `0x8da5cb5b` @@ -437,7 +437,7 @@ Returns the address of the current owner. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#renounceownership) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `renounceOwnership()` - Function selector: `0x715018a6` @@ -456,7 +456,7 @@ Leaves the contract without owner. It will not be possible to call `onlyOwner` f :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#revokeoperator) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `revokeOperator(address,bool,bytes)` - Function selector: `0x4521748e` @@ -487,7 +487,7 @@ Removes the `operator` address as an operator of callers tokens, disallowing it :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdata) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `setData(bytes32,bytes)` - Function selector: `0x7f23690c` @@ -537,7 +537,7 @@ Sets a single bytes value `dataValue` in the ERC725Y storage for a specific data :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#setdatabatch) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `setDataBatch(bytes32[],bytes[])` - Function selector: `0x97902421` @@ -587,7 +587,7 @@ Batch data setting function that behaves the same as [`setData`](#setdata) but a :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#supportsinterface) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `supportsInterface(bytes4)` - Function selector: `0x01ffc9a7` @@ -618,7 +618,7 @@ Returns true if this contract implements the interface defined by `interfaceId`. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#tokensupplycap) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `tokenSupplyCap()` - Function selector: `0x52058d8a` @@ -645,7 +645,7 @@ Get the maximum number of tokens that can exist to circulate. Once [`totalSupply :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#totalsupply) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `totalSupply()` - Function selector: `0x18160ddd` @@ -670,7 +670,7 @@ Returns the number of existing tokens that have been minted in this contract. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `transfer(address,address,uint256,bool,bytes)` - Function selector: `0x760d9bba` @@ -705,7 +705,7 @@ Transfers an `amount` of tokens from the `from` address to the `to` address and :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferbatch) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `transferBatch(address[],address[],uint256[],bool[],bytes[])` - Function selector: `0x2d7667c9` @@ -740,7 +740,7 @@ Same as [`transfer(...)`](#`transfer) but transfer multiple tokens based on the :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transferownership) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Function signature: `transferOwnership(address)` - Function selector: `0xf2fde38b` @@ -1170,7 +1170,7 @@ CALL opcode, passing the [`msg.data`](#msg.data) appended with the 20 bytes of t :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#datachanged) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Event signature: `DataChanged(bytes32,bytes)` - Event topic hash: `0xece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2` @@ -1198,7 +1198,7 @@ Emitted when data at a specific `dataKey` was changed to a new value `dataValue` :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorauthorizationchanged) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Event signature: `OperatorAuthorizationChanged(address,address,uint256,bytes)` - Event topic hash: `0xf772a43bfdf4729b196e3fb54a818b91a2ca6c49d10b2e16278752f9f515c25d` @@ -1231,7 +1231,7 @@ Emitted when `tokenOwner` enables `operator` for `amount` tokens. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorrevoked) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Event signature: `OperatorRevoked(address,address,bool,bytes)` - Event topic hash: `0x0ebf5762d8855cbe012d2ca42fb33a81175e17c8a8751f8859931ba453bd4167` @@ -1264,7 +1264,7 @@ Emitted when `tokenOwner` disables `operator` for `amount` tokens and set its [` :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownershiptransferred) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Event signature: `OwnershipTransferred(address,address)` - Event topic hash: `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` @@ -1291,7 +1291,7 @@ event OwnershipTransferred( :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#transfer) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Event signature: `Transfer(address,address,address,uint256,bool,bytes)` - Event topic hash: `0x3997e418d2cef0b3b0e907b1e39605c3f7d32dbd061e82ea5b4a770d46a160a6` @@ -1330,7 +1330,7 @@ Emitted when the `from` transferred successfully `amount` of tokens to `to`. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvaluesemptyarray) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `ERC725Y_DataKeysValuesEmptyArray()` - Error hash: `0x97da5f95` @@ -1349,7 +1349,7 @@ Reverts when one of the array parameter provided to [`setDataBatch`](#setdatabat :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_datakeysvalueslengthmismatch) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `ERC725Y_DataKeysValuesLengthMismatch()` - Error hash: `0x3bcc8979` @@ -1368,7 +1368,7 @@ Reverts when there is not the same number of elements in the `datakeys` and `dat :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#erc725y_msgvaluedisallowed) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `ERC725Y_MsgValueDisallowed()` - Error hash: `0xf36ba737` @@ -1387,7 +1387,7 @@ Reverts when sending value to the [`setData`](#setdata) or [`setDataBatch`](#set :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidextensionaddress) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `InvalidExtensionAddress(bytes)` - Error hash: `0x42bfe79f` @@ -1412,7 +1412,7 @@ reverts when the bytes retrieved from the LSP17 data key is not a valid address :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#invalidfunctionselector) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `InvalidFunctionSelector(bytes)` - Error hash: `0xe5099ee3` @@ -1437,7 +1437,7 @@ reverts when the contract is called with a function selector not valid (less tha :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokennamenoteditable) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP4TokenNameNotEditable()` - Error hash: `0x85c169bd` @@ -1456,7 +1456,7 @@ Reverts when trying to edit the data key `LSP4TokenName` after the digital asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokensymbolnoteditable) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP4TokenSymbolNotEditable()` - Error hash: `0x76755b38` @@ -1475,7 +1475,7 @@ Reverts when trying to edit the data key `LSP4TokenSymbol` after the digital ass :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp4tokentypenoteditable) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP4TokenTypeNotEditable()` - Error hash: `0x4ef6d7fb` @@ -1494,7 +1494,7 @@ Reverts when trying to edit the data key `LSP4TokenType` after the digital asset :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsauthorizedamount) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7AmountExceedsAuthorizedAmount(address,uint256,address,uint256)` - Error hash: `0xf3a6b691` @@ -1527,7 +1527,7 @@ reverts when `operator` of `tokenOwner` send an `amount` of tokens larger than t :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7amountexceedsbalance) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7AmountExceedsBalance(uint256,address,uint256)` - Error hash: `0x08d47949` @@ -1558,7 +1558,7 @@ reverts when sending an `amount` of tokens larger than the current `balance` of :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7batchcallfailed) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7BatchCallFailed(uint256)` - Error hash: `0xb774c284` @@ -1585,7 +1585,7 @@ Reverts when a batch call failed. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendtoself) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CannotSendToSelf()` - Error hash: `0xb9afb000` @@ -1604,7 +1604,7 @@ reverts when specifying the same address for `from` or `to` in a token transfer. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotsendwithaddresszero) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CannotSendWithAddressZero()` - Error hash: `0xd2d5ec30` @@ -1629,7 +1629,7 @@ reverts when trying to: :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cannotuseaddresszeroasoperator) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CannotUseAddressZeroAsOperator()` - Error hash: `0x6355e766` @@ -1648,7 +1648,7 @@ reverts when trying to set the zero address as an operator. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cappedsupplycannotmintovercap) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CappedSupplyCannotMintOverCap()` - Error hash: `0xeacbf0d1` @@ -1669,7 +1669,7 @@ Reverts when trying to mint tokens but the [`totalSupply`](#totalsupply) has rea :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7cappedsupplyrequired) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7CappedSupplyRequired()` - Error hash: `0xacf1d8c5` @@ -1690,7 +1690,7 @@ Reverts when setting `0` for the [`tokenSupplyCap`](#tokensupplycap). The max to :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7decreasedallowancebelowzero) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7DecreasedAllowanceBelowZero()` - Error hash: `0x0ef76c35` @@ -1709,7 +1709,7 @@ Reverts when trying to decrease an operator's allowance to more than its current :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7invalidtransferbatch) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7InvalidTransferBatch()` - Error hash: `0x263eee8d` @@ -1728,7 +1728,7 @@ reverts when the array parameters used in [`transferBatch`](#transferbatch) have :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceivercontractmissinglsp1interface) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7NotifyTokenReceiverContractMissingLSP1Interface(address)` - Error hash: `0xa608fbb6` @@ -1755,7 +1755,7 @@ reverts if the `tokenReceiver` does not implement LSP1 when minting or transferr :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7notifytokenreceiveriseoa) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7NotifyTokenReceiverIsEOA(address)` - Error hash: `0x26c247f4` @@ -1780,7 +1780,7 @@ reverts if the `tokenReceiver` is an EOA when minting or transferring tokens wit :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokencontractcannotholdvalue) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7TokenContractCannotHoldValue()` - Error hash: `0x388f5adc` @@ -1801,7 +1801,7 @@ Error occurs when sending native tokens to the LSP7 contract without sending any :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#lsp7tokenownercannotbeoperator) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `LSP7TokenOwnerCannotBeOperator()` - Error hash: `0xdab75047` @@ -1820,7 +1820,7 @@ reverts when trying to authorize or revoke the token's owner as an operator. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#noextensionfoundforfunctionselector) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `NoExtensionFoundForFunctionSelector(bytes4)` - Error hash: `0xbb370b2b` @@ -1845,7 +1845,7 @@ reverts when there is no extension for the function selector being called with :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#operatorallowancecannotbeincreasedfromzero) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `OperatorAllowanceCannotBeIncreasedFromZero(address)` - Error hash: `0xcba6e977` @@ -1870,7 +1870,7 @@ Reverts when token owner call [`increaseAllowance`](#increaseallowance) for an o :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecallernottheowner) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `OwnableCallerNotTheOwner(address)` - Error hash: `0xbf1169c5` @@ -1895,7 +1895,7 @@ Reverts when only the owner is allowed to call the function. :::note References - Specification details: [**LSP-7-DigitalAsset**](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-7-DigitalAsset.md#ownablecannotsetzeroaddressasowner) -- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol) +- Solidity implementation: [`LSP7CappedSupply.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp7/contracts/extensions/LSP7CappedSupply.sol) - Error signature: `OwnableCannotSetZeroAddressAsOwner()` - Error hash: `0x1ad8836c` diff --git a/docs/libraries/lsp6/contracts/LSP6Utils.md b/docs/libraries/lsp6/contracts/LSP6Utils.md new file mode 100644 index 000000000..566ba984b --- /dev/null +++ b/docs/libraries/lsp6/contracts/LSP6Utils.md @@ -0,0 +1,254 @@ + + + +# LSP6Utils + +:::info Standard Specifications + +[`LSP-6-Utils.sol`](https://github.com/lukso-network/lips/tree/main/LSPs/LSP-6-Utils.sol.md) + +::: +:::info Solidity implementation + +[`LSP6Utils.sol`](https://github.com/lukso-network/lsp-smart-contracts/blob/develop/lsp6/contracts/LSP6Utils.sol) + +::: + +> LSP6 Utility library. + +LSP6Utils is a library of utility functions that can be used to retrieve, check and set LSP6 permissions stored under the ERC725Y storage of a smart contract. Based on the LSP6 Key Manager standard. + +## Internal Methods + +Any method labeled as `internal` serves as utility function within the contract. They can be used when writing solidity contracts that inherit from this contract. These methods can be extended or modified by overriding their internal behavior to suit specific needs. + +Internal functions cannot be called externally, whether from other smart contracts, dApp interfaces, or backend services. Their restricted accessibility ensures that they remain exclusively available within the context of the current contract, promoting controlled and encapsulated usage of these internal utilities. + +### getPermissionsFor + +:::info + +If the raw value fetched from the ERC725Y storage of `target` is not 32 bytes long, this is considered +like _"no permissions are set"_ and will return 32 x `0x00` bytes as `bytes32(0)`. + +::: + +```solidity +function getPermissionsFor(contract IERC725Y target, address caller) internal view returns (bytes32); +``` + +Read the permissions of a `caller` on an ERC725Y `target` contract. + +#### Parameters + +| Name | Type | Description | +| -------- | :-----------------: | ----------------------------------------------------- | +| `target` | `contract IERC725Y` | An `IERC725Y` contract where to read the permissions. | +| `caller` | `address` | The controller address to read the permissions from. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------------------------ | +| `0` | `bytes32` | A `bytes32` BitArray containing the permissions of a controller address. | + +
+ +### getAllowedCallsFor + +```solidity +function getAllowedCallsFor(contract IERC725Y target, address from) internal view returns (bytes); +``` + +
+ +### getAllowedERC725YDataKeysFor + +```solidity +function getAllowedERC725YDataKeysFor(contract IERC725Y target, address caller) internal view returns (bytes); +``` + +Read the Allowed ERC725Y data keys of a `caller` on an ERC725Y `target` contract. + +#### Parameters + +| Name | Type | Description | +| -------- | :-----------------: | ----------------------------------------------------- | +| `target` | `contract IERC725Y` | An `IERC725Y` contract where to read the permissions. | +| `caller` | `address` | The controller address to read the permissions from. | + +#### Returns + +| Name | Type | Description | +| ---- | :-----: | --------------------------------------------------------------------------------------------------------- | +| `0` | `bytes` | An abi-encoded array of allowed ERC725 data keys that the controller address is allowed to interact with. | + +
+ +### hasPermission + +```solidity +function hasPermission( + bytes32 controllerPermissions, + bytes32 permissionToCheck +) internal pure returns (bool); +``` + +Compare the permissions `controllerPermissions` of a controller address to check if they includes the permissions `permissionToCheck`. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-------: | --------------------------------------------------------------------------------- | +| `controllerPermissions` | `bytes32` | The permissions of an address. | +| `permissionToCheck` | `bytes32` | The permissions to check if the controller has under its `controllerPermissions`. | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ---------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if `controllerPermissions` includes `permissionToCheck`, `false` otherwise. | + +
+ +### isCompactBytesArrayOfAllowedCalls + +```solidity +function isCompactBytesArrayOfAllowedCalls( + bytes allowedCallsCompacted +) internal pure returns (bool); +``` + +Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that each element must be 32 bytes long. + +#### Parameters + +| Name | Type | Description | +| ----------------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowedCallsCompacted` | `bytes` | A compact bytes array of tuples `(bytes4,address,bytes4,bytes4)` to check (defined as `(bytes4,address,bytes4,bytes4)[CompactBytesArray]` in LSP6). | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | -------------------------------------------------------------------------------------------------------------- | +| `0` | `bool` | `true` if the value passed is a valid compact bytes array of bytes32 AllowedCalls elements, `false` otherwise. | + +
+ +### isCompactBytesArrayOfAllowedERC725YDataKeys + +```solidity +function isCompactBytesArrayOfAllowedERC725YDataKeys( + bytes allowedERC725YDataKeysCompacted +) internal pure returns (bool); +``` + +Same as `LSP2Utils.isCompactBytesArray` with the additional requirement that each element must be from 1 to 32 bytes long. + +#### Parameters + +| Name | Type | Description | +| --------------------------------- | :-----: | -------------------------------------------------------------------------------------------------------------------------------------- | +| `allowedERC725YDataKeysCompacted` | `bytes` | a compact bytes array of ERC725Y data Keys (full bytes32 data keys or bytesN prefix) to check (defined as `bytes[CompactBytesArray]`). | + +#### Returns + +| Name | Type | Description | +| ---- | :----: | ------------------------------------------------------------------------------------------------------------------ | +| `0` | `bool` | `true` if the value passed is a valid compact bytes array of bytes32 Allowed ERC725Y data keys, `false` otherwise. | + +
+ +### setDataViaKeyManager + +```solidity +function setDataViaKeyManager( + address keyManagerAddress, + bytes32[] keys, + bytes[] values +) internal nonpayable returns (bytes result); +``` + +Use the `setData(bytes32[],bytes[])` function via the KeyManager on the target contract. + +#### Parameters + +| Name | Type | Description | +| ------------------- | :---------: | ----------------------------------- | +| `keyManagerAddress` | `address` | The address of the KeyManager. | +| `keys` | `bytes32[]` | The array of `bytes32[]` data keys. | +| `values` | `bytes[]` | The array of `bytes[]` data values. | + +
+ +### combinePermissions + +```solidity +function combinePermissions( + bytes32[] permissions +) internal pure returns (bytes32); +``` + +Combine multiple permissions into a single `bytes32`. +Make sure that the sum of the values of the input array is less than `2^256-1 to avoid overflow. + +#### Parameters + +| Name | Type | Description | +| ------------- | :---------: | ------------------------------------ | +| `permissions` | `bytes32[]` | The array of permissions to combine. | + +#### Returns + +| Name | Type | Description | +| ---- | :-------: | ------------------------------------------------------ | +| `0` | `bytes32` | A `bytes32` value containing the combined permissions. | + +
+ +### generateNewPermissionsKeys + +```solidity +function generateNewPermissionsKeys(contract IERC725Y account, address controller, bytes32 permissions) internal view returns (bytes32[] keys, bytes[] values); +``` + +Generate a new set of 3 x LSP6 permission data keys to add a new `controller` on `account`. + +#### Parameters + +| Name | Type | Description | +| ------------- | :-----------------: | ----------------------------------------------------------------------------------------------- | +| `account` | `contract IERC725Y` | The ERC725Y contract to add the controller into (used to fetch the `LSP6Permissions[]` length). | +| `controller` | `address` | The address of the controller to grant permissions to. | +| `permissions` | `bytes32` | The `BitArray` of permissions to grant to the controller. | + +#### Returns + +| Name | Type | Description | +| -------- | :---------: | --------------------------------------- | +| `keys` | `bytes32[]` | An array of 3 x data keys containing: | +| `values` | `bytes[]` | An array of 3 x data values containing: | + +
+ +### getPermissionName + +```solidity +function getPermissionName(bytes32 permission) internal pure returns (string); +``` + +Returns the name of the permission as a string. + +#### Parameters + +| Name | Type | Description | +| ------------ | :-------: | ----------------------------------------------------------------------------------- | +| `permission` | `bytes32` | The low-level `bytes32` permission as a `BitArray` to get the permission name from. | + +#### Returns + +| Name | Type | Description | +| ---- | :------: | -------------------------------------------------- | +| `0` | `string` | The string name of the `bytes32` permission value. | + +
diff --git a/dodoc/config.ts b/dodoc/config.ts index a0867a008..d31d9c579 100644 --- a/dodoc/config.ts +++ b/dodoc/config.ts @@ -24,12 +24,12 @@ export const dodocConfig = { // tokens 'lsp4/contracts/LSP4DigitalAssetMetadata.sol', - 'contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol', - 'contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol', - 'contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol', - 'contracts/LSP7DigitalAsset/extensions/LSP7CompatibleERC20.sol', - 'contracts/LSP7DigitalAsset/presets/LSP7CompatibleERC20Mintable.sol', - 'contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol', + 'lsp7/contracts/LSP7DigitalAsset.sol', + 'lsp7/contracts/extensions/LSP7Burnable.sol', + 'lsp7/contracts/extensions/LSP7CappedSupply.sol', + 'lsp7/contracts/extensions/LSP7CompatibleERC20.sol', + 'lsp7/contracts/presets/LSP7CompatibleERC20Mintable.sol', + 'lsp7/contracts/presets/LSP7Mintable.sol', 'contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol', 'contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol', 'contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol', @@ -335,6 +335,13 @@ const generateContractSpecsDetails = (contractName: string) => { if (value.endsWith(`${contractName}.sol`)) return value; })[0]; + if (contractPath.startsWith('lsp7/contracts')) { + return { + specsName: 'LSP-7-DigitalAsset', + specsLink: `${linkBase}lips/tree/main/LSPs/LSP-7-DigitalAsset.md`, + }; + } + const specsIndex = contractPath.startsWith('lsp') ? 2 : 1; const specs = contractPath.split('/')[specsIndex]; diff --git a/package-lock.json b/package-lock.json index c4e18013d..16f701295 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "lsp4": "*", "lsp5": "*", "lsp6": "*", + "lsp7": "*", "solidity-bytes-utils": "0.8.0" }, "devDependencies": { @@ -13547,6 +13548,10 @@ "resolved": "packages/LSP6KeyManager", "link": true }, + "node_modules/lsp7": { + "resolved": "packages/LSP7DigitalAsset", + "link": true + }, "node_modules/ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", @@ -24061,6 +24066,33 @@ "typechain": "^8.0.0", "typescript": "^5.3.3" } + }, + "packages/LSP7DigitalAsset": { + "version": "0.12.1", + "license": "Apache-2.0", + "dependencies": { + "@erc725/smart-contracts": "^7.0.0", + "@openzeppelin/contracts": "^4.9.3", + "lsp1": "*", + "lsp17contractextension": "*" + }, + "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": "^5.3.3" + } } }, "dependencies": { @@ -34534,6 +34566,30 @@ "typescript": "^5.3.3" } }, + "lsp7": { + "version": "file:packages/LSP7DigitalAsset", + "requires": { + "@erc725/smart-contracts": "^7.0.0", + "@nomicfoundation/hardhat-toolbox": "^2.0.2", + "@openzeppelin/contracts": "^4.9.3", + "@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", + "lsp1": "*", + "lsp17contractextension": "*", + "solhint": "^3.3.6", + "ts-node": "^10.2.0", + "tsconfig": "*", + "typechain": "^8.0.0", + "typescript": "^5.3.3" + } + }, "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", diff --git a/package.json b/package.json index ca92260e4..d1f7f43d5 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "lsp4": "*", "lsp5": "*", "lsp6": "*", + "lsp7": "*", "lsp10": "*", "lsp14": "*", "lsp17contractextension": "*", diff --git a/packages/LSP7DigitalAsset/.eslintrc.js b/packages/LSP7DigitalAsset/.eslintrc.js new file mode 100644 index 000000000..03ee7431b --- /dev/null +++ b/packages/LSP7DigitalAsset/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['custom'], +}; diff --git a/packages/LSP7DigitalAsset/.solhint.json b/packages/LSP7DigitalAsset/.solhint.json new file mode 100644 index 000000000..26e01c48a --- /dev/null +++ b/packages/LSP7DigitalAsset/.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/LSP7DigitalAsset/README.md b/packages/LSP7DigitalAsset/README.md new file mode 100644 index 000000000..7b7753e30 --- /dev/null +++ b/packages/LSP7DigitalAsset/README.md @@ -0,0 +1,3 @@ +# LSP7 Digital Asset + +Package for the LSP7 Digital Asset standard. diff --git a/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol b/packages/LSP7DigitalAsset/contracts/ILSP7DigitalAsset.sol similarity index 100% rename from contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol rename to packages/LSP7DigitalAsset/contracts/ILSP7DigitalAsset.sol diff --git a/contracts/LSP7DigitalAsset/LSP7Constants.sol b/packages/LSP7DigitalAsset/contracts/LSP7Constants.sol similarity index 100% rename from contracts/LSP7DigitalAsset/LSP7Constants.sol rename to packages/LSP7DigitalAsset/contracts/LSP7Constants.sol diff --git a/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol b/packages/LSP7DigitalAsset/contracts/LSP7DigitalAsset.sol similarity index 100% rename from contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol rename to packages/LSP7DigitalAsset/contracts/LSP7DigitalAsset.sol diff --git a/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol b/packages/LSP7DigitalAsset/contracts/LSP7DigitalAssetCore.sol similarity index 100% rename from contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol rename to packages/LSP7DigitalAsset/contracts/LSP7DigitalAssetCore.sol diff --git a/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol b/packages/LSP7DigitalAsset/contracts/LSP7DigitalAssetInitAbstract.sol similarity index 100% rename from contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol rename to packages/LSP7DigitalAsset/contracts/LSP7DigitalAssetInitAbstract.sol diff --git a/contracts/LSP7DigitalAsset/LSP7Errors.sol b/packages/LSP7DigitalAsset/contracts/LSP7Errors.sol similarity index 100% rename from contracts/LSP7DigitalAsset/LSP7Errors.sol rename to packages/LSP7DigitalAsset/contracts/LSP7Errors.sol diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol b/packages/LSP7DigitalAsset/contracts/extensions/LSP7Burnable.sol similarity index 100% rename from contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol rename to packages/LSP7DigitalAsset/contracts/extensions/LSP7Burnable.sol diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol b/packages/LSP7DigitalAsset/contracts/extensions/LSP7BurnableInitAbstract.sol similarity index 100% rename from contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol rename to packages/LSP7DigitalAsset/contracts/extensions/LSP7BurnableInitAbstract.sol diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol b/packages/LSP7DigitalAsset/contracts/extensions/LSP7CappedSupply.sol similarity index 100% rename from contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol rename to packages/LSP7DigitalAsset/contracts/extensions/LSP7CappedSupply.sol diff --git a/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol b/packages/LSP7DigitalAsset/contracts/extensions/LSP7CappedSupplyInitAbstract.sol similarity index 100% rename from contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol rename to packages/LSP7DigitalAsset/contracts/extensions/LSP7CappedSupplyInitAbstract.sol diff --git a/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol b/packages/LSP7DigitalAsset/contracts/presets/ILSP7Mintable.sol similarity index 100% rename from contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol rename to packages/LSP7DigitalAsset/contracts/presets/ILSP7Mintable.sol diff --git a/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol b/packages/LSP7DigitalAsset/contracts/presets/LSP7Mintable.sol similarity index 100% rename from contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol rename to packages/LSP7DigitalAsset/contracts/presets/LSP7Mintable.sol diff --git a/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol b/packages/LSP7DigitalAsset/contracts/presets/LSP7MintableInit.sol similarity index 100% rename from contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol rename to packages/LSP7DigitalAsset/contracts/presets/LSP7MintableInit.sol diff --git a/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol b/packages/LSP7DigitalAsset/contracts/presets/LSP7MintableInitAbstract.sol similarity index 100% rename from contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol rename to packages/LSP7DigitalAsset/contracts/presets/LSP7MintableInitAbstract.sol diff --git a/packages/LSP7DigitalAsset/hardhat.config.ts b/packages/LSP7DigitalAsset/hardhat.config.ts new file mode 100644 index 000000000..d818a205d --- /dev/null +++ b/packages/LSP7DigitalAsset/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/LSP7DigitalAsset/package.json b/packages/LSP7DigitalAsset/package.json new file mode 100644 index 000000000..d8ec06047 --- /dev/null +++ b/packages/LSP7DigitalAsset/package.json @@ -0,0 +1,47 @@ +{ + "name": "lsp7", + "version": "0.12.1", + "description": "Package for the LSP7 Digital Asset 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", + "@openzeppelin/contracts": "^4.9.3", + "lsp1": "*", + "lsp17contractextension": "*" + }, + "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": "^5.3.3" + } +} diff --git a/packages/LSP7DigitalAsset/tsconfig.json b/packages/LSP7DigitalAsset/tsconfig.json new file mode 100644 index 000000000..b7a34e03f --- /dev/null +++ b/packages/LSP7DigitalAsset/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "tsconfig/contracts.json", + "include": ["**/*.ts"] +} diff --git a/remappings.txt b/remappings.txt index c295d48e6..77ec56c30 100644 --- a/remappings.txt +++ b/remappings.txt @@ -13,6 +13,7 @@ lsp2/=packages/LSP2ERC725YJSONSchema/ lsp4/=packages/LSP4DigitalAssetMetadata/ lsp5/=packages/LSP5ReceivedAssets/ lsp6/=packages/LSP6KeyManager/ +lsp7/=packages/LSP7DigitalAsset/ lsp10/=packages/LSP10ReceivedVaults/ lsp14/=packages/LSP14Ownable2Step/ lsp17contractextension/=packages/LSP17ContractExtension/ diff --git a/tests/Benchmark.test.ts b/tests/Benchmark.test.ts index 48418fa73..42d9006fb 100644 --- a/tests/Benchmark.test.ts +++ b/tests/Benchmark.test.ts @@ -3,12 +3,11 @@ import { ethers } from 'hardhat'; import { expect } from 'chai'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { LSP1UniversalReceiverDelegateUP, LSP1UniversalReceiverDelegateUP__factory, LSP6KeyManager__factory, - LSP7Mintable, - LSP7Mintable__factory, LSP8Mintable, LSP8Mintable__factory, UniversalProfile, diff --git a/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts b/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts index 94ad6e9da..fe14c27c4 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts +++ b/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts @@ -2,9 +2,8 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { - LSP7Mintable, - LSP7Mintable__factory, LSP8Mintable, LSP8Mintable__factory, TargetContract, diff --git a/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts b/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts index aefc7ac42..bf4774497 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts +++ b/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts @@ -2,6 +2,7 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { SignatureValidator, SignatureValidator__factory, @@ -9,8 +10,6 @@ import { TargetContract__factory, UniversalProfile, UniversalProfile__factory, - LSP7Mintable, - LSP7Mintable__factory, } from '../../../../types'; // constants diff --git a/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts b/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts index fcae67d80..f7daed01b 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts +++ b/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts @@ -9,7 +9,7 @@ import { ERC725YDataKeys, LSP4_TOKEN_TYPES, OPERATION_TYPES } from '../../../../ import { LSP6TestContext } from '../../../utils/context'; import { setupKeyManager } from '../../../utils/fixtures'; import { abiCoder, provider } from '../../../utils/helpers'; -import { LSP7Mintable, LSP7MintableInit__factory, LSP7Mintable__factory } from '../../../../types'; +import { LSP7Mintable, LSP7MintableInit__factory, LSP7Mintable__factory } from 'lsp7/types'; export const shouldBehaveLikeBatchExecute = ( buildContext: (initialFunding?: BigNumber) => Promise, diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts b/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts index 5ddbef075..68e985798 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts +++ b/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts @@ -4,11 +4,10 @@ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { BigNumber } from 'ethers'; import { FakeContract, smock } from '@defi-wonderland/smock'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { ExecutorLSP20, ExecutorLSP20__factory, - LSP7Mintable, - LSP7Mintable__factory, TargetContract__factory, TargetPayableContract, TargetPayableContract__factory, diff --git a/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts b/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts index b1ffe13ce..14615cfe4 100644 --- a/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts +++ b/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts @@ -3,9 +3,8 @@ import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { EIP191Signer } from '@lukso/eip191-signer.js'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { - LSP7Mintable, - LSP7Mintable__factory, LSP8Mintable, LSP8Mintable__factory, TargetContract, diff --git a/tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts b/tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts index be8b30b08..276e6b0a9 100644 --- a/tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts +++ b/tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts @@ -2,6 +2,7 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { SignatureValidator, SignatureValidator__factory, @@ -9,8 +10,6 @@ import { TargetContract__factory, UniversalProfile, UniversalProfile__factory, - LSP7Mintable, - LSP7Mintable__factory, } from '../../../types'; // constants diff --git a/tests/LSP6KeyManager/Interactions/BatchExecute.test.ts b/tests/LSP6KeyManager/Interactions/BatchExecute.test.ts index dd9532e6d..0018cc811 100644 --- a/tests/LSP6KeyManager/Interactions/BatchExecute.test.ts +++ b/tests/LSP6KeyManager/Interactions/BatchExecute.test.ts @@ -14,7 +14,7 @@ import { import { LSP6TestContext } from '../../utils/context'; import { setupKeyManager } from '../../utils/fixtures'; import { abiCoder, provider } from '../../utils/helpers'; -import { LSP7Mintable, LSP7MintableInit__factory, LSP7Mintable__factory } from '../../../types'; +import { LSP7Mintable, LSP7MintableInit__factory, LSP7Mintable__factory } from 'lsp7/types'; export const shouldBehaveLikeBatchExecute = ( buildContext: (initialFunding?: BigNumber) => Promise, diff --git a/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts b/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts index 1d3626f4d..a288cbe1c 100644 --- a/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts +++ b/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts @@ -5,11 +5,10 @@ import { EIP191Signer } from '@lukso/eip191-signer.js'; import { BigNumber } from 'ethers'; import { FakeContract, smock } from '@defi-wonderland/smock'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { Executor, Executor__factory, - LSP7Mintable, - LSP7Mintable__factory, TargetContract__factory, TargetPayableContract, TargetPayableContract__factory, diff --git a/tests/LSP6KeyManager/LSP6ControlledToken.test.ts b/tests/LSP6KeyManager/LSP6ControlledToken.test.ts index ccd5e6eeb..27bb82180 100644 --- a/tests/LSP6KeyManager/LSP6ControlledToken.test.ts +++ b/tests/LSP6KeyManager/LSP6ControlledToken.test.ts @@ -3,11 +3,10 @@ import { expect } from 'chai'; import { BytesLike } from 'ethers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { LSP6KeyManager, LSP6KeyManager__factory, - LSP7Mintable, - LSP7Mintable__factory, LSP7Tester__factory, LSP8Mintable, LSP0ERC725Account__factory, diff --git a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts index 34d7cc193..ae05a4baa 100644 --- a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts +++ b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts @@ -5,12 +5,8 @@ import { BigNumber } from 'ethers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { EIP191Signer } from '@lukso/eip191-signer.js'; -import { - LSP7Mintable, - LSP7Mintable__factory, - TargetContract, - TargetContract__factory, -} from '../../../types'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; +import { TargetContract, TargetContract__factory } from '../../../types'; // constants import { diff --git a/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts b/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts index 0ee2d4782..2c9afb989 100644 --- a/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts +++ b/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts @@ -1,6 +1,6 @@ import { ethers } from 'hardhat'; import { expect } from 'chai'; -import { LSP7MintableInit, LSP7MintableInit__factory } from '../../../types'; +import { LSP7MintableInit, LSP7MintableInit__factory } from 'lsp7/types'; import { shouldInitializeLikeLSP7 } from '../LSP7DigitalAsset.behaviour'; import { diff --git a/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts b/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts index c9afcaf9d..ffb922cb5 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts @@ -1,5 +1,5 @@ import { LSP4_TOKEN_TYPES } from '../../../constants'; -import { LSP7Mintable, LSP7Mintable__factory } from '../../../types'; +import { LSP7Mintable, LSP7Mintable__factory } from 'lsp7/types'; import { shouldInitializeLikeLSP7 } from '../LSP7DigitalAsset.behaviour'; import {