Questions tagged [plutus]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
12 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
  • 101
0 votes
0 answers
15 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
20 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
35 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
55 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
18 views

Is Plutus compiler backend producing code cheap enough for production purposes?

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
  • 101
1 vote
1 answer
19 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
12 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
70 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
50 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
0 votes
1 answer
29 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
24 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
54 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
69 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
48 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
60 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
73 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
91 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
22 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
414 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
0 votes
0 answers
21 views

TooMuchSpace error when running uplc profiling tool on simple minting policy

I have the following minting policy: {-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:profile-all #-} {-# INLINABLE verify_mint #-} verify_mint :: () -> V2.ScriptContext -> Bool verify_mint () _ = ...
Eric's user avatar
  • 85
3 votes
2 answers
268 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
77 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
26 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
70 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
0 votes
1 answer
18 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
21 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
147 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
20 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
109 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
0 votes
0 answers
7 views

Reference to a name which is not a local

I'm trying to run unsafeFromBuiltinData against the following type used as redeemer: data TypeA= A PaymentPubKeyHash | B PaymentPubKeyHash deriving (Show, P.Eq) ...
Aoaddeola's user avatar
  • 815
1 vote
1 answer
36 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
0 answers
21 views

Does someone know how to integrate the plutus docs snippets on Sublime text?

I want to integrate the plutus docs provided in the ppp, which is initialized this way: python3 -m http.server -d ../plutus-pioneer-program/docs/plutus-docs/haddock I already installed the LSP(...
ash's user avatar
  • 53
0 votes
1 answer
78 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
190 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
33 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
29 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
14 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
111 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
60 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
65 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
59 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
112 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
156 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 vote
1 answer
64 views

Error when trying to build my Plutus project

I am getting the following error after trying to execute cabal build: cabal: Could not resolve dependencies: [__0] next goal: cardano-crypto-class (user goal) [__0] rejecting: cardano-crypto-class-2.0....
Falcon Stakepool's user avatar
2 votes
1 answer
115 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
26 views

How can an endpoint receive multiple argument?

How can add multiple arguments on a certain endpoint? How can I add more arguments to “start” function? Like “start x y” or “start x y z”? {-# LANGUAGE ImportQualifiedPost #-} {-# LANGUAGE DataKinds ...
professor moriarty's user avatar
0 votes
2 answers
71 views

How to generate CBOR hex of plutus smart contract

How can i generate the CBOR hex of a plutus smart contract. Does it requires to generate CBOR of onchain code only or both onchain and offchain? Also if have a smart contract which requires parameters ...
duaa azhar's user avatar
1 vote
1 answer
168 views

How to deploy the Plutus smart contract

I am following Plutus-pioneer-program to learn smart contract development in Cardano. I have tried the onchain and offchain code, compiled and tested in Plutus playground and also in emulator trace. ...
duaa azhar's user avatar

1
2 3 4 5
13