Questions tagged [plutus]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
171 views

cardano-serialization-lib ExUnits

I am new to Cardano and Plutus. I was trying to build a transaction that redeems a UTxO from the alwayssucceeds contract on Cardano Testnet. The Redeemer object constructor takes ExUnits as one of the ...
0 votes
1 answer
24 views

Is there training offered for those interested in being moderators?

Is there training offered for being a moderator? I would love to be one of them. I like learning and helping too.
0 votes
2 answers
57 views

How to hardcode smart contract address in minting policy in Plutus?

1st way I tried to do it was to get validator address using this function: {-# INLINABLE scriptAddress #-} -- | The address that should be used by a transaction output locked by the given validator ...
  • 168
0 votes
1 answer
56 views

Cardano transaction builder library in Haskell

Is there a way besides cardano-cli that I can use to construct a transaction using Haskell? Something like Lucid-cardano npm package, but in Haskell land? Said library should allow me to construct a ...
  • 421
0 votes
2 answers
40 views

Deploying smart-contract

I'm have really trouble finding material that teach how to deploy a contract. Does someone here has already successfully deployed a smart-contract to the cardano test/mainnet? I need to know the steps!...
4 votes
5 answers
419 views

Smart contract is not working after Vasil Hardfork in testnet

My smart contracts deployed in testnet stoped working after the Vasil Hardfork. i get this error: ""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [...
1 vote
2 answers
94 views

How Does the Blockchain Use Hashes?

Hash functions are often called one way functions however this means that you should not be able to undo them. So why and how are SHA256 and SHA512 used in blockchains if they should be irreversible. ...
0 votes
0 answers
112 views

Mint Nft With Plutus Script By NamiWallet

I am writing an DAPP to mint NFT with nami wallet. Currently, I can mint NFT with Nami by using Native script and function add_mint_asset_and_output_min_required_coin. But is there any way I can mint ...
4 votes
2 answers
131 views

Why not just simply use Haskell instead of Plutus?

I can think of two major reasons as to why Cardano chose a strongly-typed functional language for it's Blockchain: Strongly-typed - because as the capabilities of the Blockchain and scripts become ...
  • 488
0 votes
0 answers
25 views

How to Integrate Urbit Stack and Cardano?

I recently got started with the (https://urbit.org/using/os/shell) Urbit network and like some of its ideas around privacy. My question is to what degree can Urbit be combined with Cardano and which ...
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
1 answer
98 views

How Do You Convert Math Symbols in Haskell?

So i heard you can use denotational semantics to write Haskell code using math notation for example circle in place of . to denote function composition. My question is in four parts: how do I use/...
1 vote
2 answers
129 views

Plutus V2 Primitives

Does any have (or has anyone found) a simple summary of Plutus V2 Primitives? They made the short list of big changes in the Vasil fork announcement, so they seem important. Other than just reading ...
3 votes
2 answers
64 views

What is Type Safety?

In the Haskell programming language there are a number of concepts that must be understood by anyone wishing to learn and use the maximum potential of the language. One of these what is is type safety....
0 votes
1 answer
60 views

How to store scripts using blockfrost?

Greeting! I got that Blockfrost has API to get plutus script hash but how to store those scripts hashes? P.S. if I got script hash, can I build and send transaction using script's hash and Blockfrost?
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, ...
3 votes
1 answer
132 views

How To Convert Old Plutus Scripts to Vasil Reference Scripts?

One of the fun things, the Vasil hardfork gives us is the ability to reduce the size of transactions and so put more of them into a block (speeding up the chain). My question is how to change the ...
1 vote
1 answer
96 views

How to reduce tx size using typed Plutus script with Vasil fork PlutusV2?

With the recent Vasil fork script references allow to reduce transaction size. Even though Vasil has been already launched on the testnet I could not find information on how to reduce the size of ...
2 votes
1 answer
71 views

How to create an unspent UTXO with specific value

I want to create a script (smart-contract) utxo with a specific number of tokens (it can be an output of a transaction before) in cardano-serialization-lib - javascript. I need this utxo to be part of ...
  • 91
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
0 votes
1 answer
62 views

Cannot wrap my head on NFTs

I am running through the Plutus Pioneer Program and I have reached week 5. Also as a reference, I will use the LobsterChallenge repository. I am a bit confused about how NFTs work for the Cardano ...
0 votes
1 answer
47 views

Is there a way to see which Plutus code is deployed on a specific script address?

On Ethereum, for example, there is a way to see the Solidity code that is deployed in a specific address (as long as the code gets verified). Is there a way to achieve this same behaviour in Cardano?
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
1 answer
102 views

What is this Pop Up Screen on Cardano Documentation?

When searching the docs it helps to use ctrl + F to find something fast, however, when I use it on the plutus docs I get a weird pop-up screen I'm not used to. (Image Below) My Questions are: What is ...
1 vote
1 answer
48 views

Is possible to create a cNFT that depends on 'proof of ownership' in order to be own by a wallet?

I'm thinking on a way to create a cNFT that requires 'proof of ownership' to be minted and own by a wallet, by proof of ownership I refer to something the receipt owns and can pass to others or loss, ...
  • 113
0 votes
1 answer
17 views

Where Do I Go To Find All The ScriptContexts Feilds and Functions?

Hi im getting lost in the documentation, I have found some things I was looking for but am failing to find the info and functions for script contents. Im using this link https://playground.plutus....
1 vote
1 answer
46 views

How does valuePaidTo work?

How does valuePaidTo work ? Does it give the value paid by the script to the pubkeyhash or is it the total value of the pubkeyhash for the pending transactions ? Consider the following TxOut txOutputs ...
  • 13
0 votes
2 answers
60 views

How to get transaction info of a public key hash in a plutus smart contract?

Given a PubKeyHash (pkh) how can I get the history of that pkh's transactions from within a plutus smart contract?
0 votes
0 answers
22 views

How can I make a minting contract that never closes?

I am trying to change some old contracts to take advantage of the reference scripts coming whenever vasil comes out. How can I make a contract that will mint new coins upon activation, I'm talking ...
1 vote
1 answer
22 views

Do I Need A Contract Monad For a Burn Wallet?

If I make a script address to be a burn address, I end up having a validator that never validates i.e. returns false all the time. Does a Smart Contract that never can validate need an instance of the ...
1 vote
1 answer
51 views

How do I test my smart-contract on Cardano

I'm from EVM background and I've started learning about Cardano lately. I was just wondering how do I write unit tests for my smart-contract written in Haskell? Since i've been doing unit testing in ...
0 votes
1 answer
37 views

How To Get Transaction Royalityies on Fungable Tokens

I want to make a fungible token (FT) that has a royalty attached (N%). The problem is UTxOs are purely passive so how can I get my N% of the transaction value on P2P transactions using code is law. To ...
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 ...
0 votes
0 answers
29 views

guess game stuck in "Waiting for script to have a UTxO of at least 1 lovelace"

I have this program which uses the guessGame example, in the testnet, which gets stuck at "Waiting for script to have a UTxO of at least 1 lovelace" when executing "guess": main=...
2 votes
2 answers
52 views

Whats Your Mental Model For Monads?

I was asked by a friend trying to learn plutus what a monad was, so I began talking about category theory. It seems that this confused him further how would you explain monads to a noob? Whats your ...
0 votes
2 answers
50 views

What's the difference between these two TxOut?

Applying the functions (1) findOwnInput and (2) getContinuingOutputs in a context both return TxOut. What is the difference between these two TxOut?
0 votes
2 answers
58 views

How Can You Prevent A Burn Address From Polluting The Cardano Ledger?

Making a Burn Address on the blockchain is currently done by using a script address with a validator that always returns False and so never validates. This ties up ADA and causes the size of the ...
4 votes
1 answer
73 views

Referencing (U)TxO's

When Vasil HF is here with the new plutus version, can we only reference unspent transaction outputs or even spent ones? Is there some documentation on these newly added functions? Preferably haddock ...
  • 1,737
2 votes
1 answer
49 views

How to Make Sure A Contract Is Signed By a Certain Party?

I'm thinking about making a parameterised contract between two users. User A can be anyone i.e. any customer, But User B should always be the company. I want to make it so that the validator only ...
0 votes
1 answer
110 views

How do I add the staking part of an address in OffChain code

I am currently on tag: v2022-04-06 of plutus-apps and was wondering how to create Lookup and Constraints for a typedValidator that checks whether the input was returned to the script with the correct ...
0 votes
1 answer
72 views

Using `curSymbol` function in Validator script

supposed I have a mintingpolicy script (simple one time minting policy, parameterizing TxOutRef) and a validator script. I want to validate if the token with correct CurrencySymbol is spent in a ...
0 votes
1 answer
52 views

How to do on-chain Integer pattern matching?

I want to do Integer pattern matching on-chain but always get an error: GHC Core to PLC plugin: E042:Error: Unsupported feature: Use of Haskell Integer equality, possibly via the Haskell Eq typeclass ...
  • 1,088
0 votes
1 answer
86 views

Can't create ```TokenName``` using ```tokenName``` with error ```GHC Core to PLC plugin: E042:Error: Unsupported feature: ...```

I'm not sure is relevant but the code in question is for a generic Validator (with Datums and Redeemers) used to get a forwarded minting policy the problem should be clear from the title, I can't get ...
  • 666
1 vote
1 answer
52 views

"'Inputs do not conform to this spec or are otherwise invalid.'" - extract balance from smart contract

I'm implementing a smart-contract in Plutus and I'm with a doubt. For example, Ethereum has some function only to owners, that enables to implement a withdraw of balance for only owner addresses. I ...
  • 91
1 vote
1 answer
85 views

CNFT metadata structure

So I am working on a NFT minting and I checked the CIP-25 for metadata descriptions and I am confused regarding the naming of the NFT. What is really the name of the NFT? (as in recognized by JPG....
  • 472
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 ...
0 votes
1 answer
40 views

Plutus: how to obtain wallet details. Do I have to use the wallet web interface or there is some direct library call?

I need to know the amount of Ada remaining in an account in a off-chain Haskell plutus program. Should I use the wallet web interface of the kind: http://localhost:8090/v2/wallets/$WALLET_ID or there ...
0 votes
3 answers
100 views

How to compare BuiltinByteStrings onchain?

I want to check on-chain if a given TokenName is of a specific pattern, for example: aaa1 aaa2 aaa3 I have something like this, but it throws an interpreter exception: checkValidMint :: TokenName -&...
  • 1,088
0 votes
1 answer
25 views

Do I need to validate for minADAUTxO output in Smart Contract validator?

I have a spending validator that currently expects an output with an NFT to be recreated at its own address. Is it necessary to also include a check whether the output's value has a greater equal ADA ...
  • 1,088
1 vote
1 answer
53 views

Where does the PAB run?

I understand that PAB is a backend that: provides a standardized environment in which Plutus applications run provides disciplined state management presents discoverable interfaces to the external ...

1 2
3
4 5
13