@lukso/lsp7-contracts 0.15.0-rc.0
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 +3 -0
- package/artifacts/LSP7CappedSupply.json +828 -0
- package/artifacts/LSP7CappedSupplyInitAbstract.json +841 -0
- package/artifacts/LSP7DigitalAsset.json +805 -0
- package/artifacts/LSP7DigitalAssetInitAbstract.json +818 -0
- package/artifacts/LSP7Mintable.json +864 -0
- package/artifacts/LSP7MintableInit.json +884 -0
- package/contracts/ILSP7DigitalAsset.sol +309 -0
- package/contracts/LSP7Constants.sol +16 -0
- package/contracts/LSP7DigitalAsset.sol +198 -0
- package/contracts/LSP7DigitalAssetCore.sol +744 -0
- package/contracts/LSP7DigitalAssetInitAbstract.sol +194 -0
- package/contracts/LSP7Errors.sol +103 -0
- package/contracts/extensions/LSP7Burnable.sol +26 -0
- package/contracts/extensions/LSP7BurnableInitAbstract.sol +27 -0
- package/contracts/extensions/LSP7CappedSupply.sol +83 -0
- package/contracts/extensions/LSP7CappedSupplyInitAbstract.sol +86 -0
- package/contracts/presets/ILSP7Mintable.sol +32 -0
- package/contracts/presets/LSP7Mintable.sol +53 -0
- package/contracts/presets/LSP7MintableInit.sol +44 -0
- package/contracts/presets/LSP7MintableInitAbstract.sol +57 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.mjs +11 -0
- package/package.json +54 -0
- package/types/LSP7CappedSupply.ts +712 -0
- package/types/LSP7CappedSupplyInitAbstract.ts +743 -0
- package/types/LSP7DigitalAsset.ts +698 -0
- package/types/LSP7DigitalAssetInitAbstract.ts +729 -0
- package/types/LSP7Mintable.ts +717 -0
- package/types/LSP7MintableInit.ts +779 -0
- package/types/common.ts +131 -0
- package/types/contracts/LSP7DigitalAsset.ts +698 -0
- package/types/contracts/LSP7DigitalAssetInitAbstract.ts +729 -0
- package/types/contracts/extensions/LSP7CappedSupply.ts +712 -0
- package/types/contracts/extensions/LSP7CappedSupplyInitAbstract.ts +743 -0
- package/types/contracts/presets/LSP7Mintable.ts +717 -0
- package/types/contracts/presets/LSP7MintableInit.ts +779 -0
- package/types/index.ts +16 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.4;
|
|
4
|
+
|
|
5
|
+
// interfaces
|
|
6
|
+
import {ILSP7Mintable} from "./ILSP7Mintable.sol";
|
|
7
|
+
|
|
8
|
+
// modules
|
|
9
|
+
import {
|
|
10
|
+
LSP7DigitalAssetInitAbstract
|
|
11
|
+
} from "../LSP7DigitalAssetInitAbstract.sol";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @dev LSP7DigitalAsset deployable preset contract (inheritable proxy version) with a public {mint} function callable only by the contract {owner}.
|
|
15
|
+
*/
|
|
16
|
+
abstract contract LSP7MintableInitAbstract is
|
|
17
|
+
LSP7DigitalAssetInitAbstract,
|
|
18
|
+
ILSP7Mintable
|
|
19
|
+
{
|
|
20
|
+
/**
|
|
21
|
+
* @notice Initialize a `LSP7MintableInitAbstract` token contract with: token name = `name_`, token symbol = `symbol_`, and
|
|
22
|
+
* address `newOwner_` as the token contract owner.
|
|
23
|
+
*
|
|
24
|
+
* @param name_ The name of the token.
|
|
25
|
+
* @param symbol_ The symbol of the token.
|
|
26
|
+
* @param newOwner_ The owner of the token contract.
|
|
27
|
+
* @param lsp4TokenType_ The type of token this digital asset contract represents (`0` = Token, `1` = NFT, `2` = Collection).
|
|
28
|
+
* @param isNonDivisible_ Specify if the LSP7 token is a fungible or non-fungible token.
|
|
29
|
+
*/
|
|
30
|
+
function _initialize(
|
|
31
|
+
string memory name_,
|
|
32
|
+
string memory symbol_,
|
|
33
|
+
address newOwner_,
|
|
34
|
+
uint256 lsp4TokenType_,
|
|
35
|
+
bool isNonDivisible_
|
|
36
|
+
) internal virtual override onlyInitializing {
|
|
37
|
+
LSP7DigitalAssetInitAbstract._initialize(
|
|
38
|
+
name_,
|
|
39
|
+
symbol_,
|
|
40
|
+
newOwner_,
|
|
41
|
+
lsp4TokenType_,
|
|
42
|
+
isNonDivisible_
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @dev Public {_mint} function only callable by the {owner}.
|
|
48
|
+
*/
|
|
49
|
+
function mint(
|
|
50
|
+
address to,
|
|
51
|
+
uint256 amount,
|
|
52
|
+
bool force,
|
|
53
|
+
bytes memory data
|
|
54
|
+
) public virtual override onlyOwner {
|
|
55
|
+
_mint(to, amount, force, data);
|
|
56
|
+
}
|
|
57
|
+
}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const INTERFACE_ID_LSP7 = "0xc52d6008";
|
|
4
|
+
const LSP7_TYPE_IDS = {
|
|
5
|
+
// keccak256('LSP7Tokens_SenderNotification')
|
|
6
|
+
LSP7Tokens_SenderNotification: "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea",
|
|
7
|
+
// keccak256('LSP7Tokens_RecipientNotification')
|
|
8
|
+
LSP7Tokens_RecipientNotification: "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c",
|
|
9
|
+
// keccak256('LSP7Tokens_OperatorNotification')
|
|
10
|
+
LSP7Tokens_OperatorNotification: "0x386072cc5a58e61263b434c722725f21031cd06e7c552cfaa06db5de8a320dbc"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.INTERFACE_ID_LSP7 = INTERFACE_ID_LSP7;
|
|
14
|
+
exports.LSP7_TYPE_IDS = LSP7_TYPE_IDS;
|
package/dist/index.d.cts
ADDED
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const INTERFACE_ID_LSP7 = "0xc52d6008";
|
|
2
|
+
const LSP7_TYPE_IDS = {
|
|
3
|
+
// keccak256('LSP7Tokens_SenderNotification')
|
|
4
|
+
LSP7Tokens_SenderNotification: "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea",
|
|
5
|
+
// keccak256('LSP7Tokens_RecipientNotification')
|
|
6
|
+
LSP7Tokens_RecipientNotification: "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c",
|
|
7
|
+
// keccak256('LSP7Tokens_OperatorNotification')
|
|
8
|
+
LSP7Tokens_OperatorNotification: "0x386072cc5a58e61263b434c722725f21031cd06e7c552cfaa06db5de8a320dbc"
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { INTERFACE_ID_LSP7, LSP7_TYPE_IDS };
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lukso/lsp7-contracts",
|
|
3
|
+
"version": "0.15.0-rc.0",
|
|
4
|
+
"description": "Package for the LSP7 Digital Asset standard",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.mjs",
|
|
9
|
+
"typings": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./artifacts/*": "./artifacts/*",
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"contracts/**/*.sol",
|
|
21
|
+
"!contracts/Mocks/**/*.sol",
|
|
22
|
+
"artifacts/*.json",
|
|
23
|
+
"dist",
|
|
24
|
+
"types",
|
|
25
|
+
"!types/factories",
|
|
26
|
+
"./README.md"
|
|
27
|
+
],
|
|
28
|
+
"keywords": [
|
|
29
|
+
"LUKSO",
|
|
30
|
+
"LSP",
|
|
31
|
+
"Blockchain",
|
|
32
|
+
"Standards",
|
|
33
|
+
"Smart Contracts",
|
|
34
|
+
"Ethereum",
|
|
35
|
+
"EVM",
|
|
36
|
+
"Solidity"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"package": "hardhat prepare-package",
|
|
40
|
+
"build": "hardhat compile --show-stack-traces",
|
|
41
|
+
"build:js": "unbuild",
|
|
42
|
+
"build:types": "npx typechain --target=ethers-v6 ./artifacts/*.json --out-dir types",
|
|
43
|
+
"clean": "hardhat clean && rm -Rf dist/",
|
|
44
|
+
"format": "prettier --write .",
|
|
45
|
+
"lint": "eslint . --ext .ts,.js",
|
|
46
|
+
"lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@erc725/smart-contracts": "^7.0.0",
|
|
50
|
+
"@openzeppelin/contracts": "^4.9.3",
|
|
51
|
+
"@lukso/lsp1-contracts": "*",
|
|
52
|
+
"@lukso/lsp17contractextension-contracts": "*"
|
|
53
|
+
}
|
|
54
|
+
}
|