Skip to main content

Questions tagged [plutustx]

The tag has no usage guidance.

0 votes
0 answers
13 views

Plutus Relese 1.21.0.0 is causing AlwaysPass validator to fail

I recently updated my project to plutus tag-1.21.0.0 for a minting contract, the validator is: {-# INLINEABLE mkValidator #-} mkValidator :: MintScriptParameter -> MintRedeemer -> ScriptContext -...
Reeshav Acharya's user avatar
0 votes
2 answers
36 views

Plutus-tx on XEON v2

I am trying to compile plutus script on 'Intel(R) Xeon(R) CPU E5-2680 v2' machine. I initialized nix flake from input-output-hk/iogx haskell template (tried with ghc96 and ghc92), entered development ...
amakarov's user avatar
  • 101
0 votes
0 answers
29 views

How to analyze the Plutus budget usage?

When I run my minting policy script I get the error Command failed: transaction build Error: The following scripts have execution failures: the script for policyId 0 (in the order of the PolicyIds) ...
dmitry_stas's user avatar
0 votes
0 answers
107 views

Tx consuming script fails with: Caused by: (unConstrData #44000de140)... Third data argument, does not decode to a context when burning an NFT

I've this tx trying to submit to cardano-node 1.35.5: ...
leobelizquierdo's user avatar
1 vote
0 answers
24 views

PlutusTx TxInfo Type Mismatch

I am building a PlutusTx V1 Smart Contract for NFT Royalty distribution. Part of that requires totaling up the amount of Lovelace sent to the contract from the most recent tx. I came up with the ...
theArchitect's user avatar
3 votes
1 answer
137 views

Unclear error during Plutus ScriptContext construction (force headList [])

I ran into an error while trying to autobalance a transaction body: module Foo.Offchain where import Plutus.V1.Ledger.Scripts (MintingPolicy) import Plutus.V1.Ledger.Address (Address) import Hydra....
SwiftlyUnmoving's user avatar
0 votes
1 answer
45 views

Submit transactions to the blockchain in Plutus

Currently my workflow is like this: write a validator script in Plutus test the script in by creating functions/endpoints to submit transactions to Plutus.Trace (Emulator) if the test goes well, I ...
Adam's user avatar
  • 343
0 votes
1 answer
29 views

suppress errors in trace emulator

I would like to suppress this error. How can I do that ? Slot 00013: *** CONTRACT LOG: "PassingTest [TEST_TAG:3] -- caught error: WalletContractError (ValidationError (ScriptFailure (...
munx's user avatar
  • 13
0 votes
1 answer
55 views

Can't use PlutusTx.Foldable from other module

I want to write a PlutusTx validator which just checks if a transaction was signed by one of the whitelisted public keys. This would be a first, naiive implementation: -- | The whitelist used by '...
Sebastian Nagel's user avatar
1 vote
2 answers
339 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 ...
Tetiana Diachenko's user avatar
1 vote
1 answer
68 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 ...
munx's user avatar
  • 13
1 vote
0 answers
36 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 ...
Fermat's user avatar
  • 1,872
2 votes
1 answer
92 views

Is it possible to not compile data constructors with plutus-tx?

I'm having a newtype VerificationKey = HydraVerificationKey (VerKeyDSIGN Ed25519DSIGN) and I would love to be able to use that type directly in our plutus scripts. While I can implement PlutusTx....
Sebastian Nagel's user avatar
0 votes
1 answer
265 views

Plutus transaction error PT5

I am building a transaction where I use the following function to make my datum and redeemer, writeJSON :: PlutusTx.ToData a => FilePath -> a -> IO () writeJSON file = LBS.writeFile file . ...
Fermat's user avatar
  • 1,872
2 votes
1 answer
89 views

How expressive & secure is the Plutarch eDSL?

The Plutarch eDSL tries to control how plutus core is generated to create a smaller and thus a more efficient validator script (their GitHub). I am not an in depth user of this tool. Does its approach ...
Fermat's user avatar
  • 1,872
2 votes
2 answers
108 views

can't understand which part of the code is not "PlutusTx"

I'm trying to write a very simple NFT minting policy myself and I can't get rid of the following error Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a ...
Michele Nuzzi's user avatar
2 votes
3 answers
236 views

How to get a base 16 hex BuiltinString from getTxId

I am trying to find a way to inspect the base16 hash from a Tx on-chain using plutus. I get a BuiltinByteString from the txInputs here: getTxIdBBS :: TxInInfo -> BuiltinByteString getTxIdBBS txInfo'...
lley154's user avatar
  • 297
1 vote
1 answer
52 views

Difference between `PlutusTx.TH.compile` and `PlutusTx.compile`?

I've been reading the official Plutus docs and saw that in the explanation about Template Haskell, there is information about PlutusTx.TH.compile, to use it for producing the quoted Plutus Core ...
Piotr N.'s user avatar
2 votes
1 answer
131 views

Understand purpose of tx-out-datum-hash in Lars' lobster NFT minting example

When the Alonzo era started on mainnet, Lars deployed a smart contract example, in which he minted a lobster NFT as part of a lobster naming challenge. In the policy script used to mint the lobster ...
Kurt Hartmann's user avatar
3 votes
1 answer
789 views

What are the benefits of using Plutarch?

Is Plutarch a good replacement for Plutus Tx? https://github.com/Plutonomicon/plutarch/blob/master/docs/GUIDE.md
Attilah's user avatar
  • 381
1 vote
1 answer
108 views

Confusion regarding findOwnInput function with on-chain code

Context I was looking for a simple way to get exact TxOut on on-chain code to validate if funds are to be unlocked to correct wallet address. While looking in plutus haddoc I have found this function: ...
KugisMugis's user avatar
1 vote
1 answer
83 views

Cannot compile parameterized mintingPolicy to Plutus

I tried compiling a solution from the examples provided in PPP Iteration #2 but got stuck. Any ideas? Code: https://github.com/ILIYANGERMANOV/cardano-smart-contracts/blob/main/ivy-token/src/MintIvy.hs ...
Iliyan's user avatar
  • 13
0 votes
0 answers
36 views

"No unfolding" error in Visual Studio Code

I copied the Plutus starter template, Plutus Platform starter project, and created a file, BasicPlutusTx.hs (and added it under exposed-modules in the .cabal file). Then I started copying over all the ...
dspyz's user avatar
  • 123
1 vote
1 answer
18 views

How do I run doctests?

I copied the plutus-starter template: https://github.com/input-output-hk/plutus-starter and created a file BasicPlutusTx.hs (and added it under exposed-modules in the .cabal file). Then I started ...
dspyz's user avatar
  • 123
4 votes
1 answer
148 views

How to calculate fees for Plutus Smart Contract?

How can someone calculate fee for executing Plutus smart contract given that they know CPU and Memory Units required for executing Plutus Script?
pyropy's user avatar
  • 641
3 votes
1 answer
164 views

How can I secure a Datum value in a smart contract?

I am trying to figure out how to write a script where you can make sure the datum value doesn't change each time an output gets consumed. For example, in the auction script in the pioneer program each ...
noone392's user avatar
  • 263
3 votes
2 answers
530 views

What exactly is the script context in Plutus context?

I believe the best way to answer this question would be to give examples of the type of information that the script context could contain.
FTM's user avatar
  • 294
1 vote
1 answer
83 views

Is it possible to have an On-chain Set data structure?

As the title of the question says, is it possible for me to use a Set data structure for the Datum and/or Redeemer?
Attilah's user avatar
  • 381
3 votes
1 answer
125 views

Canonical example of Smart Contract Verification?

Given that the chief benefit of Cardano Smart Contracts over Ethereum Smart Contracts is formal verification (and thus its implied validity, security, and robustness), is there a non-trivial example ...
Michael Daconta's user avatar
2 votes
1 answer
300 views

String in Datum

I want to use String or Text in a Datum, like this: import PlutusTx.Prelude newtype MyDatum = MyDatum {userReadableStuff :: BuiltinString} PlutusTx.unstableMakeIsData ''MyDatum but the complier ...
Kwaggy's user avatar
  • 400
3 votes
1 answer
219 views

Couldn't match expected type ‘BuiltinData’ in locally run playground

Working through the Plutus Pioneer Week2 homework and getting the following error in the locally served playground. error: • Couldn't match expected type ‘BuiltinData’ with ...
alanionita's user avatar
1 vote
1 answer
38 views

Are Validators pretending transaction already completed?

A validator is called prior to transaction's start (not to mention completion). But yet a validator routinely checks if a potential recipient has already received his funds, and other such tests about ...
Kwaggy's user avatar
  • 400
3 votes
1 answer
170 views

Constraints.mustPayToPubKey requires txSignedBy?

For a contract, I want to use Constraints.mustPayToPubKey for an arbitrary pubKeyHash (pkh), such as a lucky winner in a lottery. Question: Does the validator need to check that the transaction sees ...
Kwaggy's user avatar
  • 400
4 votes
2 answers
172 views

(Lecture #6 It #2 - Core.Hs) : Explaining lookups use of both typedValidatorLookups and otherScript?

Can somebody explain these lines and why (both) Constraints.typedValidatorLookups... and Constraints.otherScript... are used? Still struggling to get my head around lookups, so maybe that is why I'm ...
ZachSweet's user avatar
  • 178
7 votes
1 answer
302 views

How does `submitTxConstraintsWith` make usage of the ScriptLookups?

submitTxConstraintsWith :: ScriptLookups a -> TxConstraints (RedeemerType a) (DatumType a) -> Contract w s e Tx How does submitTxConstraintsWith make usage of the ScriptLookups? I always see it ...
Attilah's user avatar
  • 381
1 vote
1 answer
201 views

Is there any eth_sign equivalent signing method in plutus?

I want to use my private key to sign a message, and submit the message and signatures to third party server, the third party server can verify that signatures through plutus smartcontract. In ethereum ...
mackie's user avatar
  • 343
5 votes
1 answer
421 views

What does @ prefix means?

like this: auctionInstance = Scripts.validator @Auctioning and Hello-world app from https://playground.plutus.iohkdev.io/tutorial/tutorials/plutus-playground.html#running-the-hello-world-app hello = ...
mackie's user avatar
  • 343
3 votes
2 answers
90 views

plutus pioneer week01 src code explain

I'm a little confused about the following code(from EnglishAuction.hs): auctionInstance :: Scripts.ScriptInstance Auctioning auctionInstance = Scripts.validator @Auctioning $$(PlutusTx.compile [|| ...
mackie's user avatar
  • 343
4 votes
1 answer
249 views

Writing basic validator scripts

I need someone to explain to me line by line. The code is from plutu tutorials. https://docs.cardano.org/projects/plutus/en/latest/plutus/tutorials/basic-validators.html All the code in that page I ...
mackie's user avatar
  • 343
13 votes
1 answer
324 views

How do I build a debug configuration of a Plutus project?

When I try to set a breakpoint in a small Plutus project such as this, I always get the following error: :b Week05.Homework1.mkPolicy cannot set breakpoint on Week05.Homework1.mkPolicy: module Week05....
thebrandre's user avatar