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
1 answer
76 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
3 votes
1 answer
134 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
94 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
212 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
0 votes
1 answer
97 views

Data from Mesh to Plutus

I created this datum with Mesh const datumMD: Data = new Map<Data, Data>(); datumMD.set('name', assetName ); datumMD.set('question', input); datumMD.set('answers', []); datumMD.set('...
Kavvadias's user avatar
0 votes
1 answer
23 views

Converting a sum type to BuiltinByteString

I have a type defined as follows: data A = A1 | B2 | A3 deriving (Show, Eq) Is it possible to convert it to and from BuiltinByteString without explicitly having functions as such: ...
Aoaddeola's user avatar
  • 815
0 votes
1 answer
69 views

Error when executing nix-shell in plutus-apps

I am getting... error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override ...when trying to run nix-shell from plutus-apps repo. Does anybody know ...
Falcon Stakepool's user avatar
0 votes
1 answer
44 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
53 views

PlutusV2: Error when spending script output

This is how I spend script's utxos with the Emulator. This one from this example. grab :: forall w s e. AsContractError e => Contract w s e () grab = do utxos <- utxosAt scrAddress ...
Adam's user avatar
  • 343
0 votes
1 answer
65 views

Example/documentation of Reference Input (CIP31) and Inline Datum (CIP32) with Emulator?

I am finding an example implementation of Reference Input (CIP31) and Inline Datum (CIP32) and want to test it with the Plutus.Trace.Emulator. I see some answers like here talking about ...
Adam's user avatar
  • 343
0 votes
1 answer
27 views

Custom currency error: Cannot build the initial state: Tag "toCardanoPolicyId"

I try to set an initial state of the emulator like so: test :: IO () test = runEmulatorTraceIO' def emCfg myTrace where dist = Map.fromList [ (senderWallet, Ada.lovelaceValueOf 100_000_000) ...
Adam's user avatar
  • 343
0 votes
1 answer
77 views

E042:Error: Unsupported feature: Type constructor: GHC.Prim.Addr

Has anyone encountered such an issue? Validator works fine and cborHex is generated when "writeSerialisedScript" run in cabal's repl. But when building with cabal build app, the following ...
Aoaddeola's user avatar
  • 815
2 votes
2 answers
81 views

How to run a simple Fib function offline?

On Ethereum, I'm able to run and test a Fibonacci function by writing a Solidity smart-contract with a fib method, compiling to the EVM, deploying and running offline by using any EVM implementation, ...
MaiaVictor's user avatar
2 votes
1 answer
88 views

Getting the CurrencySymbol of PlutusV2 MintingPolicy

I'd like to get the CurrencySymbol of a PlutusV2 MintingPolicy. There's a function defined in Plutus.Script.Utils.Scripts with the following signature: scriptCurrencySymbol :: Versioned MintingPolicy -...
Aoaddeola's user avatar
  • 815
1 vote
1 answer
66 views

Unable to compile script

I'm stuck trying to compile my minting policy - getting the following error message: • Couldn't match type ‘Colony’ with ‘BuiltinData’ Expected type: template-haskell-2.16.0.0:Language....
Aoaddeola's user avatar
  • 815
0 votes
1 answer
60 views

Unable to attach two reference inputs to a transaction with Plutus Emulator

I have written a script that will fail unless it receives both oref1 and oref2 as reference inputs. I have the following emulator code: let rule = mempty <> C....
Eric's user avatar
  • 3
0 votes
2 answers
60 views

nix shell did not work in plutus-apps

I checkout to branch c2b310968d0915e2af0ea4680186b41ad88ffbe9 and run nix-shell at plutus-apps. No error, nothing change when I run nix-shell.I reinstalled nix, changed iohk-cache, reinstalled ubuntu. ...
Ming's user avatar
  • 1
0 votes
1 answer
63 views

Module `Ledger.Typed.Scripts' does not export `wrapValidator'

I try to compile code from Plutus Pioneer Program week 4. These lines cause error. typedValidator :: Scripts.TypedValidator Vesting typedValidator = Scripts.mkTypedValidator @Vesting $$(PlutusTx....
Adam's user avatar
  • 343
2 votes
2 answers
280 views

Nix-shell in plutus-apps

I'm using Ubuntu 20.04.5 with an 11th Gen Intel® Core™ i7-1195G7 @ 2.90GHz × 8. After cloning the plutus-apps repo and setting my nix config, i can't get pass the following nix-shell error: trace: To ...
tyvan266's user avatar
0 votes
1 answer
159 views

How can I interact with smart contract created from Marlowe in the testnet/mainnet?

I create a smart contract with Marlowe from https://play.marlowe-finance.io I now want to deploy the contract in the preview testnet and later mainnet. I imagine it must be somehow converted into ...
Adam's user avatar
  • 343
2 votes
1 answer
161 views

getDirectoryContents:openDirStream: does not exist

Running cabal update within nixos in my app fails with the following: $HOME/my-app/dist-newstyle/src/plutus-ap_-cbcc5c6ab544aad6/web-ghc: getDirectoryContents:openDirStream: does not exist (No such ...
Aoaddeola's user avatar
  • 815
0 votes
1 answer
50 views

Plutus: multiple-utxo withdraw fails, single-utxo withdraw succeeds

A beneficiary tries to withdraw the maximum amount from 2 utxo's of a smart contract in one transaction but that fails. If the beneficiary does it in two steps it succeeds. Why does the first one fail?...
wmoco_6725's user avatar
0 votes
0 answers
31 views

mustMintValueWithRedeemer - Number of tokens minted

On the Offchain code I am trying to mint a token using the following snippet Constraints.mustMintValueWithRedeemer r (assetClassValue cTk 1) In the validation code of the minting script I am trying ...
munx's user avatar
  • 13
0 votes
1 answer
54 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
0 votes
1 answer
29 views

Problems with HLS with some versions of Plutus Apps: INFO hie-bios: error: cannot lock ref 'refs/remotes/origin/599'

I need some help with this problem. With some version of Plutus Apps, HLS and VCode works perfect. But with some specific versions, like this one: commit cbc2df9e5d47d60505c28f321d75187d9ea85b07 (HEAD)...
Manu Padilla's user avatar
0 votes
0 answers
57 views

Error building in the latest Plutus Apps: Failed to build postgresql-libpq-0.9.4.3* Missing (or bad) C library: pq

Im having problems building my projects using the the latest plutus apps: commit 33c6e81ba4ab9cbb42870bbb6f916f8b4e2c7b3e (HEAD -> main) Starting postgresql-libpq-0.9.4.3 (all, legacy fallback) ...
Manu Padilla's user avatar
7 votes
0 answers
98 views

Developers are having dismal experience building on Cardano [closed]

When developers get into plutus playground, 10 out pf 10 expect it to work like remix, an IDE. You put a code in. You compile and deploy. And then start interacting with the dApp. All in the same ...
Adam's user avatar
  • 343
3 votes
1 answer
97 views

How To Verify The Code Of A SmartContract?

There's a lot of talk about open-source code on Cardano, but how can I verify that the SmartContract(s) in a git repo are the actual SmartContracts the project has deployed to the Blockchain? I want ...
KryptoKing's user avatar
10 votes
3 answers
336 views

How to properly start a new Plutus project, from scratch

I'm from ETH's ecosystem and recently just decided to get into Cardano development, specifically Plutus dev work thanks to Demeter.Run, and after going through the Plutus starters on there, I noticed ...
0xDaito's user avatar
  • 101
2 votes
1 answer
62 views

Which address types are allowed for collateral inputs

Collateral inputs are required to be added to a transaction when any Plutus script is executed within that tx (i.e. spending a Plutus address utxo or minting a Plutus policy asset). Obvious that a ...
Vantuz Subhuman's user avatar
1 vote
1 answer
47 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 ...
Leo's user avatar
  • 66
0 votes
1 answer
45 views

Plutus Emulator trace halting with MintingPolicyNotFoundError

I have the following simple minting script: {-# INLINABLE unrestricted #-} unrestricted :: () -> ScriptContext -> Bool unrestricted () _ = True unrestricted_policy :: MintingPolicy ...
Eric's user avatar
  • 3
1 vote
1 answer
140 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 ...
Hari Krishna's user avatar
2 votes
1 answer
113 views

Does it make sense to talk of reference script in the context of parameterized script?

In my understanding, if my script is parameterized, I would need to know the parameters to generate the script and then store it at an address to be later referred. But usually set of possible values ...
Sourabh's user avatar
  • 320
0 votes
1 answer
83 views

OffChain code for inline datum

I am trying to create a OffChain code for submitting inline datums. gTest :: forall w s. GrabParams -> PlutusContract.Contract w s DataText.Text () gTest GrabParams{..} = do PlutusContract....
munx's user avatar
  • 13
6 votes
2 answers
261 views

Chain Indexers with Stream Endpoints

I have been taking a look at different chain indexers (or APIs to indexers) to see what's available today and how they differ - see resource list below. Question I still wanted to raise the question, ...
Will's user avatar
  • 1,162
1 vote
2 answers
79 views

Is pure ADA put in a script address locked up forever?

I was trying out the 'always succeeds' script from the helios tutorial (https://github.com/Hyperion-BT/Helios/blob/main/doc/tutorial_03-always_succeeds.md) and made a mistake in the change address, so ...
wmoco_6725's user avatar
5 votes
5 answers
122 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. ...
pgrange's user avatar
  • 51
0 votes
1 answer
75 views

Failing Validation on Script Address

I am trying to unlock an NFT that I locked into a script address. The unlocking succeds when I have some basic validation rules but when I add the minterIsPaid rule below, the validitation ...
Skelli's user avatar
  • 327
0 votes
1 answer
107 views

Script Execution Failure PT8

I am trying to transact with UTxO from a script address on the pre-production testnet. I locked the fund ok with Datum, now I get an error when trying to consume that UTxO, it seem that the script is ...
user3755529's user avatar
1 vote
1 answer
377 views

Missing/ No Redeemer Error when spending 2 script outputs

I am getting the following error, when I try to submit a transaction that spends 2 script outputs: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [...
Will's user avatar
  • 1,162
2 votes
1 answer
155 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 -> () ...
CantTouchDis's user avatar
4 votes
3 answers
148 views

How do users interact with smart contract?

In plutus playground, there is an example called “Vesting”. In the simulation, users can interact with this smart contract by click on “vest fund” or “retrieve funds”. Now suppose that we compile this ...
Adam's user avatar
  • 343
0 votes
1 answer
46 views

Printing a plutus validators cborhex to a file

I was hoping to get some advice re printing a plutus validators cborhex to a file. Im kinda basing my logic off of an example in week03 in the pioneer program but need to make some adaptations. Below ...
NaeriKailash's user avatar
0 votes
1 answer
50 views

Use a parameterized currencySymbol within a Plutus Validator. Unsupported feature: Type constructor: GHC.Prim.ByteArray#

I have a minting policy which is parameterized by PaymentPubKeyHash and a script which checks that a token from that minting policy has been burned. The script also takes PaymentPubKeyHash as a ...
Rohan Mitta's user avatar
1 vote
1 answer
88 views

"plutusV2MintingPolicy" lookup not found by "balanceTx"

I am trying to mint some example tokens in offchain plutus code on tag v1.0.0-alpha1. This is the OffChain code I am currently using: mintFactoryToken :: Contract () MintFactorySchema Text () ...
CantTouchDis's user avatar
3 votes
2 answers
306 views

Plutus V2 Tx Building causing NonOutputSupplimentaryDatums error

I am stuck with this error, what's a NonOutputSupplimentaryDatums?: ""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (...
Will's user avatar
  • 1,162
0 votes
1 answer
31 views

Plutus Playground - mustPayToTheScript - unexpected char escapes - 0 converted to \NUL, 1 to \SOH

I am having trouble with the mustPayToTheScript function - I am getting this error Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\"...
NaeriKailash's user avatar

1
2
3 4 5
13