2 votes
Accepted

StateMachine - keep the same value for the next state

Which version of plutus are you using? IIRC a problem like that was fixed in the last couple of months and maybe updating your dependencies to the latest plutus-apps (repository was split in two) ...
Sebastian Nagel's user avatar
2 votes
Accepted

To use state machine or not to use state machine? This is a question

A state-machine gives you a framework for testing and reasoning about your code. It's generally much easier to think in terms of state machines where transactions are transitions, every transaction is ...
KtorZ's user avatar
  • 533
2 votes

StateMachine validation failing

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 ...
Isaac Padberg's user avatar
2 votes
Accepted

StateMachine validation failing

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 -&...
Aoaddeola's user avatar
  • 815
1 vote
Accepted

Is it possible to upgrade a State Machine?

Make a statemachine with a transition "Update". Use Constraints (or otherwise, eg check) to layout in which contexts an "Upgrade" is permissible. For example "must be signed ...
waalge's user avatar
  • 403
1 vote
Accepted

How does smCheck work?

Is this function then used as a sort of predicate on every attempted transition to a new state? Yes, this is why we include the following line check _ _ _ _ _ = True You can find docs for smCheck ...
Yanis Urbis's user avatar
1 vote
Accepted

passing the thread token

Because firstGame is the contract that initialises the game, it needs to communicate somehow the generated threadToken to the external world (secondGame in this case). For this kind of communication ...
kindofdev's user avatar
  • 1,304
1 vote
Accepted

Get public key into PubKeyHash and use it in mustBeSignedBy

It's an issue with Plutus core. Even though PubKeyHash is part of IsString type class, we can't use OverloadedStrings mechanism in on-chain code for certain types. Basically, the problem is this: ...
kindofdev's user avatar
  • 1,304
1 vote

Referencing between scripts and application to state machines

If you want to ensure that a validator A run alongside another validator B, you need to check that the validator hash is present by the other in a transaction. This can be done by indexing if an ...
Fermat's user avatar
  • 1,872
1 vote

How to create a smart contract constant variable?

You could modify your datum type to something like so: {constants: {...}, old_datum: {...}} Then, make your old validations take old_datum (you could unwrap old_datum as the same name as your current ...
micahkendall's user avatar
1 vote

How to mint mint NFT with StateMachine

There's a very complete example on how to mint NFTs here. You can try to add this in the transition part of this state machine.
Falcon Stakepool's user avatar
1 vote

Will Cardano ever have anything more than validators on-chain?

You're right, data transformations can be performed on UTXO's, and, to your first point, any app that requires rapid and/or complex data transformation produces too much bloat, as each transformation ...
zhekson's user avatar
  • 3,669
1 vote

Tried minting from transition in StateMachine an got error MintingPolicyNotFound

I had this exact same issue with a StateMachine. I solved it by using runStepWith instead of runStep, which allows you to also supply the minting policy. See the haddock documentation for details on ...
Rohan Mitta's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible