user725: Transition function throws an error. Here it is.
transition :: FreelanceContract -> State FContractDatum -> FContractRedeemer -> Maybe (TxConstraints Void Void, State FContractDatum)
transition fc s r =
    case (stateValue s, stateData s, r) of
        _ -> Just (Constraints.mustBeSignedBy (freelancer fc) , State (FContractDatum 1 (Just 0)) (lovelaceValueOf 2))

Here is the wallet code for submitting the transaction
    case m of
        Nothing             -> throwError "Contract ouput not found"
        Just ((o, _), _) -> case tyTxOutData o of

            FContractDatum 0 Nothing -> do
                logInfo @String "Contract found. Accepting..."
                void $ mapError' $ runStep client Accept
                logInfo @String "Contract Accepted"

            _ -> throwError "unexpected datum"

And here is the error that is thrown when I run my trace.

I have boiled this code down to its simplest parts, but still, the error persists. :/

user255: The problem is most probably caused by an omitted check function. Even if you do not use it, you have to specify it.
Example:
check :: FreelanceContract -> FContractDatum -> FContractRedeemer -> ScriptContext -> Bool
check _ _ _ _ = True

...

fCStateMachine :: FreelanceContract -> StateMachine FContractDatum FContractRedeemer
fCStateMachine fc = StateMachine
{ smTransition = transition fc
, smFinal = final
, smCheck = check fc
, smThreadToken = blah blah
}

with the assumption that the function pointing to your final state is final and your ThreadToken "blah blah" :)

user725: My StateMachine does not need any additional checks with the smCheck so I completely removed the field. The compiler complained only a little bit and gave me a warning that I had an uninitialized field. Turns out, this field is required for any transitions to be valid.
I added in this function which always returns True and the error was fixed.
check :: FContractDatum -> FContractRedeemer -> ScriptContext -> Bool
check _ _ _ = True


725: <p>Transition function throws an error. Here it is.</p>
<pre><code>transition :: FreelanceContract -&gt; State FContractDatum -&gt; FContractRedeemer -&gt; Maybe (TxConstraints Void Void, State FContractDatum)
transition fc s r =
    case (stateValue s, stateData s, r) of
        _ -&gt; Just (Constraints.mustBeSignedBy (freelancer fc) , State (FContractDatum 1 (Just 0)) (lovelaceValueOf 2))
</code></pre>
<p>Here is the wallet code for submitting the transaction</p>
<pre><code>    case m of
        Nothing             -&gt; throwError &quot;Contract ouput not found&quot;
        Just ((o, _), _) -&gt; case tyTxOutData o of

            FContractDatum 0 Nothing -&gt; do
                logInfo @String &quot;Contract found. Accepting...&quot;
                void $ mapError' $ runStep client Accept
                logInfo @String &quot;Contract Accepted&quot;

            _ -&gt; throwError &quot;unexpected datum&quot;
</code></pre>
<p>And here is the error that is thrown when I run my trace.
<a href="https://i.stack.imgur.com/ayMcH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ayMcH.png" alt="enter image description here" /></a></p>
<p>I have boiled this code down to its simplest parts, but still, the error persists. :/</p>
 255: <p>The problem is most probably caused by an omitted <code>check</code> function. Even if you do not use it, you have to specify it.</p>
<p>Example:</p>
<pre><code>check :: FreelanceContract -&gt; FContractDatum -&gt; FContractRedeemer -&gt; ScriptContext -&gt; Bool
check _ _ _ _ = True

...

fCStateMachine :: FreelanceContract -&gt; StateMachine FContractDatum FContractRedeemer
fCStateMachine fc = StateMachine
{ smTransition = transition fc
, smFinal = final
, smCheck = check fc
, smThreadToken = blah blah
}
</code></pre>
<p>with the assumption that the function pointing to your final state is <code>final</code> and your <code>ThreadToken</code> &quot;blah blah&quot; :)</p>
 725: <p>My StateMachine does not need any additional checks with the smCheck so I completely removed the field. The compiler complained only a little bit and gave me a warning that I had an uninitialized field. Turns out, this field is required for any transitions to be valid.</p>
<p>I added in this function which always returns True and the error was fixed.</p>
<pre><code>check :: FContractDatum -&gt; FContractRedeemer -&gt; ScriptContext -&gt; Bool
check _ _ _ = True
</code></pre>
