@towns-protocol/generated 0.0.374 → 0.0.375
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/dev/.contracts-hash +1 -1
- package/dev/abis/ITipping.abi.json +119 -0
- package/dev/abis/ITipping.abi.ts +119 -0
- package/dev/abis/ITippingBase.abi.json +53 -0
- package/dev/abis/ITippingBase.abi.ts +53 -0
- package/dev/typings/ITipping.ts +151 -0
- package/dev/typings/factories/ITipping__factory.ts +119 -0
- package/package.json +3 -3
- package/scripts/prepare.js +37 -55
package/dev/.contracts-hash
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9e9889d29ec78f47e75aaad928d5edf83cce9954
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "sendTip",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "recipientType",
|
|
8
|
+
"type": "uint8",
|
|
9
|
+
"internalType": "enum ITippingBase.TipRecipientType"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "data",
|
|
13
|
+
"type": "bytes",
|
|
14
|
+
"internalType": "bytes"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"outputs": [],
|
|
18
|
+
"stateMutability": "payable"
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"type": "function",
|
|
4
22
|
"name": "tip",
|
|
@@ -63,6 +81,30 @@
|
|
|
63
81
|
],
|
|
64
82
|
"stateMutability": "view"
|
|
65
83
|
},
|
|
84
|
+
{
|
|
85
|
+
"type": "function",
|
|
86
|
+
"name": "tipCountByWalletAndCurrency",
|
|
87
|
+
"inputs": [
|
|
88
|
+
{
|
|
89
|
+
"name": "wallet",
|
|
90
|
+
"type": "address",
|
|
91
|
+
"internalType": "address"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "currency",
|
|
95
|
+
"type": "address",
|
|
96
|
+
"internalType": "address"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"outputs": [
|
|
100
|
+
{
|
|
101
|
+
"name": "",
|
|
102
|
+
"type": "uint256",
|
|
103
|
+
"internalType": "uint256"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"stateMutability": "view"
|
|
107
|
+
},
|
|
66
108
|
{
|
|
67
109
|
"type": "function",
|
|
68
110
|
"name": "tippingCurrencies",
|
|
@@ -100,6 +142,30 @@
|
|
|
100
142
|
],
|
|
101
143
|
"stateMutability": "view"
|
|
102
144
|
},
|
|
145
|
+
{
|
|
146
|
+
"type": "function",
|
|
147
|
+
"name": "tipsByWalletAndCurrency",
|
|
148
|
+
"inputs": [
|
|
149
|
+
{
|
|
150
|
+
"name": "wallet",
|
|
151
|
+
"type": "address",
|
|
152
|
+
"internalType": "address"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "currency",
|
|
156
|
+
"type": "address",
|
|
157
|
+
"internalType": "address"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"outputs": [
|
|
161
|
+
{
|
|
162
|
+
"name": "",
|
|
163
|
+
"type": "uint256",
|
|
164
|
+
"internalType": "uint256"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"stateMutability": "view"
|
|
168
|
+
},
|
|
103
169
|
{
|
|
104
170
|
"type": "function",
|
|
105
171
|
"name": "totalTipsByCurrency",
|
|
@@ -168,6 +234,49 @@
|
|
|
168
234
|
],
|
|
169
235
|
"anonymous": false
|
|
170
236
|
},
|
|
237
|
+
{
|
|
238
|
+
"type": "event",
|
|
239
|
+
"name": "TipSent",
|
|
240
|
+
"inputs": [
|
|
241
|
+
{
|
|
242
|
+
"name": "sender",
|
|
243
|
+
"type": "address",
|
|
244
|
+
"indexed": true,
|
|
245
|
+
"internalType": "address"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "receiver",
|
|
249
|
+
"type": "address",
|
|
250
|
+
"indexed": true,
|
|
251
|
+
"internalType": "address"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "recipientType",
|
|
255
|
+
"type": "uint8",
|
|
256
|
+
"indexed": true,
|
|
257
|
+
"internalType": "enum ITippingBase.TipRecipientType"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "currency",
|
|
261
|
+
"type": "address",
|
|
262
|
+
"indexed": false,
|
|
263
|
+
"internalType": "address"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "amount",
|
|
267
|
+
"type": "uint256",
|
|
268
|
+
"indexed": false,
|
|
269
|
+
"internalType": "uint256"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "tokenId",
|
|
273
|
+
"type": "uint256",
|
|
274
|
+
"indexed": false,
|
|
275
|
+
"internalType": "uint256"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"anonymous": false
|
|
279
|
+
},
|
|
171
280
|
{
|
|
172
281
|
"type": "error",
|
|
173
282
|
"name": "AmountIsZero",
|
|
@@ -183,6 +292,16 @@
|
|
|
183
292
|
"name": "CurrencyIsZero",
|
|
184
293
|
"inputs": []
|
|
185
294
|
},
|
|
295
|
+
{
|
|
296
|
+
"type": "error",
|
|
297
|
+
"name": "InvalidRecipientType",
|
|
298
|
+
"inputs": []
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"type": "error",
|
|
302
|
+
"name": "InvalidTipData",
|
|
303
|
+
"inputs": []
|
|
304
|
+
},
|
|
186
305
|
{
|
|
187
306
|
"type": "error",
|
|
188
307
|
"name": "MsgValueMismatch",
|
package/dev/abis/ITipping.abi.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
export default [
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "sendTip",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "recipientType",
|
|
8
|
+
"type": "uint8",
|
|
9
|
+
"internalType": "enum ITippingBase.TipRecipientType"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "data",
|
|
13
|
+
"type": "bytes",
|
|
14
|
+
"internalType": "bytes"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"outputs": [],
|
|
18
|
+
"stateMutability": "payable"
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"type": "function",
|
|
4
22
|
"name": "tip",
|
|
@@ -63,6 +81,30 @@ export default [
|
|
|
63
81
|
],
|
|
64
82
|
"stateMutability": "view"
|
|
65
83
|
},
|
|
84
|
+
{
|
|
85
|
+
"type": "function",
|
|
86
|
+
"name": "tipCountByWalletAndCurrency",
|
|
87
|
+
"inputs": [
|
|
88
|
+
{
|
|
89
|
+
"name": "wallet",
|
|
90
|
+
"type": "address",
|
|
91
|
+
"internalType": "address"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "currency",
|
|
95
|
+
"type": "address",
|
|
96
|
+
"internalType": "address"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"outputs": [
|
|
100
|
+
{
|
|
101
|
+
"name": "",
|
|
102
|
+
"type": "uint256",
|
|
103
|
+
"internalType": "uint256"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"stateMutability": "view"
|
|
107
|
+
},
|
|
66
108
|
{
|
|
67
109
|
"type": "function",
|
|
68
110
|
"name": "tippingCurrencies",
|
|
@@ -100,6 +142,30 @@ export default [
|
|
|
100
142
|
],
|
|
101
143
|
"stateMutability": "view"
|
|
102
144
|
},
|
|
145
|
+
{
|
|
146
|
+
"type": "function",
|
|
147
|
+
"name": "tipsByWalletAndCurrency",
|
|
148
|
+
"inputs": [
|
|
149
|
+
{
|
|
150
|
+
"name": "wallet",
|
|
151
|
+
"type": "address",
|
|
152
|
+
"internalType": "address"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "currency",
|
|
156
|
+
"type": "address",
|
|
157
|
+
"internalType": "address"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"outputs": [
|
|
161
|
+
{
|
|
162
|
+
"name": "",
|
|
163
|
+
"type": "uint256",
|
|
164
|
+
"internalType": "uint256"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"stateMutability": "view"
|
|
168
|
+
},
|
|
103
169
|
{
|
|
104
170
|
"type": "function",
|
|
105
171
|
"name": "totalTipsByCurrency",
|
|
@@ -168,6 +234,49 @@ export default [
|
|
|
168
234
|
],
|
|
169
235
|
"anonymous": false
|
|
170
236
|
},
|
|
237
|
+
{
|
|
238
|
+
"type": "event",
|
|
239
|
+
"name": "TipSent",
|
|
240
|
+
"inputs": [
|
|
241
|
+
{
|
|
242
|
+
"name": "sender",
|
|
243
|
+
"type": "address",
|
|
244
|
+
"indexed": true,
|
|
245
|
+
"internalType": "address"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"name": "receiver",
|
|
249
|
+
"type": "address",
|
|
250
|
+
"indexed": true,
|
|
251
|
+
"internalType": "address"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "recipientType",
|
|
255
|
+
"type": "uint8",
|
|
256
|
+
"indexed": true,
|
|
257
|
+
"internalType": "enum ITippingBase.TipRecipientType"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "currency",
|
|
261
|
+
"type": "address",
|
|
262
|
+
"indexed": false,
|
|
263
|
+
"internalType": "address"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "amount",
|
|
267
|
+
"type": "uint256",
|
|
268
|
+
"indexed": false,
|
|
269
|
+
"internalType": "uint256"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "tokenId",
|
|
273
|
+
"type": "uint256",
|
|
274
|
+
"indexed": false,
|
|
275
|
+
"internalType": "uint256"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"anonymous": false
|
|
279
|
+
},
|
|
171
280
|
{
|
|
172
281
|
"type": "error",
|
|
173
282
|
"name": "AmountIsZero",
|
|
@@ -183,6 +292,16 @@ export default [
|
|
|
183
292
|
"name": "CurrencyIsZero",
|
|
184
293
|
"inputs": []
|
|
185
294
|
},
|
|
295
|
+
{
|
|
296
|
+
"type": "error",
|
|
297
|
+
"name": "InvalidRecipientType",
|
|
298
|
+
"inputs": []
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"type": "error",
|
|
302
|
+
"name": "InvalidTipData",
|
|
303
|
+
"inputs": []
|
|
304
|
+
},
|
|
186
305
|
{
|
|
187
306
|
"type": "error",
|
|
188
307
|
"name": "MsgValueMismatch",
|
|
@@ -48,6 +48,49 @@
|
|
|
48
48
|
],
|
|
49
49
|
"anonymous": false
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
"type": "event",
|
|
53
|
+
"name": "TipSent",
|
|
54
|
+
"inputs": [
|
|
55
|
+
{
|
|
56
|
+
"name": "sender",
|
|
57
|
+
"type": "address",
|
|
58
|
+
"indexed": true,
|
|
59
|
+
"internalType": "address"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "receiver",
|
|
63
|
+
"type": "address",
|
|
64
|
+
"indexed": true,
|
|
65
|
+
"internalType": "address"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "recipientType",
|
|
69
|
+
"type": "uint8",
|
|
70
|
+
"indexed": true,
|
|
71
|
+
"internalType": "enum ITippingBase.TipRecipientType"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "currency",
|
|
75
|
+
"type": "address",
|
|
76
|
+
"indexed": false,
|
|
77
|
+
"internalType": "address"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "amount",
|
|
81
|
+
"type": "uint256",
|
|
82
|
+
"indexed": false,
|
|
83
|
+
"internalType": "uint256"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "tokenId",
|
|
87
|
+
"type": "uint256",
|
|
88
|
+
"indexed": false,
|
|
89
|
+
"internalType": "uint256"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"anonymous": false
|
|
93
|
+
},
|
|
51
94
|
{
|
|
52
95
|
"type": "error",
|
|
53
96
|
"name": "AmountIsZero",
|
|
@@ -63,6 +106,16 @@
|
|
|
63
106
|
"name": "CurrencyIsZero",
|
|
64
107
|
"inputs": []
|
|
65
108
|
},
|
|
109
|
+
{
|
|
110
|
+
"type": "error",
|
|
111
|
+
"name": "InvalidRecipientType",
|
|
112
|
+
"inputs": []
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "error",
|
|
116
|
+
"name": "InvalidTipData",
|
|
117
|
+
"inputs": []
|
|
118
|
+
},
|
|
66
119
|
{
|
|
67
120
|
"type": "error",
|
|
68
121
|
"name": "MsgValueMismatch",
|
|
@@ -48,6 +48,49 @@ export default [
|
|
|
48
48
|
],
|
|
49
49
|
"anonymous": false
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
"type": "event",
|
|
53
|
+
"name": "TipSent",
|
|
54
|
+
"inputs": [
|
|
55
|
+
{
|
|
56
|
+
"name": "sender",
|
|
57
|
+
"type": "address",
|
|
58
|
+
"indexed": true,
|
|
59
|
+
"internalType": "address"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "receiver",
|
|
63
|
+
"type": "address",
|
|
64
|
+
"indexed": true,
|
|
65
|
+
"internalType": "address"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "recipientType",
|
|
69
|
+
"type": "uint8",
|
|
70
|
+
"indexed": true,
|
|
71
|
+
"internalType": "enum ITippingBase.TipRecipientType"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "currency",
|
|
75
|
+
"type": "address",
|
|
76
|
+
"indexed": false,
|
|
77
|
+
"internalType": "address"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "amount",
|
|
81
|
+
"type": "uint256",
|
|
82
|
+
"indexed": false,
|
|
83
|
+
"internalType": "uint256"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "tokenId",
|
|
87
|
+
"type": "uint256",
|
|
88
|
+
"indexed": false,
|
|
89
|
+
"internalType": "uint256"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"anonymous": false
|
|
93
|
+
},
|
|
51
94
|
{
|
|
52
95
|
"type": "error",
|
|
53
96
|
"name": "AmountIsZero",
|
|
@@ -63,6 +106,16 @@ export default [
|
|
|
63
106
|
"name": "CurrencyIsZero",
|
|
64
107
|
"inputs": []
|
|
65
108
|
},
|
|
109
|
+
{
|
|
110
|
+
"type": "error",
|
|
111
|
+
"name": "InvalidRecipientType",
|
|
112
|
+
"inputs": []
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "error",
|
|
116
|
+
"name": "InvalidTipData",
|
|
117
|
+
"inputs": []
|
|
118
|
+
},
|
|
66
119
|
{
|
|
67
120
|
"type": "error",
|
|
68
121
|
"name": "MsgValueMismatch",
|
package/dev/typings/ITipping.ts
CHANGED
|
@@ -55,22 +55,32 @@ export declare namespace ITippingBase {
|
|
|
55
55
|
|
|
56
56
|
export interface ITippingInterface extends utils.Interface {
|
|
57
57
|
functions: {
|
|
58
|
+
"sendTip(uint8,bytes)": FunctionFragment;
|
|
58
59
|
"tip((address,uint256,address,uint256,bytes32,bytes32))": FunctionFragment;
|
|
59
60
|
"tipAmountByCurrency(address)": FunctionFragment;
|
|
61
|
+
"tipCountByWalletAndCurrency(address,address)": FunctionFragment;
|
|
60
62
|
"tippingCurrencies()": FunctionFragment;
|
|
61
63
|
"tipsByCurrencyAndTokenId(uint256,address)": FunctionFragment;
|
|
64
|
+
"tipsByWalletAndCurrency(address,address)": FunctionFragment;
|
|
62
65
|
"totalTipsByCurrency(address)": FunctionFragment;
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
getFunction(
|
|
66
69
|
nameOrSignatureOrTopic:
|
|
70
|
+
| "sendTip"
|
|
67
71
|
| "tip"
|
|
68
72
|
| "tipAmountByCurrency"
|
|
73
|
+
| "tipCountByWalletAndCurrency"
|
|
69
74
|
| "tippingCurrencies"
|
|
70
75
|
| "tipsByCurrencyAndTokenId"
|
|
76
|
+
| "tipsByWalletAndCurrency"
|
|
71
77
|
| "totalTipsByCurrency"
|
|
72
78
|
): FunctionFragment;
|
|
73
79
|
|
|
80
|
+
encodeFunctionData(
|
|
81
|
+
functionFragment: "sendTip",
|
|
82
|
+
values: [BigNumberish, BytesLike]
|
|
83
|
+
): string;
|
|
74
84
|
encodeFunctionData(
|
|
75
85
|
functionFragment: "tip",
|
|
76
86
|
values: [ITippingBase.TipRequestStruct]
|
|
@@ -79,6 +89,10 @@ export interface ITippingInterface extends utils.Interface {
|
|
|
79
89
|
functionFragment: "tipAmountByCurrency",
|
|
80
90
|
values: [string]
|
|
81
91
|
): string;
|
|
92
|
+
encodeFunctionData(
|
|
93
|
+
functionFragment: "tipCountByWalletAndCurrency",
|
|
94
|
+
values: [string, string]
|
|
95
|
+
): string;
|
|
82
96
|
encodeFunctionData(
|
|
83
97
|
functionFragment: "tippingCurrencies",
|
|
84
98
|
values?: undefined
|
|
@@ -87,16 +101,25 @@ export interface ITippingInterface extends utils.Interface {
|
|
|
87
101
|
functionFragment: "tipsByCurrencyAndTokenId",
|
|
88
102
|
values: [BigNumberish, string]
|
|
89
103
|
): string;
|
|
104
|
+
encodeFunctionData(
|
|
105
|
+
functionFragment: "tipsByWalletAndCurrency",
|
|
106
|
+
values: [string, string]
|
|
107
|
+
): string;
|
|
90
108
|
encodeFunctionData(
|
|
91
109
|
functionFragment: "totalTipsByCurrency",
|
|
92
110
|
values: [string]
|
|
93
111
|
): string;
|
|
94
112
|
|
|
113
|
+
decodeFunctionResult(functionFragment: "sendTip", data: BytesLike): Result;
|
|
95
114
|
decodeFunctionResult(functionFragment: "tip", data: BytesLike): Result;
|
|
96
115
|
decodeFunctionResult(
|
|
97
116
|
functionFragment: "tipAmountByCurrency",
|
|
98
117
|
data: BytesLike
|
|
99
118
|
): Result;
|
|
119
|
+
decodeFunctionResult(
|
|
120
|
+
functionFragment: "tipCountByWalletAndCurrency",
|
|
121
|
+
data: BytesLike
|
|
122
|
+
): Result;
|
|
100
123
|
decodeFunctionResult(
|
|
101
124
|
functionFragment: "tippingCurrencies",
|
|
102
125
|
data: BytesLike
|
|
@@ -105,6 +128,10 @@ export interface ITippingInterface extends utils.Interface {
|
|
|
105
128
|
functionFragment: "tipsByCurrencyAndTokenId",
|
|
106
129
|
data: BytesLike
|
|
107
130
|
): Result;
|
|
131
|
+
decodeFunctionResult(
|
|
132
|
+
functionFragment: "tipsByWalletAndCurrency",
|
|
133
|
+
data: BytesLike
|
|
134
|
+
): Result;
|
|
108
135
|
decodeFunctionResult(
|
|
109
136
|
functionFragment: "totalTipsByCurrency",
|
|
110
137
|
data: BytesLike
|
|
@@ -112,9 +139,11 @@ export interface ITippingInterface extends utils.Interface {
|
|
|
112
139
|
|
|
113
140
|
events: {
|
|
114
141
|
"Tip(uint256,address,address,address,uint256,bytes32,bytes32)": EventFragment;
|
|
142
|
+
"TipSent(address,address,uint8,address,uint256,uint256)": EventFragment;
|
|
115
143
|
};
|
|
116
144
|
|
|
117
145
|
getEvent(nameOrSignatureOrTopic: "Tip"): EventFragment;
|
|
146
|
+
getEvent(nameOrSignatureOrTopic: "TipSent"): EventFragment;
|
|
118
147
|
}
|
|
119
148
|
|
|
120
149
|
export interface TipEventObject {
|
|
@@ -133,6 +162,21 @@ export type TipEvent = TypedEvent<
|
|
|
133
162
|
|
|
134
163
|
export type TipEventFilter = TypedEventFilter<TipEvent>;
|
|
135
164
|
|
|
165
|
+
export interface TipSentEventObject {
|
|
166
|
+
sender: string;
|
|
167
|
+
receiver: string;
|
|
168
|
+
recipientType: number;
|
|
169
|
+
currency: string;
|
|
170
|
+
amount: BigNumber;
|
|
171
|
+
tokenId: BigNumber;
|
|
172
|
+
}
|
|
173
|
+
export type TipSentEvent = TypedEvent<
|
|
174
|
+
[string, string, number, string, BigNumber, BigNumber],
|
|
175
|
+
TipSentEventObject
|
|
176
|
+
>;
|
|
177
|
+
|
|
178
|
+
export type TipSentEventFilter = TypedEventFilter<TipSentEvent>;
|
|
179
|
+
|
|
136
180
|
export interface ITipping extends BaseContract {
|
|
137
181
|
connect(signerOrProvider: Signer | Provider | string): this;
|
|
138
182
|
attach(addressOrName: string): this;
|
|
@@ -160,6 +204,12 @@ export interface ITipping extends BaseContract {
|
|
|
160
204
|
removeListener: OnEvent<this>;
|
|
161
205
|
|
|
162
206
|
functions: {
|
|
207
|
+
sendTip(
|
|
208
|
+
recipientType: BigNumberish,
|
|
209
|
+
data: BytesLike,
|
|
210
|
+
overrides?: PayableOverrides & { from?: string }
|
|
211
|
+
): Promise<ContractTransaction>;
|
|
212
|
+
|
|
163
213
|
tip(
|
|
164
214
|
tipRequest: ITippingBase.TipRequestStruct,
|
|
165
215
|
overrides?: PayableOverrides & { from?: string }
|
|
@@ -170,6 +220,12 @@ export interface ITipping extends BaseContract {
|
|
|
170
220
|
overrides?: CallOverrides
|
|
171
221
|
): Promise<[BigNumber]>;
|
|
172
222
|
|
|
223
|
+
tipCountByWalletAndCurrency(
|
|
224
|
+
wallet: string,
|
|
225
|
+
currency: string,
|
|
226
|
+
overrides?: CallOverrides
|
|
227
|
+
): Promise<[BigNumber]>;
|
|
228
|
+
|
|
173
229
|
tippingCurrencies(overrides?: CallOverrides): Promise<[string[]]>;
|
|
174
230
|
|
|
175
231
|
tipsByCurrencyAndTokenId(
|
|
@@ -178,12 +234,24 @@ export interface ITipping extends BaseContract {
|
|
|
178
234
|
overrides?: CallOverrides
|
|
179
235
|
): Promise<[BigNumber]>;
|
|
180
236
|
|
|
237
|
+
tipsByWalletAndCurrency(
|
|
238
|
+
wallet: string,
|
|
239
|
+
currency: string,
|
|
240
|
+
overrides?: CallOverrides
|
|
241
|
+
): Promise<[BigNumber]>;
|
|
242
|
+
|
|
181
243
|
totalTipsByCurrency(
|
|
182
244
|
currency: string,
|
|
183
245
|
overrides?: CallOverrides
|
|
184
246
|
): Promise<[BigNumber]>;
|
|
185
247
|
};
|
|
186
248
|
|
|
249
|
+
sendTip(
|
|
250
|
+
recipientType: BigNumberish,
|
|
251
|
+
data: BytesLike,
|
|
252
|
+
overrides?: PayableOverrides & { from?: string }
|
|
253
|
+
): Promise<ContractTransaction>;
|
|
254
|
+
|
|
187
255
|
tip(
|
|
188
256
|
tipRequest: ITippingBase.TipRequestStruct,
|
|
189
257
|
overrides?: PayableOverrides & { from?: string }
|
|
@@ -194,6 +262,12 @@ export interface ITipping extends BaseContract {
|
|
|
194
262
|
overrides?: CallOverrides
|
|
195
263
|
): Promise<BigNumber>;
|
|
196
264
|
|
|
265
|
+
tipCountByWalletAndCurrency(
|
|
266
|
+
wallet: string,
|
|
267
|
+
currency: string,
|
|
268
|
+
overrides?: CallOverrides
|
|
269
|
+
): Promise<BigNumber>;
|
|
270
|
+
|
|
197
271
|
tippingCurrencies(overrides?: CallOverrides): Promise<string[]>;
|
|
198
272
|
|
|
199
273
|
tipsByCurrencyAndTokenId(
|
|
@@ -202,12 +276,24 @@ export interface ITipping extends BaseContract {
|
|
|
202
276
|
overrides?: CallOverrides
|
|
203
277
|
): Promise<BigNumber>;
|
|
204
278
|
|
|
279
|
+
tipsByWalletAndCurrency(
|
|
280
|
+
wallet: string,
|
|
281
|
+
currency: string,
|
|
282
|
+
overrides?: CallOverrides
|
|
283
|
+
): Promise<BigNumber>;
|
|
284
|
+
|
|
205
285
|
totalTipsByCurrency(
|
|
206
286
|
currency: string,
|
|
207
287
|
overrides?: CallOverrides
|
|
208
288
|
): Promise<BigNumber>;
|
|
209
289
|
|
|
210
290
|
callStatic: {
|
|
291
|
+
sendTip(
|
|
292
|
+
recipientType: BigNumberish,
|
|
293
|
+
data: BytesLike,
|
|
294
|
+
overrides?: CallOverrides
|
|
295
|
+
): Promise<void>;
|
|
296
|
+
|
|
211
297
|
tip(
|
|
212
298
|
tipRequest: ITippingBase.TipRequestStruct,
|
|
213
299
|
overrides?: CallOverrides
|
|
@@ -218,6 +304,12 @@ export interface ITipping extends BaseContract {
|
|
|
218
304
|
overrides?: CallOverrides
|
|
219
305
|
): Promise<BigNumber>;
|
|
220
306
|
|
|
307
|
+
tipCountByWalletAndCurrency(
|
|
308
|
+
wallet: string,
|
|
309
|
+
currency: string,
|
|
310
|
+
overrides?: CallOverrides
|
|
311
|
+
): Promise<BigNumber>;
|
|
312
|
+
|
|
221
313
|
tippingCurrencies(overrides?: CallOverrides): Promise<string[]>;
|
|
222
314
|
|
|
223
315
|
tipsByCurrencyAndTokenId(
|
|
@@ -226,6 +318,12 @@ export interface ITipping extends BaseContract {
|
|
|
226
318
|
overrides?: CallOverrides
|
|
227
319
|
): Promise<BigNumber>;
|
|
228
320
|
|
|
321
|
+
tipsByWalletAndCurrency(
|
|
322
|
+
wallet: string,
|
|
323
|
+
currency: string,
|
|
324
|
+
overrides?: CallOverrides
|
|
325
|
+
): Promise<BigNumber>;
|
|
326
|
+
|
|
229
327
|
totalTipsByCurrency(
|
|
230
328
|
currency: string,
|
|
231
329
|
overrides?: CallOverrides
|
|
@@ -251,9 +349,32 @@ export interface ITipping extends BaseContract {
|
|
|
251
349
|
messageId?: null,
|
|
252
350
|
channelId?: null
|
|
253
351
|
): TipEventFilter;
|
|
352
|
+
|
|
353
|
+
"TipSent(address,address,uint8,address,uint256,uint256)"(
|
|
354
|
+
sender?: string | null,
|
|
355
|
+
receiver?: string | null,
|
|
356
|
+
recipientType?: BigNumberish | null,
|
|
357
|
+
currency?: null,
|
|
358
|
+
amount?: null,
|
|
359
|
+
tokenId?: null
|
|
360
|
+
): TipSentEventFilter;
|
|
361
|
+
TipSent(
|
|
362
|
+
sender?: string | null,
|
|
363
|
+
receiver?: string | null,
|
|
364
|
+
recipientType?: BigNumberish | null,
|
|
365
|
+
currency?: null,
|
|
366
|
+
amount?: null,
|
|
367
|
+
tokenId?: null
|
|
368
|
+
): TipSentEventFilter;
|
|
254
369
|
};
|
|
255
370
|
|
|
256
371
|
estimateGas: {
|
|
372
|
+
sendTip(
|
|
373
|
+
recipientType: BigNumberish,
|
|
374
|
+
data: BytesLike,
|
|
375
|
+
overrides?: PayableOverrides & { from?: string }
|
|
376
|
+
): Promise<BigNumber>;
|
|
377
|
+
|
|
257
378
|
tip(
|
|
258
379
|
tipRequest: ITippingBase.TipRequestStruct,
|
|
259
380
|
overrides?: PayableOverrides & { from?: string }
|
|
@@ -264,6 +385,12 @@ export interface ITipping extends BaseContract {
|
|
|
264
385
|
overrides?: CallOverrides
|
|
265
386
|
): Promise<BigNumber>;
|
|
266
387
|
|
|
388
|
+
tipCountByWalletAndCurrency(
|
|
389
|
+
wallet: string,
|
|
390
|
+
currency: string,
|
|
391
|
+
overrides?: CallOverrides
|
|
392
|
+
): Promise<BigNumber>;
|
|
393
|
+
|
|
267
394
|
tippingCurrencies(overrides?: CallOverrides): Promise<BigNumber>;
|
|
268
395
|
|
|
269
396
|
tipsByCurrencyAndTokenId(
|
|
@@ -272,6 +399,12 @@ export interface ITipping extends BaseContract {
|
|
|
272
399
|
overrides?: CallOverrides
|
|
273
400
|
): Promise<BigNumber>;
|
|
274
401
|
|
|
402
|
+
tipsByWalletAndCurrency(
|
|
403
|
+
wallet: string,
|
|
404
|
+
currency: string,
|
|
405
|
+
overrides?: CallOverrides
|
|
406
|
+
): Promise<BigNumber>;
|
|
407
|
+
|
|
275
408
|
totalTipsByCurrency(
|
|
276
409
|
currency: string,
|
|
277
410
|
overrides?: CallOverrides
|
|
@@ -279,6 +412,12 @@ export interface ITipping extends BaseContract {
|
|
|
279
412
|
};
|
|
280
413
|
|
|
281
414
|
populateTransaction: {
|
|
415
|
+
sendTip(
|
|
416
|
+
recipientType: BigNumberish,
|
|
417
|
+
data: BytesLike,
|
|
418
|
+
overrides?: PayableOverrides & { from?: string }
|
|
419
|
+
): Promise<PopulatedTransaction>;
|
|
420
|
+
|
|
282
421
|
tip(
|
|
283
422
|
tipRequest: ITippingBase.TipRequestStruct,
|
|
284
423
|
overrides?: PayableOverrides & { from?: string }
|
|
@@ -289,6 +428,12 @@ export interface ITipping extends BaseContract {
|
|
|
289
428
|
overrides?: CallOverrides
|
|
290
429
|
): Promise<PopulatedTransaction>;
|
|
291
430
|
|
|
431
|
+
tipCountByWalletAndCurrency(
|
|
432
|
+
wallet: string,
|
|
433
|
+
currency: string,
|
|
434
|
+
overrides?: CallOverrides
|
|
435
|
+
): Promise<PopulatedTransaction>;
|
|
436
|
+
|
|
292
437
|
tippingCurrencies(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
293
438
|
|
|
294
439
|
tipsByCurrencyAndTokenId(
|
|
@@ -297,6 +442,12 @@ export interface ITipping extends BaseContract {
|
|
|
297
442
|
overrides?: CallOverrides
|
|
298
443
|
): Promise<PopulatedTransaction>;
|
|
299
444
|
|
|
445
|
+
tipsByWalletAndCurrency(
|
|
446
|
+
wallet: string,
|
|
447
|
+
currency: string,
|
|
448
|
+
overrides?: CallOverrides
|
|
449
|
+
): Promise<PopulatedTransaction>;
|
|
450
|
+
|
|
300
451
|
totalTipsByCurrency(
|
|
301
452
|
currency: string,
|
|
302
453
|
overrides?: CallOverrides
|
|
@@ -7,6 +7,24 @@ import type { Provider } from "@ethersproject/providers";
|
|
|
7
7
|
import type { ITipping, ITippingInterface } from "../ITipping";
|
|
8
8
|
|
|
9
9
|
const _abi = [
|
|
10
|
+
{
|
|
11
|
+
type: "function",
|
|
12
|
+
name: "sendTip",
|
|
13
|
+
inputs: [
|
|
14
|
+
{
|
|
15
|
+
name: "recipientType",
|
|
16
|
+
type: "uint8",
|
|
17
|
+
internalType: "enum ITippingBase.TipRecipientType",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "data",
|
|
21
|
+
type: "bytes",
|
|
22
|
+
internalType: "bytes",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
outputs: [],
|
|
26
|
+
stateMutability: "payable",
|
|
27
|
+
},
|
|
10
28
|
{
|
|
11
29
|
type: "function",
|
|
12
30
|
name: "tip",
|
|
@@ -71,6 +89,30 @@ const _abi = [
|
|
|
71
89
|
],
|
|
72
90
|
stateMutability: "view",
|
|
73
91
|
},
|
|
92
|
+
{
|
|
93
|
+
type: "function",
|
|
94
|
+
name: "tipCountByWalletAndCurrency",
|
|
95
|
+
inputs: [
|
|
96
|
+
{
|
|
97
|
+
name: "wallet",
|
|
98
|
+
type: "address",
|
|
99
|
+
internalType: "address",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "currency",
|
|
103
|
+
type: "address",
|
|
104
|
+
internalType: "address",
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
outputs: [
|
|
108
|
+
{
|
|
109
|
+
name: "",
|
|
110
|
+
type: "uint256",
|
|
111
|
+
internalType: "uint256",
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
stateMutability: "view",
|
|
115
|
+
},
|
|
74
116
|
{
|
|
75
117
|
type: "function",
|
|
76
118
|
name: "tippingCurrencies",
|
|
@@ -108,6 +150,30 @@ const _abi = [
|
|
|
108
150
|
],
|
|
109
151
|
stateMutability: "view",
|
|
110
152
|
},
|
|
153
|
+
{
|
|
154
|
+
type: "function",
|
|
155
|
+
name: "tipsByWalletAndCurrency",
|
|
156
|
+
inputs: [
|
|
157
|
+
{
|
|
158
|
+
name: "wallet",
|
|
159
|
+
type: "address",
|
|
160
|
+
internalType: "address",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "currency",
|
|
164
|
+
type: "address",
|
|
165
|
+
internalType: "address",
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
outputs: [
|
|
169
|
+
{
|
|
170
|
+
name: "",
|
|
171
|
+
type: "uint256",
|
|
172
|
+
internalType: "uint256",
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
stateMutability: "view",
|
|
176
|
+
},
|
|
111
177
|
{
|
|
112
178
|
type: "function",
|
|
113
179
|
name: "totalTipsByCurrency",
|
|
@@ -176,6 +242,49 @@ const _abi = [
|
|
|
176
242
|
],
|
|
177
243
|
anonymous: false,
|
|
178
244
|
},
|
|
245
|
+
{
|
|
246
|
+
type: "event",
|
|
247
|
+
name: "TipSent",
|
|
248
|
+
inputs: [
|
|
249
|
+
{
|
|
250
|
+
name: "sender",
|
|
251
|
+
type: "address",
|
|
252
|
+
indexed: true,
|
|
253
|
+
internalType: "address",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: "receiver",
|
|
257
|
+
type: "address",
|
|
258
|
+
indexed: true,
|
|
259
|
+
internalType: "address",
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "recipientType",
|
|
263
|
+
type: "uint8",
|
|
264
|
+
indexed: true,
|
|
265
|
+
internalType: "enum ITippingBase.TipRecipientType",
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "currency",
|
|
269
|
+
type: "address",
|
|
270
|
+
indexed: false,
|
|
271
|
+
internalType: "address",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "amount",
|
|
275
|
+
type: "uint256",
|
|
276
|
+
indexed: false,
|
|
277
|
+
internalType: "uint256",
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: "tokenId",
|
|
281
|
+
type: "uint256",
|
|
282
|
+
indexed: false,
|
|
283
|
+
internalType: "uint256",
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
anonymous: false,
|
|
287
|
+
},
|
|
179
288
|
{
|
|
180
289
|
type: "error",
|
|
181
290
|
name: "AmountIsZero",
|
|
@@ -191,6 +300,16 @@ const _abi = [
|
|
|
191
300
|
name: "CurrencyIsZero",
|
|
192
301
|
inputs: [],
|
|
193
302
|
},
|
|
303
|
+
{
|
|
304
|
+
type: "error",
|
|
305
|
+
name: "InvalidRecipientType",
|
|
306
|
+
inputs: [],
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
type: "error",
|
|
310
|
+
name: "InvalidTipData",
|
|
311
|
+
inputs: [],
|
|
312
|
+
},
|
|
194
313
|
{
|
|
195
314
|
type: "error",
|
|
196
315
|
name: "MsgValueMismatch",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towns-protocol/generated",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.375",
|
|
4
4
|
"packageManager": "yarn@3.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"ethers": "^5.8.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@towns-protocol/contracts": "^0.0.
|
|
16
|
+
"@towns-protocol/contracts": "^0.0.375"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"config/**/*",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "f64537fbf8d7eca815c5c5e52f601a387e713a0a"
|
|
36
36
|
}
|
package/scripts/prepare.js
CHANGED
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* CONTRACT ARTIFACT MANAGEMENT
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* Strategy: npm download when possible, local generation when needed.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Foundry auto-installation is removed; requires manual installation in local dev.
|
|
8
|
+
*
|
|
9
|
+
* 1. No artifacts → try npm download → validate hash:
|
|
10
|
+
* - Hash match: use npm artifacts
|
|
11
|
+
* - Hash mismatch + Foundry installed: regenerate locally
|
|
12
|
+
* - Hash mismatch + NO Foundry: use npm artifacts with warning (Vercel case)
|
|
13
|
+
* 2. Artifacts exist + contracts changed → regenerate locally (Foundry required, local only)
|
|
14
|
+
* 3. SKIP_CONTRACT_GEN=true → skip checks, use existing artifacts
|
|
15
|
+
*
|
|
12
16
|
* Uses package.json version + git tree hash for validation.
|
|
13
17
|
*/
|
|
14
18
|
|
|
@@ -94,18 +98,7 @@ async function downloadArtifactsFromNpm() {
|
|
|
94
98
|
|
|
95
99
|
if (!existsSync(devDir)) mkdirSync(devDir, { recursive: true });
|
|
96
100
|
execSync(`cp -r "${extractedDevDir}/." "${devDir}/"`, { stdio: 'pipe' });
|
|
97
|
-
|
|
98
|
-
// Validate hash if contracts exist
|
|
99
|
-
const currentHash = getContractsHash();
|
|
100
|
-
if (currentHash && existsSync(hashFile)) {
|
|
101
|
-
const downloadedHash = readFileSync(hashFile, 'utf8').trim();
|
|
102
|
-
if (currentHash !== downloadedHash) {
|
|
103
|
-
console.log('Hash mismatch, falling back to local generation');
|
|
104
|
-
execSync(`rm -rf "${devDir}"`, { stdio: 'pipe' });
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
101
|
+
|
|
109
102
|
console.log('Successfully downloaded artifacts from npm');
|
|
110
103
|
return true;
|
|
111
104
|
} catch (error) {
|
|
@@ -127,44 +120,18 @@ function isFoundryInstalled() {
|
|
|
127
120
|
}
|
|
128
121
|
}
|
|
129
122
|
|
|
130
|
-
// Install Foundry if not present
|
|
131
|
-
function installFoundry() {
|
|
132
|
-
console.log('Installing Foundry...');
|
|
133
|
-
try {
|
|
134
|
-
// Install foundryup
|
|
135
|
-
execSync('curl -L https://foundry.paradigm.xyz | bash', { stdio: 'inherit' });
|
|
136
|
-
|
|
137
|
-
// foundryup modifies shell PATH, but we need to update Node.js process PATH
|
|
138
|
-
// so subsequent execSync calls can find forge
|
|
139
|
-
const foundryPath = `${process.env.HOME}/.foundry/bin`;
|
|
140
|
-
process.env.PATH = `${foundryPath}:${process.env.PATH}`;
|
|
141
|
-
|
|
142
|
-
// Install latest foundry
|
|
143
|
-
execSync('foundryup', { stdio: 'inherit' });
|
|
144
|
-
|
|
145
|
-
console.log('Foundry installation completed');
|
|
146
|
-
return true;
|
|
147
|
-
} catch (error) {
|
|
148
|
-
console.log('Foundry installation failed:', error.message);
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
123
|
// Generate contract artifacts
|
|
154
124
|
function generateArtifacts() {
|
|
155
|
-
// Check for contracts directory
|
|
125
|
+
// Check for contracts directory
|
|
156
126
|
if (!existsSync(contractsDir)) {
|
|
157
|
-
|
|
158
|
-
throw new Error('Cannot generate artifacts: contracts package not available and npm download failed');
|
|
127
|
+
throw new Error('Cannot generate artifacts: contracts package not available');
|
|
159
128
|
}
|
|
160
|
-
|
|
129
|
+
|
|
130
|
+
// Require Foundry to be installed
|
|
161
131
|
if (!isFoundryInstalled()) {
|
|
162
|
-
|
|
163
|
-
if (!installFoundry()) {
|
|
164
|
-
throw new Error('Failed to install Foundry - cannot generate contract artifacts');
|
|
165
|
-
}
|
|
132
|
+
throw new Error('Foundry is not installed and is required to generate contract artifacts.');
|
|
166
133
|
}
|
|
167
|
-
|
|
134
|
+
|
|
168
135
|
const buildScript = resolve(contractsDir, 'scripts/build-contract-types.sh');
|
|
169
136
|
|
|
170
137
|
if (!existsSync(buildScript)) {
|
|
@@ -180,21 +147,36 @@ function generateArtifacts() {
|
|
|
180
147
|
// Main logic
|
|
181
148
|
async function main() {
|
|
182
149
|
const skipRequested = process.env.SKIP_CONTRACT_GEN === 'true';
|
|
183
|
-
|
|
150
|
+
|
|
184
151
|
if (!generatedFilesExist()) {
|
|
185
152
|
console.log('No artifacts found, trying npm download first...');
|
|
186
|
-
if (
|
|
187
|
-
|
|
153
|
+
if (await downloadArtifactsFromNpm()) {
|
|
154
|
+
// Check if hash validation is needed
|
|
155
|
+
const currentHash = getContractsHash();
|
|
156
|
+
if (currentHash && existsSync(hashFile)) {
|
|
157
|
+
const downloadedHash = readFileSync(hashFile, 'utf8').trim();
|
|
158
|
+
if (currentHash !== downloadedHash) {
|
|
159
|
+
// Hash mismatch: regenerate if Foundry available, otherwise use downloaded
|
|
160
|
+
if (isFoundryInstalled()) {
|
|
161
|
+
console.log('Hash mismatch detected, regenerating locally with Foundry...');
|
|
162
|
+
generateArtifacts();
|
|
163
|
+
} else {
|
|
164
|
+
console.log('WARNING: Hash mismatch but Foundry not available, using downloaded artifacts');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
console.log('NPM download failed, attempting local generation...');
|
|
188
170
|
generateArtifacts();
|
|
189
171
|
}
|
|
190
172
|
return;
|
|
191
173
|
}
|
|
192
|
-
|
|
174
|
+
|
|
193
175
|
if (skipRequested) {
|
|
194
176
|
console.log('Skipping generation (SKIP_CONTRACT_GEN=true)');
|
|
195
177
|
return;
|
|
196
178
|
}
|
|
197
|
-
|
|
179
|
+
|
|
198
180
|
if (contractsChanged()) {
|
|
199
181
|
console.log('Contracts changed, regenerating...');
|
|
200
182
|
generateArtifacts();
|