@lukso/lsp7-contracts 0.16.3 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -1
- package/contracts/ILSP7DigitalAsset.sol +3 -0
- package/contracts/LSP7DigitalAssetInitAbstract.sol +7 -5
- package/dist/abi.cjs +4806 -0
- package/dist/abi.d.cts +7104 -0
- package/dist/abi.d.mts +7104 -0
- package/dist/abi.d.ts +7104 -0
- package/dist/abi.mjs +4794 -0
- package/package.json +32 -24
- package/artifacts/ILSP7DigitalAsset.json +0 -391
- package/artifacts/LSP7Burnable.json +0 -817
- package/artifacts/LSP7BurnableInitAbstract.json +0 -825
- package/artifacts/LSP7CappedSupply.json +0 -817
- package/artifacts/LSP7CappedSupplyInitAbstract.json +0 -825
- package/artifacts/LSP7DigitalAsset.json +0 -794
- package/artifacts/LSP7DigitalAssetInitAbstract.json +0 -802
- package/artifacts/LSP7Mintable.json +0 -853
- package/artifacts/LSP7MintableInit.json +0 -873
- package/artifacts/LSP7Votes.json +0 -1154
- package/artifacts/LSP7VotesInitAbstract.json +0 -1146
- package/types/index.ts +0 -9021
- /package/dist/{index.cjs → constants.cjs} +0 -0
- /package/dist/{index.d.cts → constants.d.cts} +0 -0
- /package/dist/{index.d.mts → constants.d.mts} +0 -0
- /package/dist/{index.d.ts → constants.d.ts} +0 -0
- /package/dist/{index.mjs → constants.mjs} +0 -0
package/README.md
CHANGED
|
@@ -10,7 +10,9 @@ npm install @lukso/lsp7-contracts
|
|
|
10
10
|
|
|
11
11
|
## Available Constants & Types
|
|
12
12
|
|
|
13
|
-
The `@lukso/lsp7-contracts` npm package contains useful constants such as interface IDs or ERC725Y data keys related to the LSP7 Standard. You can import and access them as follows
|
|
13
|
+
The `@lukso/lsp7-contracts` npm package contains useful constants such as interface IDs or ERC725Y data keys related to the LSP7 Standard. You can import and access them as follows.
|
|
14
|
+
|
|
15
|
+
In Javascript.
|
|
14
16
|
|
|
15
17
|
```js
|
|
16
18
|
import {
|
|
@@ -20,6 +22,22 @@ import {
|
|
|
20
22
|
} from "@lukso/lsp7-contracts";
|
|
21
23
|
```
|
|
22
24
|
|
|
25
|
+
In Solidity.
|
|
26
|
+
|
|
27
|
+
<!-- prettier-ignore -->
|
|
28
|
+
```solidity
|
|
29
|
+
import {
|
|
30
|
+
_INTERFACEID_LSP7,
|
|
31
|
+
_INTERFACEID_LSP7_V0_12_0,
|
|
32
|
+
_INTERFACEID_LSP7_V0_14_0,
|
|
33
|
+
_TYPEID_LSP7_DELEGATOR,
|
|
34
|
+
_TYPEID_LSP7_DELEGATEE,
|
|
35
|
+
_TYPEID_LSP7_TOKENSSENDER,
|
|
36
|
+
_TYPEID_LSP7_TOKENSRECIPIENT,
|
|
37
|
+
_TYPEID_LSP7_TOKENOPERATOR
|
|
38
|
+
} from "@lukso/lsp7-contracts/contracts/LSP7Constants.sol";
|
|
39
|
+
```
|
|
40
|
+
|
|
23
41
|
The `LSP7_TYPE_IDS` includes type IDs for the following type of notifications:
|
|
24
42
|
|
|
25
43
|
```console
|
|
@@ -29,3 +47,21 @@ The `LSP7_TYPE_IDS` includes type IDs for the following type of notifications:
|
|
|
29
47
|
'LSP7Tokens_VotesDelegatorNotification';
|
|
30
48
|
'LSP7Tokens_VotesDelegateeNotification';
|
|
31
49
|
```
|
|
50
|
+
|
|
51
|
+
## Typescript types
|
|
52
|
+
|
|
53
|
+
You can also import the [type-safe ABI](https://abitype.dev/) from the `/abi` path.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import {
|
|
57
|
+
// standard version
|
|
58
|
+
lsp7DigitalAssetAbi,
|
|
59
|
+
lsp7CappedSupplyAbi,
|
|
60
|
+
lsp7MintableAbi,
|
|
61
|
+
lsp7VotesAbi
|
|
62
|
+
// proxy version
|
|
63
|
+
lsp7CappedSupplyInitAbstractAbi,
|
|
64
|
+
lsp7DigitalAssetInitAbstractAbi,
|
|
65
|
+
lsp7MintableInitAbi,
|
|
66
|
+
} from '@lukso/lsp7-contracts/abi';
|
|
67
|
+
```
|
|
@@ -250,6 +250,9 @@ interface ILSP7DigitalAsset {
|
|
|
250
250
|
*
|
|
251
251
|
* @custom:info if the `to` address is a contract that implements LSP1, it will always be notified via its `universalReceiver(...)` function, regardless if `force` is set to `true` or `false`.
|
|
252
252
|
*
|
|
253
|
+
* @custom:info Note that token transfers revert when no allowance is given, including when the `amount` is `0`.
|
|
254
|
+
* This is to prevent this function from being used maliciously, such as performing zero-value token transfer phishing attacks.
|
|
255
|
+
*
|
|
253
256
|
* @custom:warning Be aware that when either the sender or the recipient can have logic that revert in their `universalReceiver(...)` function when being notified.
|
|
254
257
|
* This even if the `force` was set to `true`.
|
|
255
258
|
*/
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
ERC725YInitAbstract
|
|
20
20
|
} from "@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol";
|
|
21
21
|
import {
|
|
22
|
-
|
|
23
|
-
} from "@lukso/lsp17contractextension-contracts/contracts/
|
|
22
|
+
LSP17ExtendableInitAbstract
|
|
23
|
+
} from "@lukso/lsp17contractextension-contracts/contracts/LSP17ExtendableInitAbstract.sol";
|
|
24
24
|
|
|
25
25
|
// libraries
|
|
26
26
|
import {LSP1Utils} from "@lukso/lsp1-contracts/contracts/LSP1Utils.sol";
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
abstract contract LSP7DigitalAssetInitAbstract is
|
|
78
78
|
ILSP7DigitalAsset,
|
|
79
79
|
LSP4DigitalAssetMetadataInitAbstract,
|
|
80
|
-
|
|
80
|
+
LSP17ExtendableInitAbstract
|
|
81
81
|
{
|
|
82
82
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
83
83
|
|
|
@@ -236,13 +236,15 @@ abstract contract LSP7DigitalAssetInitAbstract is
|
|
|
236
236
|
public
|
|
237
237
|
view
|
|
238
238
|
virtual
|
|
239
|
-
override(ERC725YInitAbstract,
|
|
239
|
+
override(ERC725YInitAbstract, LSP17ExtendableInitAbstract)
|
|
240
240
|
returns (bool)
|
|
241
241
|
{
|
|
242
242
|
return
|
|
243
243
|
interfaceId == _INTERFACEID_LSP7 ||
|
|
244
244
|
super.supportsInterface(interfaceId) ||
|
|
245
|
-
|
|
245
|
+
LSP17ExtendableInitAbstract._supportsInterfaceInERC165Extension(
|
|
246
|
+
interfaceId
|
|
247
|
+
);
|
|
246
248
|
}
|
|
247
249
|
|
|
248
250
|
// --- Token queries
|