Questions tagged [plutus]
A programming language based on Haskell used to write smart contracts on the Cardano blockchain.
642
questions
0
votes
1
answer
66
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 ...
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)
...
0
votes
1
answer
79
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 ...
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, ...
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 -...
1
vote
1
answer
67
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....
0
votes
1
answer
62
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....
0
votes
2
answers
61
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. ...
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....
2
votes
2
answers
285
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 ...
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 ...
2
votes
1
answer
165
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 ...
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?...
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 ...
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 '...
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)...
0
votes
0
answers
58
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)
...
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 ...
3
votes
1
answer
99
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 ...
10
votes
3
answers
349
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 ...
2
votes
1
answer
63
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 ...
1
vote
1
answer
48
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 ...
0
votes
1
answer
46
views
Plutus Emulator trace halting with MintingPolicyNotFoundError
I have the following simple minting script:
{-# INLINABLE unrestricted #-}
unrestricted :: () -> ScriptContext -> Bool
unrestricted () _ = True
unrestricted_policy :: MintingPolicy
...
1
vote
1
answer
143
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 ...
2
votes
1
answer
118
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 ...
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....
6
votes
2
answers
267
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, ...
1
vote
2
answers
80
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 ...
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.
...
0
votes
1
answer
76
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 ...