Questions tagged [plutus]

A programming language based on Haskell used to write smart contracts on the Cardano blockchain.

159 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
2 answers
322 views

How can I get a fully built transaction from the PAB

According to the Plutus team, the standard way of generating signed transactions containing smart contracts is to have the off-chain code generate a so called unbalanced transaction that is then, in a ...
  • 1,419
6 votes
1 answer
112 views

Launch.json for VSCode/Haskell? Learning Haskell Plutus

I have VSCode all set up with the necessary Haskell plugins (except I have GHCI 9.x installed via Chocolatey and the plugins want 8.x, ouch! Unfortunately Chocolatey won't accept an 8.x "--...
6 votes
1 answer
285 views

Questioning Plutus API design decision

In Lecture 10 from the Plutus Pioneer Programm there is a replica of the Uniswap Smart Contract built on top of Plutus. It is actually part of the standard Plutus use cases Plutus Uniswap To have a ...
5 votes
4 answers
86 views

Boostraping a plutus Smart contract project

I'm trying to "play" with Plutus and write some smart contract for the sake of practicing and getting familiar with it. My problem is I don't know how to bootstrap a smart contract project. ...
  • 51
5 votes
0 answers
187 views

Plutus-Start for Windows - Cannot get the docker repository to run (A mount config is invalid.)

I am following : https://github.com/input-output-hk/plutus-starter I have downloaded VSCode and Docker. I downloaded the Remote Development extension in VSCode. I then ran "mkdir -p ~/.cabal/...
4 votes
1 answer
162 views

Script unlock cannot submit, budget overspent

I'm trying to unlock some token at a script address, so I create a tx with cardano-cli transaction build ... this passes successfully, then I sign the tx. It is now ready for submit but when I submit ...
4 votes
0 answers
126 views

Question about plutus-pab

I am trying to understand plutus-pab. I read in the documentation that PAB will give to a wallet an unsigned and unbalanced transaction, then the wallet will balance and sign it and then will send it ...
4 votes
0 answers
114 views

Invoking lock endpoint on the plutus-starter guessing game is giving me "endpoint not available" error

Using the nix-shell approach, I'm able to build and execute the plutus starter PAB project, which includes the guessing game contract. GIT repo link In a separate terminal window, I can run the GET ...
4 votes
0 answers
143 views

Using Plutus PAB for development instead of Playground

trying to migrate away from the playground and seems like PAB is the way to go. The plutus starter repository orignally seems to be the best place to start but it seems to be outdated (i.e. still ...
3 votes
0 answers
137 views

How to export a transaction from Plutus for the wallet

I have a contract that returns an unbalanced transaction: buyTokensTx :: forall w s. TokenPool -> BuyParams -> Contract w s Text (Either MkTxError UnbalancedTx) From what I understand, I need ...
  • 1,419
3 votes
0 answers
115 views

Is it possible to use a parameterised CurrencySymbol inside another validator script? Unsupported feature: Type constructor: GHC.Prim.ByteArray#

I am having trouble using a parameterised CurrencySymbol inside another validator script. It seems to work (not shown here) when the currency symbol is unparametrised but not otherwise: GHC Core to ...
  • 31
3 votes
2 answers
189 views

How to return funds from a smart contract

If I have assets (can be just ADA for simplicity) locked in a contract, how can I release the funds to the previous owners most efficiently? Some more context regarding the question. I created a pay ...
  • 1,527
3 votes
0 answers
55 views

PAB recovering from Errors

In the current version of the Plutus starter repo (commit a85818 which uses plutus-1.0.9), it seems difficult to know where to handle errors. For example, using the Game contract after initialization ...
3 votes
0 answers
48 views

Test for logError in Trace monad

How do I write a Tasty unit-test for an error that may be logged from inside the Trace monad? import Control.Monad.Freer.Extras (logError, throwError) trace1 :: Input -> Trace.EmulatorTrace () ...
  • 490
3 votes
0 answers
78 views

Specify balance during wallet creation in PAB simulator

Using the PAB Simulator from the plutus-starter (version 1.0.9, commit: a85818c27926f34d627225636f463cc6698706fc), I'm getting some odd behavior in terms of wallet creation. I've created a simple ...
  • 1,527
3 votes
1 answer
231 views

How to submit a script transaction using `cardano-cli`

I'm trying to go through the Alonzo Testnet exercises to get more familiar with the deployment process for Plutus contracts. I've gotten confused by the instructions in sheet 3: Download the pre-...
3 votes
1 answer
128 views

plutus-playground-server: user error (Error evaluating simulation: JsonDecodingError

I'm following the first lecture in the plutus pioneer program but I cannot set up the local environment. The error happens when running npm start on a nix-shell after initializing the playground ...
  • 91
2 votes
1 answer
125 views

InlineDatum on ReferenceOutput in OffChain code

I tried to use the inline datum of a reference input in the minting policy below: {-# INLINABLE validateMinting2 #-} validateMinting2 :: TxOutRef -> BuiltinData -> BuiltinData -> () ...
2 votes
0 answers
27 views

npm run start in plutus-playground-client creating npm errors

edit...I was able to get the plutus-playground-client working by using --force. How do I fix the monaco-editor dependency errors so I don't need to force it? Or do I even need to worry about it? I am ...
  • 121
2 votes
0 answers
40 views

Whats a Good Example of Interconnected Smart Contracts?

In the Contract Monad we have the use of w s e a. Now w is used to connect contracts is there a good example of how this is done, in particular how to validate a contract using the w of another ...
2 votes
0 answers
112 views

How to link custom API endpoints with Plutus script? (Without Blockfrost or PAB)

I have a few questions, which I think might interest a lot of folks here. Me and my team we are developing an app on Cardano and we want to avoid using PAB or Blockfrost for our infrastructure. We are ...
2 votes
0 answers
126 views

Building alonzo transaction using cardano-cli and signing it with serialization-lib

I created an API that based on a request builds the body of a transaction with cardano-cli and returns the cbor to the front-end. In the front-end, I'm using the cardano-serialization-lib to load the ...
  • 948
2 votes
0 answers
76 views

Issues running Chain-index on WSL2 - fully syncing but not running the webserver

I've run into an issue with the chain-index while trying to run a PAB testnet environment. The index will start up, sync to 100%, update to new blocks, but the webserver will never start. In fact, the ...
2 votes
0 answers
83 views

How to calculate fees in Plutus

Let's say I have an Ledger.Constraints.UnbalancedTx with consumed regular UTxOs, script UTxOs and minting scripts, how can I calculate the fees of this transaction in Plutus ? This function would ...
  • 1,419
2 votes
0 answers
22 views

Does plutus-pab support parallel requests?

Does plutus-pab support parallel requests to the same smart contract instance? Does plutus-pab support parallel requests to different smart contract instances? By parallel requests I mean calling ...
2 votes
0 answers
73 views

Balancing transactions with script inputs

Nami does not implement a function to balance an unbalanced transaction. Therefore, the Nami demo of the Plutus Github repository implements this step (as a temporary workaround) in the function ...
  • 1,419
2 votes
2 answers
295 views

What is the recommended way of implementing an NFT sale?

I'm pretty new to crypto development (I've been a professional software engineer for 5+ years now) and would like to get into NFT development using Cardano. Currently, I'd like to start a collab with ...
2 votes
0 answers
72 views

Prefund wallets for PAB

How does one prefund wallets for PAB (Plutus Application Backend)? I do not want to introduce minting code just for this purpose.
  • 490
2 votes
0 answers
116 views

Weird behavior on validation of outputs

So I have a validator that, in particular, checks how many outputs are produced. os = txInfoOutputs info mkValidator :: ... mkValidator = traceIfFalse "Wrong outputs" checkOutput where ...
2 votes
1 answer
99 views

How to get latest version of Plutus in project file of plutus-starter-devcontainer

I've been trying to get the latest version of plutus on my project but I get the following error message when I run nix-shell: error: attribute '8a20664f00d8f396920385947903761a9a897fe0' missing, at /...
  • 795
1 vote
0 answers
8 views

setup a Plutus project use haskell.nix Error on Mac M1

I'm trying to set up a Plutus project with flake on my Macbook by IOHK document I did the following steps: create default.nix enter command nix flake init --template templates#haskell-nix --impure ...
  • 11
1 vote
0 answers
11 views

Comparing VALUES in a smart contract. How to know if they will be normalized or not?

I need to make VALUES comparisons on chain. I realized that if a use the (==) operator from Plutus it is very inefficient in matter of memory and cpu steps needed to compute. (https://github.com/input-...
1 vote
1 answer
31 views

Can I access the epoch nonce from inside a Plutus script?

Is is possible to access the epoch nonce from your Plutus script, to use as a trusted source or randomness ? The only suggestion for on-chain randomness I have found, is using an RNG oracle. But the ...
  • 46
1 vote
1 answer
68 views

User error: Caused by: [ (builtin unConstrData) (con data #187b) ] while trying to unlock tokens from contract

hi I am getting this error while trying to unlock tokens from my treasury contract it is already topp up with tokens when trying to unlock with the access token doesn't know the exact reason behind ...
1 vote
0 answers
54 views

Plutus Playground WalletError: InsufficientFunds

I am running my smart contract on the plutus-playground and getting the error below: Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\&...
1 vote
0 answers
20 views

How to profile the budget usage of Plutus scripts

How to profile the budget usage of Plutus scripts https://plutus.readthedocs.io/en/latest/howtos/profiling-scripts.html?highlight=profiling Im struggling trying to follow the steps indicated in the ...
1 vote
0 answers
17 views

strange cabal build behaviour - won't detect changes to code file

This might have something to do with me working in a docker container, that is an ubuntu version of linux, with nix installed and plutus-starter cloned. I'm currently updating a plutus script I wrote ...
  • 229
1 vote
0 answers
58 views

TxOutRefNotFound when using Plutus.Contract.Wallet (getUnspentOutput)

I am trying to get a UTxO of the current wallet, use it to mint a token via the OneShotCurrency type, but I keep getting the following Error: (TxOutRefNotFound (TxOutRef {txOutRefId = ...
  • 1,088
1 vote
0 answers
25 views

How Will the Atala Plutus Integration Work?

I know that Atala prism will be used as the basis of Cardanos DiD but whenever I ask someone how it will work with Plutus, I end up hearing some new infrastructure needs to be built out. My question ...
1 vote
3 answers
94 views

How to convert Address type variable to get "addr_testXXX" format address?

In plutus endpoint, I want to convert Address type value to get addr_testXXX format address. I have try : import Cardano.Api ( SerialiseAddress (deserialiseAddress, serialiseAddress) ) ... -- here, ...
1 vote
0 answers
42 views

How to consume and produce new UTXO to same script with different Datum?

I am trying to consume old UTXO at stript and produce new one with new Datum. Validator is validating ok but not sure why new utxo with updated datum is not available. current utxos holds one utxo ...
  • 11
1 vote
0 answers
16 views

Why can't I use the same wallet more than once in Plutus Playground?

I'm currently testing my app in the "Plutus Playground" and the simulation will not let me call an endpoint from the same contract more than once. When I try to use the same wallet, the ...
1 vote
0 answers
23 views

When is Contract instance actually finished running?

I'm trying to write tests for my smart contracts. I want to test if my contract has finished running by using this predicate: -- | A 'TracePredicate' checking that the wallet's contract instance ...
1 vote
0 answers
29 views

How to Count plutus transactions?

i'm connected to the cardano-db-sync, someone knows how to count the ammout of transactions that use plutus script? i'm using two methods here select block.epoch_no, count(distinct tx.id) as ...
  • 11
1 vote
0 answers
33 views

How does the Fμω lambda calculus use C?

While poking around in the repositories I wondered how the sha2_256 algorithm was implemented in the PlutusTx module. I followed all the imports and got the following path The sha2_256 function in ...
  • 1,747
1 vote
0 answers
35 views

chain-index does not connect

I'm trying to run the cardano node, the cardano wallet and the chain index in three different docker images, but the chain index does not connect. The docker-compose file is below and the chain-index ...
1 vote
0 answers
69 views

Compatible Plutonomy cabal.project for plutus-apps

I want to use Plutonomy , but it only (currently) works with two Plutus versions as per https://github.com/well-typed/plutonomy#flags. How can I get a compatible cabal.project -- especially one that ...
  • 191
1 vote
0 answers
45 views

setting up the PAB - could not start the plutus-chain-index

I'm trying to follow the lesson 6 of iteration 3 of the plutus-pioneer-program when trying to start che chain index trough the command (fromn the plutus-apps repository) plutus-chain-index --config ./...
  • 666
1 vote
0 answers
67 views

Whats the Diffrance between Plutus scripts and Cardano Native Scripts?

What are the key differences between Cardano native scripts and Plutus scripts, from a developer's perspective?
1 vote
2 answers
65 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, ...
  • 383