Questions tagged [statemachines]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

How to make the ThreadToken for a StateMachine available to and verifiable by every participant?

In a StateMachine, TreadToken can be used for uniquely identifying the "genuine" UTxO sitting at the validator script of the StateMachine. A TreadToken is automatically created when the ...
user avatar
  • 39
0 votes
0 answers
3 views

StateMachine smTransition type signature

In the State Machine, the smTransition function has the following type signature: smTransition :: State s -> i -> Maybe (TxConstraints Void Void, State s) The TxConstraints Void Void is ...
user avatar
  • 39
0 votes
1 answer
17 views

Is it possible to upgrade a State Machine?

I wonder if it is possible to design a State Machine that has a special state transition that can upgrade the State Machine, meaning creating a new UTxO sitting at a new script address (instead of the ...
user avatar
  • 39
0 votes
0 answers
10 views

Is it possible to mint and burn tokens using State Machine

In a use case I am considering, it requires some (not all) state transitions to mint some native tokens and some other state transitions to burn the native tokens. Taking into consideration of this ...
user avatar
  • 39
1 vote
1 answer
21 views

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

Some validator scripts can be implemented with or without state machine. This is a decision that has to be made by the developer. I wonder what are the pros and cons of using state machine. What ...
user avatar
  • 39
0 votes
2 answers
40 views

StateMachines on Testnet : How to step a client?

I want to run a statemachine on testnet. The SM runs in the emulator, and I can initialize on testnet, but if I try to make a new client it throws an error. The error comes from transition failure, ...
user avatar
  • 333
0 votes
0 answers
21 views

How does ThreadToken work in State Machines?

Quick question on Week07. Can someone explain how the NFT token minting/burning is handled by the State machine exactly? Also, in the conditions of the transition function, looks like nftToFirst is ...
user avatar
1 vote
1 answer
32 views

passing the thread token

In the firstGame function, we use the "logging" component of the contract to tell the thread token. It's not obvious to me where this is needed: is there an internal check in the runStep ...
user avatar
1 vote
1 answer
62 views

Get public key into PubKeyHash and use it in mustBeSignedBy

A user provides me with his wallet pub key as BultinByteString (or Haskell string, fine either way). From that, I need to get the PubKeyHash, but I am not sure how to hash it or if I need to hash it ...
user avatar
0 votes
0 answers
28 views

Referencing between scripts and application to state machines

(This is not related to CIP-33.) I want a validator to ensure another validator is also run. Naively I could construct one, get the hash, and hard code it into the other. Presumably two validators can'...
user avatar
  • 333
1 vote
1 answer
38 views

StateMachine - keep the same value for the next state

I work with the StateMachine library, and I need to transition from state to another where the stateValue of the State is exactly the same. The problem is that when I try to do the transition, I get ...
user avatar
1 vote
0 answers
66 views

How to use the plutus pab statemachine with RemoteWalletConfig for Nami and Yoroi

Looking at the demo contract provided in the plutus-apps folder, you can follow the example of the PayToWallet endpoint. In this endpoint, yieldUnbalancedTx provides the instance with an unbalanced TX....
user avatar
1 vote
1 answer
41 views

How to create a smart contract constant variable?

I am using state machines to create a smart contract. How can I create a variable that will be defined by the user when it runs the first step of the state machine and that then can't be modified ...
user avatar
  • 274
3 votes
0 answers
40 views

How to mint mint NFT with StateMachine

I would like to mint an NFT in a particular state of the state machine Does anyone know where I can find some examples?
user avatar
0 votes
1 answer
217 views

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

I have been looking into creating a blackjack game on the Cardano Blockchain. I started with learning Haskell, and writing a simple blackjack CLI game. It was heaps of fun and a bit of a learning ...
user avatar
2 votes
0 answers
27 views

How to reuse data when updating Token using StateMachine

I'm currently creating a social network-like Dapp on plutus, and I've come across something I don't understand. My Dapp, for example, is NFT(for own identity)->RFT(for sell own content)->NFT(for ...
user avatar
0 votes
0 answers
45 views

Tried minting from transition in StateMachine an got error MintingPolicyNotFound

I changed transition function in Lecture 7 and added constraint for minting Constraints.mustMintValue: transition ts s r = case (stateValue s, stateData s, r) of (v, _, SetPrice p) | p >= 0 ...
user avatar
  • 369
1 vote
2 answers
50 views

StateMachine validation failing

Transition function throws an error. Here it is. transition :: FreelanceContract -> State FContractDatum -> FContractRedeemer -> Maybe (TxConstraints Void Void, State FContractDatum) ...
user avatar
0 votes
0 answers
20 views

Question about the behavior of Ogmios chain sync protocol

I have two questions about Ogmios local chain sync protocol's RollBackward message https://ogmios.dev/mini-protocols/local-chain-sync/ 1. When RollBackward is being sent, is the cursor automatically ...
user avatar
  • 45
2 votes
1 answer
49 views

Constraints.mustValidateIn in a StateMachine

I have an issue with Constraints.mustValidateIn in a StateMachine. In the case using Interval.to deadline everything works as expected. But in the case: Interval.from deadline the constraint is never ...
user avatar
  • 56
2 votes
1 answer
49 views

How does smCheck work?

In the PPP lecture 7 state machines are introduced. They are used to make the guessing game more concise. One of the situations is where the first player has won and needs to prove their guess by ...
user avatar