@totems/evm 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@totems/evm",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Totems EVM smart contracts for building modular token systems",
5
5
  "author": "nsjames",
6
6
  "license": "MIT & AGPL-3.0",
@@ -26,17 +26,24 @@
26
26
  "test/**/*"
27
27
  ],
28
28
  "exports": {
29
+ "./test/constants": {
30
+ "types": "./test/constants.d.ts",
31
+ "import": "./test/constants.js",
32
+ "require": "./test/constants.js",
33
+ "default": "./test/constants.js"
34
+ },
29
35
  "./test/helpers": {
30
36
  "types": "./test/helpers.d.ts",
31
37
  "import": "./test/helpers.js",
32
- "require": "./test/helpers.js"
38
+ "require": "./test/helpers.js",
39
+ "default": "./test/helpers.js"
33
40
  },
34
41
  "./contracts/*": "./contracts/*",
35
42
  "./interfaces/*": "./interfaces/*",
36
43
  "./mods/*": "./mods/*"
37
44
  },
38
45
  "peerDependencies": {
39
- "hardhat": "^2.0.0",
40
- "viem": "^2.0.0"
46
+ "hardhat": "^3.1.4",
47
+ "viem": "^2.44.4"
41
48
  }
42
49
  }
@@ -0,0 +1,11 @@
1
+ export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
2
+ export declare const MIN_BASE_FEE = 500000000000000n;
3
+ export declare const BURNED_FEE = 100000000000000n;
4
+ export declare const Hook: {
5
+ readonly Created: 0;
6
+ readonly Mint: 1;
7
+ readonly Burn: 2;
8
+ readonly Transfer: 3;
9
+ readonly TransferOwnership: 4;
10
+ };
11
+ export type HookType = typeof Hook[keyof typeof Hook];
@@ -0,0 +1,17 @@
1
+ // test/constants.ts
2
+ var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
3
+ var MIN_BASE_FEE = 500000000000000n;
4
+ var BURNED_FEE = 100000000000000n;
5
+ var Hook = {
6
+ Created: 0,
7
+ Mint: 1,
8
+ Burn: 2,
9
+ Transfer: 3,
10
+ TransferOwnership: 4
11
+ };
12
+ export {
13
+ ZERO_ADDRESS,
14
+ MIN_BASE_FEE,
15
+ Hook,
16
+ BURNED_FEE
17
+ };
package/test/helpers.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
1
+ export { ZERO_ADDRESS, MIN_BASE_FEE, BURNED_FEE, Hook } from "./constants.js";
2
+ export type { HookType } from "./constants.js";
2
3
  /**
3
4
  * Computes the 4-byte selector for a custom error signature
4
5
  * @param signature Error signature like "NotLicensed()" or "InsufficientBalance(uint256,uint256)"
@@ -25,15 +26,6 @@ export declare const ErrorSelectors: {
25
26
  InsufficientBalance: string;
26
27
  CantSetLicense: string;
27
28
  };
28
- export declare const MIN_BASE_FEE = 500000000000000n;
29
- export declare const BURNED_FEE = 100000000000000n;
30
- export declare enum Hook {
31
- Created = 0,
32
- Mint = 1,
33
- Burn = 2,
34
- Transfer = 3,
35
- TransferOwnership = 4
36
- }
37
29
  export declare const setupTotemsTest: (minBaseFee?: bigint, burnedFee?: bigint) => Promise<{
38
30
  viem: any;
39
31
  publicClient: any;
package/test/helpers.js CHANGED
@@ -1,6 +1,19 @@
1
1
  // test/helpers.ts
2
2
  import {network} from "hardhat";
3
3
  import {keccak256, toBytes, decodeErrorResult} from "viem";
4
+
5
+ // test/constants.ts
6
+ var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
7
+ var MIN_BASE_FEE = 500000000000000n;
8
+ var BURNED_FEE = 100000000000000n;
9
+ var Hook = {
10
+ Created: 0,
11
+ Mint: 1,
12
+ Burn: 2,
13
+ Transfer: 3,
14
+ TransferOwnership: 4
15
+ };
16
+ // test/helpers.ts
4
17
  function errorSelector(signature) {
5
18
  return keccak256(toBytes(signature)).slice(0, 10);
6
19
  }
@@ -70,7 +83,6 @@ async function expectRevertMessage(promise, expectedMessage) {
70
83
  }
71
84
  }
72
85
  }
73
- var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
74
86
  var ErrorSelectors = {
75
87
  InvalidModEventOrigin: errorSelector("InvalidModEventOrigin()"),
76
88
  NotLicensed: errorSelector("NotLicensed()"),
@@ -80,16 +92,6 @@ var ErrorSelectors = {
80
92
  InsufficientBalance: errorSelector("InsufficientBalance(uint256,uint256)"),
81
93
  CantSetLicense: errorSelector("CantSetLicense()")
82
94
  };
83
- var MIN_BASE_FEE = 500000000000000n;
84
- var BURNED_FEE = 100000000000000n;
85
- var Hook;
86
- (function(Hook2) {
87
- Hook2[Hook2["Created"] = 0] = "Created";
88
- Hook2[Hook2["Mint"] = 1] = "Mint";
89
- Hook2[Hook2["Burn"] = 2] = "Burn";
90
- Hook2[Hook2["Transfer"] = 3] = "Transfer";
91
- Hook2[Hook2["TransferOwnership"] = 4] = "TransferOwnership";
92
- })(Hook || (Hook = {}));
93
95
  var setupTotemsTest = async (minBaseFee = MIN_BASE_FEE, burnedFee = BURNED_FEE) => {
94
96
  const { viem } = await network.connect();
95
97
  const publicClient = await viem.getPublicClient();