File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 5
5
import { approvalProcessTypes , type ApprovalProcess , type ApprovalProcessType } from " $lib/models/approval-process" ;
6
6
import type { DropdownItem , GlobalState } from " $lib/models/ui" ;
7
7
import type { Relayer } from " $lib/models/relayer" ;
8
+ import { getNetworkLiteral } from " $lib/models/network" ;
8
9
9
10
function approvalProcessByNetworkAndComponent(ap : ApprovalProcess ) {
10
11
const networkName = typeof globalState .form .network === ' string'
58
59
viaType: " Relayer" ,
59
60
via: relayer .value .address ,
60
61
relayerId: relayer .value .relayerId ,
62
+ network: globalState .form .network && getNetworkLiteral (globalState .form .network ),
61
63
};
62
64
}
63
65
};
69
71
globalState .form .approvalProcessToCreate = {
70
72
viaType: approvalProcessType as " EOA" | " Safe" | " Relayer" ,
71
73
via: element .value ,
74
+ network: globalState .form .network && getNetworkLiteral (globalState .form .network ),
72
75
};
73
76
};
74
77
Original file line number Diff line number Diff line change 65
65
return { path , name };
66
66
});
67
67
68
+ let enforceDeterministic = $derived .by (() => {
69
+ const selectedMultisig = globalState .form .approvalType === ' existing' && globalState .form .approvalProcessSelected ?.viaType === " Safe" ;
70
+ const toCreateMultisig = globalState .form .approvalType === ' new' && globalState .form .approvalProcessToCreate ?.viaType === " Safe" ;
71
+ return selectedMultisig || toCreateMultisig ;
72
+ });
73
+
68
74
$effect (() => {
69
75
contractPath = contractInfo .path ;
70
76
contractName = contractInfo .name ;
231
237
setDeploymentCompleted (false );
232
238
deploying = true ;
233
239
240
+ if ((enforceDeterministic || isDeterministic ) && ! salt ) {
241
+ logError (" [Defender Deploy] Salt is required for deterministic deployments." );
242
+ deploying = false ;
243
+ return ;
244
+ }
245
+
234
246
const [constructorBytecode, constructorError] = await encodeConstructorArgs (inputs , inputsWithValue );
235
247
if (constructorError ) {
236
248
logError (` [Defender Deploy] Error encoding constructor arguments: ${constructorError .msg } ` );
350
362
class =" form-check-input"
351
363
type =" checkbox"
352
364
id =" isDeterministic"
353
- checked ={isDeterministic }
365
+ checked ={isDeterministic || enforceDeterministic }
354
366
onchange ={() => (isDeterministic = ! isDeterministic )}
367
+ disabled ={enforceDeterministic }
355
368
>
356
369
<label class =" form-check-label" for =" isDeterministic" >
357
370
Deterministic
358
371
</label >
372
+ {#if enforceDeterministic }
373
+ <i class =" fa fa-question-circle ml-2" title =" When using a Safe as the approval process, the salt is required to be deterministic." ></i >
374
+ {/if }
359
375
</div >
360
376
</div >
361
377
362
378
363
- {#if isDeterministic }
379
+ {#if isDeterministic || enforceDeterministic }
364
380
<label for ="salt" >{` Salt ` }</label >
365
381
<input
366
382
name =" salt"
You can’t perform that action at this time.
0 commit comments