Skip to main content

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
0 answers
7 views

redeeming from PlutusV3 script fails

This is the code of my smart contract. It basically requires exactly 3 reference inputs to pass validation. {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ...
Reeshav Acharya's user avatar
0 votes
0 answers
11 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
0 answers
7 views

nix-build for Pluto takes hours -- stills haven't finished

I have installed Nix 2.20.5 in my ubuntu 22.04.4, following Readme I ran nix-build in Pluto directory. It's taking several hours(>4) in building packages,not sure hong long it will need to finish ...
user1532146's user avatar
0 votes
0 answers
4 views

Find contents of a address from script context

I’m trying to find if a particular address submitting a transaction contains a NFT. Not necessarily the transaction itself but the address in general contains the NFT. I was looking at using ...
mrsargent's user avatar
  • 121
0 votes
0 answers
19 views

Minting and spending from the same script in a single transaction

I have a state NFT token locked in an hybrid script written in Aiken. I want to : spend this NFT state to the script itself ( with a new datum which stores the new issuance state ) mint tokens I want ...
regisg's user avatar
  • 191
1 vote
1 answer
41 views

Is there any way to check reward address value?

Smart contract should allow the reward withdrawal only if all rewards are withdrawn. In other words only if the reward address will have exactly 0 lovelaces after the reward withdrawal. Is there any ...
dmitry_stas's user avatar
0 votes
0 answers
22 views

Plutus-pioneer-progra cabal build error

when I built plutus-pioneer-program lecture week2, I got the error like this /root/.cabal/store/ghc-8.10.7/cardano-crypto-praos-2.1.0.0-6256b7c51bff5ecd7a4cd62d0cae080568903ed67a7b8424037c5be2d1c7a1d9/...
Jinn Zh's user avatar
0 votes
0 answers
19 views

ADA locked on Trust - 2 delegations*( only one should be active ) - Now cant claim & reflects 2 balances

Good afternoon all I recently unstaked or attempted to unstake ada & it looked as if it was going from 1 validator to another , my problem is everything is stuck now. I cannot claim , I cannot ...
STAKEDCRYPTODANO77's user avatar
0 votes
1 answer
36 views

Examples of open source production level DApps on Cardano?

I am looking for Cardano DApps which are: Actually deployed and used on mainnet Have published their source code (at least on-chain part) Examples of non-Plutus PL used (like Plutarch, Aiken, ...) ...
uhbif19's user avatar
  • 121
0 votes
0 answers
26 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
1 answer
24 views

Nix error trying to install correct GHC version for Plutus

As recommended by Haskell/Nix expert lan Burzynski, I'm trying to use Nix install the correct GHC version for Plutus as follows: nix shell nixpkgs#haskell.compiler.ghc8107BinaryMinimal nixpkgs#cabal-...
Eric's user avatar
  • 85
1 vote
0 answers
40 views

How to decouple Constr from Data

Imagine I have the following field in the Datum: { "fields": [ { "int": 3810998862 }, { "int": 18446744073709552000 ...
SR - cerra.io's user avatar
2 votes
1 answer
84 views

Loading specific Datum JSON with Map structure into Plutus type

We have a specific Datum, taken from Orcfax oracle UTXO: https://preprod.cexplorer.io/datum/9ced750ebbb2c9a9eac2e07a91525cadd3bfab23950089faa3e3a55517d1033f the part we are interested in is the very ...
SR - cerra.io's user avatar
0 votes
0 answers
31 views

In which cases Plutus compiler is producing expensive code?

I have heard a couple of times, that is hard to make Plutus produce non-costly code, and one should consider writing scripts on a level with Plutarch's help instead. Still, I never get real reasons ...
uhbif19's user avatar
  • 121
1 vote
1 answer
22 views

Asses Utxos Time In On-Chain Code

Can you assess the time a Utxo was created in on-chain code? i.e. A transaction to a smart contract that can claim only Utxos - in that contract address - sent in a specific time period?
user3755529's user avatar
1 vote
1 answer
24 views

Cabal build error when compiling simple Plutus code

From inside nix-shell, I run cabal build (after running cabal update) and I get the following error: Failed to build libsystemd-journal-1.4.5.0.0.0.0.1. Build log ( /home/eric/.cabal/logs/ghc-8.10.7/...
Eric's user avatar
  • 85
0 votes
2 answers
94 views

Validator always accepts and Mints (but it shouldn't)

Hey I have this simple stupid validator: validator { fn nft(datum: Datum, _redeemer: Void, context: ScriptContext) { let ScriptContext { transaction, purpose } = context when purpose is { ...
user9852's user avatar
0 votes
0 answers
100 views

I am getting error when using nix build command

when using following command nix --extra-experimental-features nix-command build -f default.nix plutus.haskell.pack ages.plutus-core.components.library getting following error error: could not set ...
krishna babu's user avatar
1 vote
1 answer
48 views

I am getting error while using "cabal build all" cmd

I am new to plutus. I am trying to learn plutus for which I am using "plutus-starter" code to begin. while using "cabal build" i am getting following error: Resolving dependencies.....
krishna babu's user avatar
0 votes
0 answers
26 views

division amount to multi cardano address

There is a way to split a Cardano address among several addresses, for example, deposit an amount to one address and divide it equally among the holders of 100 NFTs. thanks
Rf8's user avatar
  • 1
2 votes
1 answer
60 views

How to handle sensitive data in smart contracts?

I'm interested in creating an escrow smart contract using Plutus, where a seller stores an encryption key in the Datum and sells it for a price. The key should only be accessible to a buyer who pays ...
Markos Girgis's user avatar
0 votes
2 answers
127 views

Different types of Datums

I have a good understanding of the role of Datums in Cardano's Extended UTXO model, including their use in representing the state of a smart contract. However, I'm seeking further clarification on the ...
Markos Girgis's user avatar
1 vote
1 answer
19 views

Transfer funds to "heir" - Possible?

Is it possible to write a smart contract in cardano - without off-chain solutions - that would hold funds until a specified date (or block height), and if I didn't interact with that smart contract ...
Alfredo Casanova's user avatar
0 votes
0 answers
69 views

How to obtain the public key hash in on chain plutus validator?

It seems public key hash is generated from blake2b_224 but in on-chain validator we only have blake2b_256. Is there any way to obtain public key hash from public key in cardano plutus?
Ask-Plutus-Bot's user avatar
2 votes
2 answers
105 views

Adding stake credential to script address

I compiled my plutus script and generated a payment credential only address. The logic all working fine- no issues. However when I add a stake credential to my plutus script address, the logic starts ...
Styx's user avatar
  • 21
2 votes
2 answers
94 views

Javascript SDK for working with Plutus smart contracts

Are there any javascript SDKs which enable you to do the following: programmatically create and submit a Plutus smart contract to mainnet check what assets are currently locked at a given script ...
Myles's user avatar
  • 321
0 votes
1 answer
211 views

Error: encoding/hex: invalid byte: s When using Lucid calling payToContract

I am getting an issue when creating a Lucid transaction and calling payToContract I have created the datum and it is erroring on the line that converts this datum toHex With the following error: Error:...
David B's user avatar
  • 101
1 vote
1 answer
29 views

Need to add signatures to plutus-simple-model-transaction

Any idea how to sign a transaction with multiple keys in plutus-simple-model ?
Eric's user avatar
  • 85
3 votes
2 answers
448 views

Can a smart contract execute itself automatically?

I was wondering wether a smart contract can execute automatically or not. For example, let's say I have a vesting contract that, when a certain deadline passes, automatically executes and send some ...
ash's user avatar
  • 53
3 votes
2 answers
327 views

Which would be the future language for writing smart-contract?

As we might know well-known approaches for writing smart contracts on Cardano are using Plutus Tx or Marlowe based on specific requirements. However, according to the growth of the Cardano community, ...
manhdt's user avatar
  • 125
0 votes
0 answers
100 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
0 votes
1 answer
29 views

Why is writeToScript reporting that my script costs 0 resources?

I have the following minting script: {-# INLINABLE verify_mint #-} script :: () -> V2.ScriptContext -> Bool script () _ = (3::Integer) == 2+1 and the following off-chain code to mint a token: ...
Eric's user avatar
  • 85
0 votes
2 answers
81 views

playground-common package giving 'Failed to build scrypt-0.5.0' error

I'm trying to run my own little smart contract in the plutus-pioneer-program [fourth iteration] docker container and I'm having some problems. I've just added an extra folder alongside the other weeks....
NaeriKailash's user avatar
1 vote
1 answer
23 views

how to use ownPubKey and RedeemerType and DatumType

My code is here. {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ...
Anton Begas's user avatar
2 votes
1 answer
25 views

Expecting one more argument to ‘RedeemerType’

My code is here marketConstraints :: Market -> TxConstraints (RedeemerType -> ScriptContext -> Bool) (DatumType, ()) marketConstraints market = mustValidateIn (to $ scriptAddress market) I ...
Anton Begas's user avatar
1 vote
2 answers
163 views

Unable to build project using latest version of plutus-apps using nix develop

When I run cabal repl on my project using nix develop I get the following error: Warning: Requested index-state 2023-02-20T00:00:00Z is newer than 'hackage.haskell.org'! Falling back to older state (...
Eric's user avatar
  • 85
1 vote
0 answers
22 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
1 vote
4 answers
159 views

Is it possible to obtain the cbor hex/script bytes from a bech32 script address?

I would like to get the script bytes from the bech32 address of a script. Is this possible?
zaherr's user avatar
  • 21
1 vote
1 answer
37 views

Need to access documentation for Plutus.Contract.Oracle but not available in https://input-output-hk.github.io/plutus/master/

Playground is discontinued but the updated documentation seems to be lacking in components that I have been working with. I did try to look up the other versions they have listed in their gh-pages ...
Safi Ullah's user avatar
0 votes
1 answer
83 views

Limit the number for each Token (AssetName) within one Currency Symbol (Policy ID)

is there any way to limit number for each tokens within one minting policy, in Plutus validator? For example for policy ab12 I want to allow users minting tokens, in different transactions. Сan the ...
dmitry_stas's user avatar
1 vote
1 answer
256 views

How can I access Haddock documentation for Plutus?

The link to the Plutus documentation - https://playground.plutus.iohkdev.io/doc/haddock/ - is broken. Is there another way to browse the haddock documentation for the latest version of Plutus?
Eric's user avatar
  • 85
1 vote
0 answers
39 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 ...
nik's user avatar
  • 11
0 votes
1 answer
32 views

Unable to convert BuiltinString to JSON

I would like to include a BuiltinString in a datum but am unable to do so as BuiltinString has neither a FromJSON nor a ToJSON instance. Is there an alternative to implementing these instances by hand?...
Eric's user avatar
  • 85
1 vote
0 answers
16 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-...
Manu Padilla's user avatar
0 votes
1 answer
126 views

plutus-apps nix-shell on Mac M2 segmentation fault

I'm unable to run nix-shell on my new M2 Macbook. I read through the posts from last year on setting up M1 Macbooks with previous plutus-apps tags, but the same steps do not seem to work. Environment: ...
Woodland Pools's user avatar
0 votes
2 answers
62 views

Unable to deploy Plutus NFT Minting Policy parametrized by TxOutRef using cardano-cli

UPDATE: I'm making progress. It is apparent the TxOutRef stored on-chain has some extra-structure. For evidence I "printed" the TxOutRef's of the 'utxo' hard-wired in my minting policy and ...
a_juggler's user avatar
1 vote
1 answer
68 views

Overuse of resources when comparing for equality of VALUES (==)

I found an strange consumption of mem and CPU when comparting VALUES on-chain. If I do the same comparison with my own writing functions I found is more efficient. How could it be? Everything is ...
Manu Padilla's user avatar
0 votes
1 answer
80 views

Need to Retrieve Info from (NFT)Assets in Policy ID to see if they are in a Plutus Contract (smart contract) or Not using Blockfrost API

I have a python script that retrieves the NFT asset name, and addresses of a specific policy ID using blockfrost API. Now I need to amend the script to add to the csv whether or not the specific asset ...
dpd's user avatar
  • 3
0 votes
3 answers
140 views

"The second data argument, does not decode to a context" when minting NFT with Mesh

This my script for minting NFT: {-# INLINABLE mkPolicy #-} mkPolicy :: BuiltinData -> PlutusV2.ScriptContext -> Bool mkPolicy _ ctx = traceIfFalse "wrong amount minted" checkNFTAmount ...
Daniel Ng's user avatar
0 votes
1 answer
200 views

How to resolve this "(FromAlonzoUtxoFail (UtxosFailure (ValidationTagMismatch (IsValid True)" transaction submission error on mesh library

I am getting this error on transaction submission. ""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (...
duaa azhar's user avatar

1
2 3 4 5
13