@@ -23,6 +23,11 @@ export enum StrategyType {
23
23
RAFFLE = 2 ,
24
24
}
25
25
26
+ export enum ERC1155StrategyType {
27
+ POOL = 0 ,
28
+ MINT = 1 ,
29
+ }
30
+
26
31
export type Target = {
27
32
isBase : boolean ;
28
33
instance : Address ;
@@ -85,16 +90,24 @@ export interface SignerValidatorPayload {
85
90
signers : Address [ ] ;
86
91
}
87
92
93
+ export const prepareSignerValidatorPayload = ( {
94
+ signers
95
+ } : SignerValidatorPayload ) => {
96
+ return encodeAbiParameters (
97
+ [
98
+ { type : 'address[]' , name : 'signers' } ,
99
+ ] ,
100
+ [ signers ] ,
101
+ ) ;
102
+ } ;
103
+
88
104
export function signerValidator ( {
89
105
signers,
90
106
} : SignerValidatorPayload ) : Target {
91
107
return {
92
108
isBase : true ,
93
109
instance : zeroAddress ,
94
- parameters : encodeAbiParameters (
95
- [ { type : 'address[]' , name : 'signers' } ] ,
96
- [ signers ] ,
97
- ) ,
110
+ parameters : prepareSignerValidatorPayload ( { signers } )
98
111
} ;
99
112
}
100
113
@@ -103,20 +116,56 @@ export interface SimpleAllowListPayload {
103
116
allowed : Address [ ] ;
104
117
}
105
118
119
+ export const prepareSimpleAllowListPayload = ( {
120
+ owner,
121
+ allowed
122
+ } : SimpleAllowListPayload ) => {
123
+ return encodeAbiParameters (
124
+ [
125
+ { type : 'address' , name : 'owner' } ,
126
+ { type : 'address[]' , name : 'allowed' } ,
127
+ ] ,
128
+ [ owner , allowed ] ,
129
+ ) ;
130
+ } ;
131
+
106
132
export function simpleAllowList ( {
107
133
owner,
108
134
allowed,
109
135
} : SimpleAllowListPayload ) : Target {
110
136
return {
111
137
isBase : true ,
112
138
instance : zeroAddress ,
113
- parameters : encodeAbiParameters (
114
- [
115
- { type : 'address' , name : 'owner' } ,
116
- { type : 'address[]' , name : 'allowed' } ,
117
- ] ,
118
- [ owner , allowed ] ,
119
- ) ,
139
+ parameters : prepareSimpleAllowListPayload ( { owner, allowed} )
140
+ } ;
141
+ }
142
+
143
+ export interface SimpleDenyListPayload {
144
+ owner : Address ;
145
+ allowed : Address [ ] ;
146
+ }
147
+
148
+ export const prepareSimpleDenyListPayload = ( {
149
+ owner,
150
+ allowed
151
+ } : SimpleDenyListPayload ) => {
152
+ return encodeAbiParameters (
153
+ [
154
+ { type : 'address' , name : 'owner' } ,
155
+ { type : 'address[]' , name : 'allowed' } ,
156
+ ] ,
157
+ [ owner , allowed ] ,
158
+ ) ;
159
+ } ;
160
+
161
+ export function simpleDenyList ( {
162
+ owner,
163
+ allowed,
164
+ } : SimpleDenyListPayload ) : Target {
165
+ return {
166
+ isBase : true ,
167
+ instance : zeroAddress ,
168
+ parameters : prepareSimpleDenyListPayload ( { owner, allowed} )
120
169
} ;
121
170
}
122
171
@@ -126,6 +175,9 @@ export interface BoostPayload {
126
175
validator : Target ;
127
176
allowList : Target ;
128
177
incentives : Target [ ] ;
178
+ protocolFee ?: bigint ;
179
+ referralFee ?: bigint ;
180
+ maxParticipants ?: bigint ;
129
181
owner : Address ;
130
182
}
131
183
@@ -135,6 +187,9 @@ export function prepareBoostPayload({
135
187
validator,
136
188
allowList,
137
189
incentives,
190
+ protocolFee = 0n ,
191
+ referralFee = 0n ,
192
+ maxParticipants = 0n ,
138
193
owner,
139
194
} : BoostPayload ) : Hex {
140
195
return LibZip . cdCompress (
@@ -151,9 +206,9 @@ export function prepareBoostPayload({
151
206
validator,
152
207
allowList,
153
208
incentives,
154
- protocolFee : 0n ,
155
- referralFee : 0n ,
156
- maxParticipants : 0n ,
209
+ protocolFee,
210
+ referralFee,
211
+ maxParticipants,
157
212
owner,
158
213
} ,
159
214
] ,
@@ -247,6 +302,115 @@ export function prepareFungibleTransfer({
247
302
) ;
248
303
}
249
304
305
+ export interface PreparePointsIncentivePayload {
306
+ venue : Address ;
307
+ selector : Hex ;
308
+ quantity : bigint ;
309
+ limit : bigint ;
310
+ }
311
+
312
+ export const preparePointsIncentivePayload = ( {
313
+ venue,
314
+ selector,
315
+ quantity,
316
+ limit,
317
+ } : PreparePointsIncentivePayload ) => {
318
+ return encodeAbiParameters (
319
+ [
320
+ { type : 'address' , name : 'venue' } ,
321
+ { type : 'bytes4' , name : 'selector' } ,
322
+ { type : 'uint256' , name : 'quantity' } ,
323
+ { type : 'uint256' , name : 'limit' } ,
324
+ ] ,
325
+ [ venue ,
326
+ selector ,
327
+ quantity ,
328
+ limit ] ,
329
+ ) ;
330
+ } ;
331
+
332
+ export interface PrepareCGDAIncentivePayload {
333
+ asset : Address ;
334
+ initialReward : bigint ;
335
+ rewardDecay : bigint ;
336
+ rewardBoost : bigint ;
337
+ totalBudget : bigint ;
338
+ }
339
+
340
+ export const prepareCGDAIncentivePayload = ( {
341
+ asset,
342
+ initialReward,
343
+ rewardDecay,
344
+ rewardBoost,
345
+ totalBudget
346
+ } : PrepareCGDAIncentivePayload ) => {
347
+ return encodeAbiParameters (
348
+ [
349
+ { type : 'address' , name : 'asset' } ,
350
+ { type : 'uint256' , name : 'initialReward' } ,
351
+ { type : 'uint256' , name : 'rewardDecay' } ,
352
+ { type : 'uint256' , name : 'rewardBoost' } ,
353
+ { type : 'uint256' , name : 'totalBudget' } ,
354
+ ] ,
355
+ [ asset ,
356
+ initialReward ,
357
+ rewardDecay ,
358
+ rewardBoost ,
359
+ totalBudget ] ,
360
+ ) ;
361
+ } ;
362
+
363
+ export interface PrepareERC1155IncentivePayload {
364
+ asset : Address ;
365
+ strategy : ERC1155StrategyType ;
366
+ tokenId : bigint ;
367
+ limit : bigint ;
368
+ extraData : Hex ;
369
+ }
370
+
371
+ export const prepareERC1155IncentivePayload = ( {
372
+ asset,
373
+ strategy,
374
+ tokenId,
375
+ limit,
376
+ extraData
377
+ } : PrepareERC1155IncentivePayload ) => {
378
+ return encodeAbiParameters (
379
+ [
380
+ { type : 'address' , name : 'asset' } ,
381
+ { type : 'uint8' , name : 'strategy' } ,
382
+ { type : 'uint256' , name : 'tokenId' } ,
383
+ { type : 'uint256' , name : 'limit' } ,
384
+ { type : 'bytes' , name : 'extraData' } ,
385
+ ] ,
386
+ [ asset ,
387
+ strategy ,
388
+ tokenId ,
389
+ limit ,
390
+ extraData ] ,
391
+ ) ;
392
+ } ;
393
+
394
+ export interface PrepareAllowListIncentivePayload {
395
+ allowList : Address
396
+ limit : bigint
397
+ }
398
+
399
+ export const prepareAllowListIncentivePayload = ( {
400
+ allowList,
401
+ limit
402
+ } : PrepareAllowListIncentivePayload ) => {
403
+ return encodeAbiParameters (
404
+ [
405
+ { type : 'address' , name : 'allowList' } ,
406
+ { type : 'uint256' , name : 'limit' } ,
407
+ ] ,
408
+ [ allowList ,
409
+ limit
410
+ ] ,
411
+ ) ;
412
+ } ;
413
+
250
414
export interface PrepareERC20IncentivePayload {
251
415
asset : Address ;
252
416
strategy : StrategyType ;
@@ -278,6 +442,8 @@ export interface ContractActionPayload {
278
442
value : bigint ;
279
443
}
280
444
445
+ export type ERC721MintActionPayload = ContractActionPayload
446
+
281
447
export interface PrepareSimpleBudgetPayload {
282
448
owner : Address ;
283
449
authorized : Address [ ] ;
0 commit comments