@ethlimo/ens-hooks-release-testing 0.1.11

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.
@@ -0,0 +1,203 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.28;
3
+
4
+ /**
5
+ * @title FunctionCallParserTest
6
+ * @notice Test contract for ERC-8121 functionCall parameter parsing
7
+ * @dev Tests string parameters, mixed types, edge cases, and gas limits
8
+ */
9
+ contract FunctionCallParserTest {
10
+ // String parameter tests
11
+ function getString() public pure returns (bytes memory) {
12
+ return abi.encode("Hello, World!");
13
+ }
14
+
15
+ function getStringParam(string memory input) public pure returns (bytes memory) {
16
+ return abi.encode(input);
17
+ }
18
+
19
+ function getEmptyString(string memory input) public pure returns (bytes memory) {
20
+ require(bytes(input).length == 0, "Expected empty string");
21
+ return abi.encode("Empty string received");
22
+ }
23
+
24
+ function getMaxString(string memory input) public pure returns (bytes memory) {
25
+ require(bytes(input).length == 512, "Expected 512 character string");
26
+ return abi.encode("Max length string received");
27
+ }
28
+
29
+ function getStringWithEscapes(string memory input) public pure returns (bytes memory) {
30
+ // Test strings with escaped quotes and backslashes
31
+ return abi.encode(input);
32
+ }
33
+
34
+ function getStringWithNewline(string memory input) public pure returns (bytes memory) {
35
+ // Test strings with actual UTF newline characters
36
+ return abi.encode(input);
37
+ }
38
+
39
+ function getStringWithUnicode(string memory input) public pure returns (bytes memory) {
40
+ // Test strings with Unicode characters
41
+ return abi.encode(input);
42
+ }
43
+
44
+ // Boolean parameter tests
45
+ function getBoolTrue(bool value) public pure returns (bytes memory) {
46
+ require(value == true, "Expected true");
47
+ return abi.encode("Boolean true received");
48
+ }
49
+
50
+ function getBoolFalse(bool value) public pure returns (bytes memory) {
51
+ require(value == false, "Expected false");
52
+ return abi.encode("Boolean false received");
53
+ }
54
+
55
+ // Address parameter tests
56
+ function getAddress(address addr) public pure returns (bytes memory) {
57
+ return abi.encode(addr);
58
+ }
59
+
60
+ function getZeroAddress(address addr) public pure returns (bytes memory) {
61
+ require(addr == address(0), "Expected zero address");
62
+ return abi.encode("Zero address received");
63
+ }
64
+
65
+ // Unsigned integer tests
66
+ function getUint256(uint256 value) public pure returns (bytes memory) {
67
+ return abi.encode(value);
68
+ }
69
+
70
+ function getUint256Zero(uint256 value) public pure returns (bytes memory) {
71
+ require(value == 0, "Expected zero");
72
+ return abi.encode("Zero received");
73
+ }
74
+
75
+ function getUint256Max(uint256 value) public pure returns (bytes memory) {
76
+ require(value == type(uint256).max, "Expected max uint256");
77
+ return abi.encode("Max uint256 received");
78
+ }
79
+
80
+ function getUint8(uint8 value) public pure returns (bytes memory) {
81
+ return abi.encode(value);
82
+ }
83
+
84
+ function getUint128(uint128 value) public pure returns (bytes memory) {
85
+ return abi.encode(value);
86
+ }
87
+
88
+ // Signed integer tests
89
+ function getInt256(int256 value) public pure returns (bytes memory) {
90
+ return abi.encode(value);
91
+ }
92
+
93
+ function getInt256Negative(int256 value) public pure returns (bytes memory) {
94
+ require(value < 0, "Expected negative value");
95
+ return abi.encode(value);
96
+ }
97
+
98
+ function getInt256Max(int256 value) public pure returns (bytes memory) {
99
+ require(value == type(int256).max, "Expected max int256");
100
+ return abi.encode("Max int256 received");
101
+ }
102
+
103
+ function getInt256Min(int256 value) public pure returns (bytes memory) {
104
+ require(value == type(int256).min, "Expected min int256");
105
+ return abi.encode("Min int256 received");
106
+ }
107
+
108
+ // BytesN tests
109
+ function getBytes32(bytes32 value) public pure returns (bytes memory) {
110
+ return abi.encode(value);
111
+ }
112
+
113
+ function getBytes32Zero(bytes32 value) public pure returns (bytes memory) {
114
+ require(value == bytes32(0), "Expected zero bytes32");
115
+ return abi.encode("Zero bytes32 received");
116
+ }
117
+
118
+ function getBytes1(bytes1 value) public pure returns (bytes memory) {
119
+ return abi.encode(value);
120
+ }
121
+
122
+ function getBytes16(bytes16 value) public pure returns (bytes memory) {
123
+ return abi.encode(value);
124
+ }
125
+
126
+ // Mixed parameter tests (2 parameters)
127
+ function getStringAndUint(string memory str, uint256 num) public pure returns (bytes memory) {
128
+ return abi.encode(str, num);
129
+ }
130
+
131
+ function getAddressAndBool(address addr, bool flag) public pure returns (bytes memory) {
132
+ return abi.encode(addr, flag);
133
+ }
134
+
135
+ function getBytes32AndString(bytes32 hash, string memory str) public pure returns (bytes memory) {
136
+ return abi.encode(hash, str);
137
+ }
138
+
139
+ function getUintAndInt(uint256 uvalue, int256 ivalue) public pure returns (bytes memory) {
140
+ return abi.encode(uvalue, ivalue);
141
+ }
142
+
143
+ function getBoolAndAddress(bool flag, address addr) public pure returns (bytes memory) {
144
+ return abi.encode(flag, addr);
145
+ }
146
+
147
+ function getTwoStrings(string memory str1, string memory str2) public pure returns (bytes memory) {
148
+ return abi.encode(str1, str2);
149
+ }
150
+
151
+ // Gas limit tests - these functions measure gas consumption with large strings
152
+ function gasTestString256(string memory input) public pure returns (bytes memory) {
153
+ require(bytes(input).length == 256, "Expected 256 character string");
154
+ return abi.encode(input, "256 chars processed");
155
+ }
156
+
157
+ function gasTestString512(string memory input) public pure returns (bytes memory) {
158
+ require(bytes(input).length == 512, "Expected 512 character string");
159
+ return abi.encode(input, "512 chars processed");
160
+ }
161
+
162
+ function gasTestTwoStrings256(string memory input1, string memory input2) public pure returns (bytes memory) {
163
+ require(bytes(input1).length == 256, "Expected 256 character string for input1");
164
+ require(bytes(input2).length == 256, "Expected 256 character string for input2");
165
+ return abi.encode(input1, input2, "Two 256 char strings processed");
166
+ }
167
+
168
+ function gasTestStringAndBytes32(string memory str, bytes32 hash) public pure returns (bytes memory) {
169
+ require(bytes(str).length == 512, "Expected 512 character string");
170
+ return abi.encode(str, hash, "String and bytes32 processed");
171
+ }
172
+
173
+ // Edge case tests
174
+ function getStringWithQuotes(string memory input) public pure returns (bytes memory) {
175
+ // Expects: "It's working" -> It's working (with escaped quote)
176
+ return abi.encode(input);
177
+ }
178
+
179
+ function getStringWithBackslash(string memory input) public pure returns (bytes memory) {
180
+ // Expects: "path\\to\\file" -> path\to\file (with escaped backslashes)
181
+ return abi.encode(input);
182
+ }
183
+
184
+ function getStringWithBoth(string memory input) public pure returns (bytes memory) {
185
+ // Expects mixed escapes
186
+ return abi.encode(input);
187
+ }
188
+
189
+ function getHexUint(uint256 value) public pure returns (bytes memory) {
190
+ // Test hex number parsing (0x...)
191
+ return abi.encode(value);
192
+ }
193
+
194
+ function getDecimalUint(uint256 value) public pure returns (bytes memory) {
195
+ // Test decimal number parsing
196
+ return abi.encode(value);
197
+ }
198
+
199
+ function getMixedCaseAddress(address addr) public pure returns (bytes memory) {
200
+ // Test mixed case address parsing
201
+ return abi.encode(addr);
202
+ }
203
+ }
@@ -0,0 +1,9 @@
1
+ pragma solidity ^0.8.28;
2
+ /// @dev Interface selector: `0xecbfada3`
3
+ interface IDataResolver {
4
+ /// @notice Get data for node.
5
+ function data(bytes32 node) external view returns (bytes memory);
6
+
7
+ /// @notice Data changed for node.
8
+ event DataChanged(bytes32 indexed node, bytes32 indexed dataHash);
9
+ }
@@ -0,0 +1,19 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.28;
3
+
4
+ import '@openzeppelin/contracts/access/Ownable.sol';
5
+
6
+ contract ZeroParameterHookTarget is Ownable {
7
+ bytes private globalData;
8
+
9
+ event GlobalDataChanged(bytes32 hash);
10
+
11
+ function getData() external view returns (bytes memory) {
12
+ return globalData;
13
+ }
14
+
15
+ function setData(bytes calldata value) external onlyOwner {
16
+ globalData = value;
17
+ emit GlobalDataChanged(keccak256(value));
18
+ }
19
+ }
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@ethlimo/ens-hooks-release-testing",
3
+ "version": "0.1.11",
4
+ "description": "TypeScript library for encoding, decoding, and executing EIP-8121 hooks with ERC-7930 interoperable addresses.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/ethlimo/ens-hooks-release-testing.git"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "provenance": false
12
+ },
13
+ "main": "dist/src/index.js",
14
+ "types": "dist/src/index.d.ts",
15
+ "files": [
16
+ "dist",
17
+ "src",
18
+ "contracts",
19
+ "sbom.spdx.json",
20
+ "README.md",
21
+ "CHANGELOG.md",
22
+ "LICENSE"
23
+ ],
24
+ "scripts": {
25
+ "prepare": "husky",
26
+ "build": "npx hardhat compile && npx tsc",
27
+ "clean": "rm -rf cache/ edr-fork-cache/ ignition/deployments/chain-1 artifacts/ dist",
28
+ "test": "npx hardhat test",
29
+ "node": "npx hardhat node --network hardhat",
30
+ "deploy-localnode": "npx hardhat run scripts/deploy-localnode.ts --network localhost",
31
+ "test-localnode": "npx hardhat run scripts/test-localnode.ts --network hardhat",
32
+ "deploy-testnet": "npx hardhat run scripts/deploy-testnet.ts --network sepolia",
33
+ "test-deployed": "npx hardhat run scripts/test-deployed.ts --network sepolia"
34
+ },
35
+ "author": "eth.limo team",
36
+ "license": "MIT",
37
+ "devDependencies": {
38
+ "@commitlint/cli": "20.4.1",
39
+ "@commitlint/config-conventional": "20.4.1",
40
+ "@nomicfoundation/hardhat-errors": "^3.0.0",
41
+ "@nomicfoundation/hardhat-ethers": "^4.0.0",
42
+ "@nomicfoundation/hardhat-ethers-chai-matchers": "^3.0.0",
43
+ "@nomicfoundation/hardhat-ignition": "^3.0.0",
44
+ "@nomicfoundation/hardhat-keystore": "^3.0.0",
45
+ "@nomicfoundation/hardhat-mocha": "3.0.0",
46
+ "@nomicfoundation/hardhat-network-helpers": "^3.0.0",
47
+ "@nomicfoundation/hardhat-node-test-runner": "^3.0.0",
48
+ "@nomicfoundation/hardhat-typechain": "^3.0.0",
49
+ "@nomicfoundation/ignition-core": "^3.0.0",
50
+ "@types/html-minifier-terser": "^7.0.2",
51
+ "@types/mocha": "^10.0.0",
52
+ "hardhat": "^3.0.4",
53
+ "html-minifier-terser": "^7.2.0",
54
+ "husky": "9.1.7",
55
+ "mocha": "11.0.0"
56
+ },
57
+ "dependencies": {
58
+ "@ensdomains/ens-contracts": "^1.6.0",
59
+ "@nomicfoundation/hardhat-ignition-ethers": "^3.0.0",
60
+ "@wonderland/interop-addresses": "0.2.0",
61
+ "ethers": "^6.13.5"
62
+ },
63
+ "overrides": {
64
+ "@ensdomains/buffer": "0.1.3",
65
+ "@openzeppelin/contracts": "4.9.6",
66
+ "axios": ">=1.13.5 || <1.4.0"
67
+ },
68
+ "type": "module"
69
+ }