Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/models/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type GlobalState = {
source?: CompilationFileSources | null | SourceWithTarget,
version?: string,
data?: CompilationResult | null,
enforceDeterministicReason?: string,
}
form: {
network?: string | TenantNetworkResponse;
Expand Down
13 changes: 11 additions & 2 deletions src/lib/wizard/components/Deploy.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
let enforceDeterministic = $derived.by(() => {
const selectedMultisig = globalState.form.approvalType === 'existing' && isMultisig(globalState.form.approvalProcessSelected?.viaType);
const toCreateMultisig = globalState.form.approvalType === 'new' && isMultisig(globalState.form.approvalProcessToCreate?.viaType);
return selectedMultisig || toCreateMultisig;
const hasReasonMessage = globalState.contract?.enforceDeterministicReason !== undefined;
return selectedMultisig || toCreateMultisig || hasReasonMessage;
});

const deploymentUrl = $derived(
Expand Down Expand Up @@ -97,6 +98,10 @@

if (globalState.contract?.target && compilationResult) {
inputs = getConstructorInputsWizard(globalState.contract.target, compilationResult.output.contracts);

// Clear deploy status messages
successMessage = "";
errorMessage = "";
}
isCompiling = false;
}
Expand Down Expand Up @@ -226,7 +231,11 @@
}

if ((isDeterministic || enforceDeterministic) && !salt) {
displayMessage("Salt is required", "error");
if (globalState.contract?.enforceDeterministicReason) {
displayMessage(`Salt is required: ${globalState.contract.enforceDeterministicReason}`, "error");
} else {
displayMessage("Salt is required", "error");
}
return;
}

Expand Down
4 changes: 3 additions & 1 deletion src/lib/wizard/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { globalState } from "$lib/state/state.svelte";
export interface DefenderDeployMessage {
kind: 'oz-wizard-defender-deploy';
sources: ContractSources;
enforceDeterministicReason?: string;
}

export const initWizardPlugin = () => {
Expand All @@ -18,7 +19,8 @@ function listenToContracts() {
source: {
sources: e.data.sources,
},
target: getMainContractName(e.data.sources)
target: getMainContractName(e.data.sources),
enforceDeterministicReason: e.data.enforceDeterministicReason,
};
}
});
Expand Down