@lukso/lsp20-contracts 0.15.0 → 0.15.1

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 CHANGED
@@ -10,7 +10,9 @@ npm i @lukso/lsp20-contracts
10
10
 
11
11
  ## Available Constants & Types
12
12
 
13
- The `@lukso/lsp20-contracts` npm package contains useful constants such as InterfaceIds, and specific constants related to the LSP20 Standard. You can import and access them as follow:
13
+ The `@lukso/lsp20-contracts` npm package contains useful constants such as interface IDs, and specific constants related to the LSP20 Standard. You can import and access them as follows.
14
+
15
+ In Javascript.
14
16
 
15
17
  ```js
16
18
  import {
@@ -19,3 +21,16 @@ import {
19
21
  INTERFACE_ID_LSP20CallVerification,
20
22
  } from "@lukso/lsp20-contracts";
21
23
  ```
24
+
25
+ In Solidity.
26
+
27
+ <!-- prettier-ignore -->
28
+ ```solidity
29
+ import {
30
+ _INTERFACEID_LSP20_CALL_VERIFICATION,
31
+ _INTERFACEID_LSP20_CALL_VERIFIER,
32
+ _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITH_POST_VERIFICATION,
33
+ _LSP20_VERIFY_CALL_SUCCESS_VALUE_WITHOUT_POST_VERIFICATION,
34
+ _LSP20_VERIFY_CALL_RESULT_SUCCESS_VALUE
35
+ } from "@lukso/lsp20-contracts/contracts/LSP20Constants.sol";
36
+ ```
@@ -9,7 +9,7 @@ pragma solidity ^0.8.4;
9
9
  interface ILSP20CallVerifier {
10
10
  /**
11
11
  * @return returnedStatus MUST return the first 3 bytes of `lsp20VerifyCall(address,uint256,bytes)` function selector if the call to
12
- * the function is allowed, concatened with a byte that determines if the lsp20VerifyCallResult function should
12
+ * the function is allowed, concatenated with a byte that determines if the lsp20VerifyCallResult function should
13
13
  * be called after the original function call. The byte that invoke the lsp20VerifyCallResult function is strictly `0x01`.
14
14
  *
15
15
  * @param requestor The address that requested to make the call to `target`.
package/dist/abi.cjs ADDED
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ const ilsp20CallVerifierAbi = [
4
+ {
5
+ type: "function",
6
+ inputs: [
7
+ { name: "requestor", internalType: "address", type: "address" },
8
+ { name: "target", internalType: "address", type: "address" },
9
+ { name: "caller", internalType: "address", type: "address" },
10
+ { name: "value", internalType: "uint256", type: "uint256" },
11
+ { name: "callData", internalType: "bytes", type: "bytes" }
12
+ ],
13
+ name: "lsp20VerifyCall",
14
+ outputs: [
15
+ { name: "returnedStatus", internalType: "bytes4", type: "bytes4" }
16
+ ],
17
+ stateMutability: "nonpayable"
18
+ },
19
+ {
20
+ type: "function",
21
+ inputs: [
22
+ { name: "callHash", internalType: "bytes32", type: "bytes32" },
23
+ { name: "callResult", internalType: "bytes", type: "bytes" }
24
+ ],
25
+ name: "lsp20VerifyCallResult",
26
+ outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }],
27
+ stateMutability: "nonpayable"
28
+ }
29
+ ];
30
+ const lsp20CallVerificationAbi = [];
31
+
32
+ exports.ilsp20CallVerifierAbi = ilsp20CallVerifierAbi;
33
+ exports.lsp20CallVerificationAbi = lsp20CallVerificationAbi;
package/dist/abi.d.cts ADDED
@@ -0,0 +1,52 @@
1
+ declare const ilsp20CallVerifierAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly inputs: readonly [{
4
+ readonly name: "requestor";
5
+ readonly internalType: "address";
6
+ readonly type: "address";
7
+ }, {
8
+ readonly name: "target";
9
+ readonly internalType: "address";
10
+ readonly type: "address";
11
+ }, {
12
+ readonly name: "caller";
13
+ readonly internalType: "address";
14
+ readonly type: "address";
15
+ }, {
16
+ readonly name: "value";
17
+ readonly internalType: "uint256";
18
+ readonly type: "uint256";
19
+ }, {
20
+ readonly name: "callData";
21
+ readonly internalType: "bytes";
22
+ readonly type: "bytes";
23
+ }];
24
+ readonly name: "lsp20VerifyCall";
25
+ readonly outputs: readonly [{
26
+ readonly name: "returnedStatus";
27
+ readonly internalType: "bytes4";
28
+ readonly type: "bytes4";
29
+ }];
30
+ readonly stateMutability: "nonpayable";
31
+ }, {
32
+ readonly type: "function";
33
+ readonly inputs: readonly [{
34
+ readonly name: "callHash";
35
+ readonly internalType: "bytes32";
36
+ readonly type: "bytes32";
37
+ }, {
38
+ readonly name: "callResult";
39
+ readonly internalType: "bytes";
40
+ readonly type: "bytes";
41
+ }];
42
+ readonly name: "lsp20VerifyCallResult";
43
+ readonly outputs: readonly [{
44
+ readonly name: "";
45
+ readonly internalType: "bytes4";
46
+ readonly type: "bytes4";
47
+ }];
48
+ readonly stateMutability: "nonpayable";
49
+ }];
50
+ declare const lsp20CallVerificationAbi: readonly [];
51
+
52
+ export { ilsp20CallVerifierAbi, lsp20CallVerificationAbi };
package/dist/abi.d.mts ADDED
@@ -0,0 +1,52 @@
1
+ declare const ilsp20CallVerifierAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly inputs: readonly [{
4
+ readonly name: "requestor";
5
+ readonly internalType: "address";
6
+ readonly type: "address";
7
+ }, {
8
+ readonly name: "target";
9
+ readonly internalType: "address";
10
+ readonly type: "address";
11
+ }, {
12
+ readonly name: "caller";
13
+ readonly internalType: "address";
14
+ readonly type: "address";
15
+ }, {
16
+ readonly name: "value";
17
+ readonly internalType: "uint256";
18
+ readonly type: "uint256";
19
+ }, {
20
+ readonly name: "callData";
21
+ readonly internalType: "bytes";
22
+ readonly type: "bytes";
23
+ }];
24
+ readonly name: "lsp20VerifyCall";
25
+ readonly outputs: readonly [{
26
+ readonly name: "returnedStatus";
27
+ readonly internalType: "bytes4";
28
+ readonly type: "bytes4";
29
+ }];
30
+ readonly stateMutability: "nonpayable";
31
+ }, {
32
+ readonly type: "function";
33
+ readonly inputs: readonly [{
34
+ readonly name: "callHash";
35
+ readonly internalType: "bytes32";
36
+ readonly type: "bytes32";
37
+ }, {
38
+ readonly name: "callResult";
39
+ readonly internalType: "bytes";
40
+ readonly type: "bytes";
41
+ }];
42
+ readonly name: "lsp20VerifyCallResult";
43
+ readonly outputs: readonly [{
44
+ readonly name: "";
45
+ readonly internalType: "bytes4";
46
+ readonly type: "bytes4";
47
+ }];
48
+ readonly stateMutability: "nonpayable";
49
+ }];
50
+ declare const lsp20CallVerificationAbi: readonly [];
51
+
52
+ export { ilsp20CallVerifierAbi, lsp20CallVerificationAbi };
package/dist/abi.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ declare const ilsp20CallVerifierAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly inputs: readonly [{
4
+ readonly name: "requestor";
5
+ readonly internalType: "address";
6
+ readonly type: "address";
7
+ }, {
8
+ readonly name: "target";
9
+ readonly internalType: "address";
10
+ readonly type: "address";
11
+ }, {
12
+ readonly name: "caller";
13
+ readonly internalType: "address";
14
+ readonly type: "address";
15
+ }, {
16
+ readonly name: "value";
17
+ readonly internalType: "uint256";
18
+ readonly type: "uint256";
19
+ }, {
20
+ readonly name: "callData";
21
+ readonly internalType: "bytes";
22
+ readonly type: "bytes";
23
+ }];
24
+ readonly name: "lsp20VerifyCall";
25
+ readonly outputs: readonly [{
26
+ readonly name: "returnedStatus";
27
+ readonly internalType: "bytes4";
28
+ readonly type: "bytes4";
29
+ }];
30
+ readonly stateMutability: "nonpayable";
31
+ }, {
32
+ readonly type: "function";
33
+ readonly inputs: readonly [{
34
+ readonly name: "callHash";
35
+ readonly internalType: "bytes32";
36
+ readonly type: "bytes32";
37
+ }, {
38
+ readonly name: "callResult";
39
+ readonly internalType: "bytes";
40
+ readonly type: "bytes";
41
+ }];
42
+ readonly name: "lsp20VerifyCallResult";
43
+ readonly outputs: readonly [{
44
+ readonly name: "";
45
+ readonly internalType: "bytes4";
46
+ readonly type: "bytes4";
47
+ }];
48
+ readonly stateMutability: "nonpayable";
49
+ }];
50
+ declare const lsp20CallVerificationAbi: readonly [];
51
+
52
+ export { ilsp20CallVerifierAbi, lsp20CallVerificationAbi };
package/dist/abi.mjs ADDED
@@ -0,0 +1,30 @@
1
+ const ilsp20CallVerifierAbi = [
2
+ {
3
+ type: "function",
4
+ inputs: [
5
+ { name: "requestor", internalType: "address", type: "address" },
6
+ { name: "target", internalType: "address", type: "address" },
7
+ { name: "caller", internalType: "address", type: "address" },
8
+ { name: "value", internalType: "uint256", type: "uint256" },
9
+ { name: "callData", internalType: "bytes", type: "bytes" }
10
+ ],
11
+ name: "lsp20VerifyCall",
12
+ outputs: [
13
+ { name: "returnedStatus", internalType: "bytes4", type: "bytes4" }
14
+ ],
15
+ stateMutability: "nonpayable"
16
+ },
17
+ {
18
+ type: "function",
19
+ inputs: [
20
+ { name: "callHash", internalType: "bytes32", type: "bytes32" },
21
+ { name: "callResult", internalType: "bytes", type: "bytes" }
22
+ ],
23
+ name: "lsp20VerifyCallResult",
24
+ outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }],
25
+ stateMutability: "nonpayable"
26
+ }
27
+ ];
28
+ const lsp20CallVerificationAbi = [];
29
+
30
+ export { ilsp20CallVerifierAbi, lsp20CallVerificationAbi };
@@ -5,11 +5,11 @@ declare const INTERFACE_ID_LSP20CallVerifier = "0x0d6ecac7";
5
5
  * Can be used to check if a calldata payload was check and verified.
6
6
  */
7
7
  declare const LSP20_SUCCESS_VALUES: {
8
- VERIFY_CALL: {
9
- NO_POST_VERIFICATION: string;
10
- WITH_POST_VERIFICATION: string;
8
+ readonly VERIFY_CALL: {
9
+ readonly NO_POST_VERIFICATION: "0xde928f00";
10
+ readonly WITH_POST_VERIFICATION: "0xde928f01";
11
11
  };
12
- VERIFY_CALL_RESULT: string;
12
+ readonly VERIFY_CALL_RESULT: "0xd3fc45d3";
13
13
  };
14
14
 
15
15
  export { INTERFACE_ID_LSP20CallVerification, INTERFACE_ID_LSP20CallVerifier, LSP20_SUCCESS_VALUES };
@@ -5,11 +5,11 @@ declare const INTERFACE_ID_LSP20CallVerifier = "0x0d6ecac7";
5
5
  * Can be used to check if a calldata payload was check and verified.
6
6
  */
7
7
  declare const LSP20_SUCCESS_VALUES: {
8
- VERIFY_CALL: {
9
- NO_POST_VERIFICATION: string;
10
- WITH_POST_VERIFICATION: string;
8
+ readonly VERIFY_CALL: {
9
+ readonly NO_POST_VERIFICATION: "0xde928f00";
10
+ readonly WITH_POST_VERIFICATION: "0xde928f01";
11
11
  };
12
- VERIFY_CALL_RESULT: string;
12
+ readonly VERIFY_CALL_RESULT: "0xd3fc45d3";
13
13
  };
14
14
 
15
15
  export { INTERFACE_ID_LSP20CallVerification, INTERFACE_ID_LSP20CallVerifier, LSP20_SUCCESS_VALUES };
@@ -5,11 +5,11 @@ declare const INTERFACE_ID_LSP20CallVerifier = "0x0d6ecac7";
5
5
  * Can be used to check if a calldata payload was check and verified.
6
6
  */
7
7
  declare const LSP20_SUCCESS_VALUES: {
8
- VERIFY_CALL: {
9
- NO_POST_VERIFICATION: string;
10
- WITH_POST_VERIFICATION: string;
8
+ readonly VERIFY_CALL: {
9
+ readonly NO_POST_VERIFICATION: "0xde928f00";
10
+ readonly WITH_POST_VERIFICATION: "0xde928f01";
11
11
  };
12
- VERIFY_CALL_RESULT: string;
12
+ readonly VERIFY_CALL_RESULT: "0xd3fc45d3";
13
13
  };
14
14
 
15
15
  export { INTERFACE_ID_LSP20CallVerification, INTERFACE_ID_LSP20CallVerifier, LSP20_SUCCESS_VALUES };
package/package.json CHANGED
@@ -1,28 +1,9 @@
1
1
  {
2
2
  "name": "@lukso/lsp20-contracts",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Package for the LSP20 Call Verification standard",
5
5
  "license": "Apache-2.0",
6
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
- "./README.md"
25
- ],
26
7
  "keywords": [
27
8
  "LUKSO",
28
9
  "LSP",
@@ -33,14 +14,43 @@
33
14
  "EVM",
34
15
  "Solidity"
35
16
  ],
17
+ "files": [
18
+ "contracts/**/*.sol",
19
+ "!contracts/Mocks/**/*.sol",
20
+ "artifacts/*.json",
21
+ "dist"
22
+ ],
23
+ "main": "./dist/constants.cjs",
24
+ "module": "./dist/constants.mjs",
25
+ "typings": "./dist/constants.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "require": "./dist/constants.cjs",
29
+ "import": "./dist/constants.mjs",
30
+ "types": "./dist/constants.d.ts"
31
+ },
32
+ "./constants": {
33
+ "require": "./dist/constants.cjs",
34
+ "import": "./dist/constants.mjs",
35
+ "types": "./dist/constants.d.ts"
36
+ },
37
+ "./abi": {
38
+ "require": "./dist/abi.cjs",
39
+ "import": "./dist/abi.mjs",
40
+ "types": "./dist/abi.d.ts"
41
+ },
42
+ "./artifacts/*": "./artifacts/*",
43
+ "./dist/*": "./dist/*",
44
+ "./package.json": "./package.json"
45
+ },
36
46
  "scripts": {
37
47
  "build": "hardhat compile --show-stack-traces",
38
48
  "build:js": "unbuild",
39
49
  "build:types": "npx wagmi generate",
40
- "clean": "hardhat clean && rm -Rf dist/",
50
+ "clean": "hardhat clean && rm -Rf dist/ cache/ node_modules/ .turbo/ types/ typechain/ build/ artifacts/",
41
51
  "format": "prettier --write .",
42
52
  "lint": "eslint . --ext .ts,.js",
43
53
  "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
44
- "package": "hardhat prepare-package"
54
+ "build:package": "hardhat prepare-package"
45
55
  }
46
56
  }
@@ -1,74 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "ILSP20CallVerifier",
4
- "sourceName": "contracts/ILSP20CallVerifier.sol",
5
- "abi": [
6
- {
7
- "inputs": [
8
- {
9
- "internalType": "address",
10
- "name": "requestor",
11
- "type": "address"
12
- },
13
- {
14
- "internalType": "address",
15
- "name": "target",
16
- "type": "address"
17
- },
18
- {
19
- "internalType": "address",
20
- "name": "caller",
21
- "type": "address"
22
- },
23
- {
24
- "internalType": "uint256",
25
- "name": "value",
26
- "type": "uint256"
27
- },
28
- {
29
- "internalType": "bytes",
30
- "name": "callData",
31
- "type": "bytes"
32
- }
33
- ],
34
- "name": "lsp20VerifyCall",
35
- "outputs": [
36
- {
37
- "internalType": "bytes4",
38
- "name": "returnedStatus",
39
- "type": "bytes4"
40
- }
41
- ],
42
- "stateMutability": "nonpayable",
43
- "type": "function"
44
- },
45
- {
46
- "inputs": [
47
- {
48
- "internalType": "bytes32",
49
- "name": "callHash",
50
- "type": "bytes32"
51
- },
52
- {
53
- "internalType": "bytes",
54
- "name": "callResult",
55
- "type": "bytes"
56
- }
57
- ],
58
- "name": "lsp20VerifyCallResult",
59
- "outputs": [
60
- {
61
- "internalType": "bytes4",
62
- "name": "",
63
- "type": "bytes4"
64
- }
65
- ],
66
- "stateMutability": "nonpayable",
67
- "type": "function"
68
- }
69
- ],
70
- "bytecode": "0x",
71
- "deployedBytecode": "0x",
72
- "linkReferences": {},
73
- "deployedLinkReferences": {}
74
- }
@@ -1,10 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "LSP20CallVerification",
4
- "sourceName": "contracts/LSP20CallVerification.sol",
5
- "abi": [],
6
- "bytecode": "0x",
7
- "deployedBytecode": "0x",
8
- "linkReferences": {},
9
- "deployedLinkReferences": {}
10
- }
File without changes
File without changes