Skip to main content

Questions tagged [statemachines]

Filter by
Sorted by
Tagged with
0 votes
1 answer
47 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 ...
3 votes
1 answer
77 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 ...
1 vote
2 answers
76 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, ...
3 votes
2 answers
282 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 ...
4 votes
1 answer
67 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?
0 votes
1 answer
73 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 ...
1 vote
1 answer
57 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 ...
1 vote
1 answer
56 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'...
0 votes
1 answer
39 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 ...
2 votes
1 answer
42 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 ...
1 vote
1 answer
58 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 ...
1 vote
1 answer
319 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 ...
1 vote
1 answer
47 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 ...
1 vote
0 answers
99 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....
2 votes
0 answers
31 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 ...
1 vote
2 answers
52 views

StateMachine validation failing

Transition function throws an error. Here it is. transition :: FreelanceContract -> State FContractDatum -> FContractRedeemer -> Maybe (TxConstraints Void Void, State FContractDatum) ...
1 vote
1 answer
64 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 ...