Questions tagged [plutus-pioneer-program]

A program to recruit and train developers in Plutus for the Cardano ecosystem. Use this tag for questions regarding the Plutus pioneer program. Keep lecture and homework questions brief and on-topic. Give full answers that clearly explain why they resolve the problem.

Filter by
Sorted by
Tagged with
1 vote
1 answer
178 views

Bad File Descriptor on nix-build of Plutus-Apps on Mac M1

I am seeing an error building Plutus-Apps on Mac M1. After precisely following https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md UPDATE: This did resolve. These errors ...
Deano's user avatar
  • 100
0 votes
1 answer
41 views

Error signer not found - txInfoSignatories

I'm trying to implement lock and withdraw of an NFT, but when I tried to check the signer on-chain with the function: signer :: PubKeyHash signer = case txInfoSignatories (scriptContextTxInfo ctx) of ...
pprs's user avatar
  • 91
1 vote
1 answer
60 views

How to use plutus script withness in other plutus script

How can we reference the use of other scripts in a plutus validator?. Wat I was trying to making is an validator that only validates if an other predetermined plutus scripts also validates in the same ...
Fermat's user avatar
  • 1,802
0 votes
1 answer
41 views

Emulator trace throws `BuiltinEvaluationFailure of UnIData` error with simple minting policy

Source https://github.com/tomazvila/plutus_minting_test Problem Running smart contract with simple minting use case fails to mint. Error Slot 00001: *** CONTRACT STOPPED WITH ERROR: "\"...
KugisMugis's user avatar
1 vote
1 answer
113 views

How is metadata typed on the blockchain

I am reading through the haddock documentation to find the way metadata is attached to a transaction. In this documentation (1) we have data Blockchain = [Block] data Block = [OnChainTx] Where and ...
Fermat's user avatar
  • 1,802
0 votes
1 answer
51 views

How can I code a liquidity pool?

I am really interested in how i can code a liquidity pool using Plutus. What are the mechanics & the components I need to handle? Is there a specific pattern, skeleton to follow?
Tasos Valtinos's user avatar
1 vote
0 answers
45 views

setting up the PAB - could not start the plutus-chain-index

I'm trying to follow the lesson 6 of iteration 3 of the plutus-pioneer-program when trying to start che chain index trough the command (fromn the plutus-apps repository) plutus-chain-index --config ./...
Michele's user avatar
  • 720
0 votes
2 answers
78 views

Diagnosing a POSIXTime discrepancy

My computer's date command is returning a timestamp wildly different from what testnet wants. Using this formula, > slotToEndPOSIXTime testnetConf 55047601 POSIXTime {getPOSIXTime = 1651015217999} ...
waalge's user avatar
  • 383
0 votes
1 answer
191 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,802
1 vote
1 answer
154 views

Can't compile Plutus Playground examples: Could not find module `Playground.Contract' (Ubuntu 20.04)

I can't compile any of the example scripts using Plutus Playground gui: Compilation Error, Line 2, Column 1 (jump) error: Could not find module `Playground.Contract' Use -v (or `:set -v` in ...
Marek Mizier's user avatar
1 vote
2 answers
67 views

StateMachines on Testnet : How to step a client?

I want to run a statemachine on testnet. The SM runs in the emulator, and I can initialize on testnet, but if I try to make a new client it throws an error. The error comes from transition failure, ...
waalge's user avatar
  • 383
1 vote
0 answers
76 views

Plutus Pioneer Cohort 3, Mac M1 cabal build error: Failed to build small-steps-test-0.1.0.0. , symbol not found in flat namespace '_sodium_free'

I'm using MacOS Monterey with M1 chip, and trying to build plutus-app using Nix Entering $ nix-shell using the specified tag from week01 is working fine, hence I can enter into the shell. The problem ...
Dani Ihza Farrosi's user avatar
2 votes
2 answers
158 views

Starting a new Plutus Project

I've read a few threads on Cardano Stack exchange on how to start a new Plutus project, but there doesn't seem to be a satisfying answer. I've read the following: plutus starter course How to Start a ...
Domy2018's user avatar
1 vote
2 answers
43 views

checkDeadline function always returning False

I am trying to make a minting policy that fails after a certain deadline. I have tried something like this {-# INLINABLE mkTokenPolicy #-} mkTokenPolicy :: TxOutRef -> TokenName -> Integer -> ...
brightman11's user avatar
2 votes
1 answer
59 views

How to take powers in validator

I was trying to implement some El Gamal cryptography in plutus, basic verification of statements. But while trying to implement an efficient modular exponential function I noticed that the current ...
Fermat's user avatar
  • 1,802
2 votes
2 answers
103 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's user avatar
  • 720
0 votes
1 answer
63 views

could not build or repl plutus-pioneer-program

I'm trying to build the plutus-pioneer program, and I assume that having the environment working is important also in order to build real smart-contracts; I've set up nix and cache and I'm also sure ...
Michele's user avatar
  • 720
0 votes
1 answer
47 views

Connection between functions, modules, and packages

I have determined (by analyzing all the .hs files) that for weeks 1-8, the following modules are variously imported: import qualified Prelude import qualified Prelude as P import ...
XiTouch's user avatar
  • 349
2 votes
1 answer
72 views

Certification for Plutus Smart Contracts

What does the process look like for certification and auditing of Plutus Smart Contracts? What are required steps to prepare your dApp for certification?
dailyinvention's user avatar
1 vote
2 answers
119 views

relationship between seed phrase, wallet address, public key, UTxO, verification key, and signing key

Everything I read about cryptography talks about a "public key" and a "private key". However, the Cardano CLI reality appears more complex. As I understand it, the 24 word seed ...
XiTouch's user avatar
  • 349
4 votes
2 answers
116 views

How to optimize Plutus smart contracts?

Context I'm creating scripts with hardcoded parameters in my smartcontract and I would like to reduce footprint of them to reduce transaction fees. Right now i'm doing so using parameterized ...
KugisMugis's user avatar
4 votes
1 answer
141 views

How to implement Vesting smartcontract with time period longer than 36 hours?

Context In third weeks plutus pioneer lecture lars said that Vesting period shouldn't be longer than 36 hours. He argued that this is because time is calculated in slots on-chain and that this ...
KugisMugis's user avatar
1 vote
1 answer
140 views

What is an unbalanced transaction? How does adjusting an unbalanced tx actually work?

In Week06, there was an implementation of adjusting an unbalanced transaction in the plutus script. Can someone explain what an unbalanced transaction really is? And how does it actually work when we ...
Tasos Valtinos's user avatar
2 votes
1 answer
57 views

Transaction lifecycle

Working to understand transaction lifecycle. Some understanding of Bitcoin transaction lifecycle perhaps helps here. That is, a transaction is originated from a client request to a node. This node ...
jerome's user avatar
  • 183
2 votes
0 answers
76 views

Issues running Chain-index on WSL2 - fully syncing but not running the webserver

I've run into an issue with the chain-index while trying to run a PAB testnet environment. The index will start up, sync to 100%, update to new blocks, but the webserver will never start. In fact, the ...
RustyCamel's user avatar
1 vote
1 answer
49 views

passing the thread token

In the firstGame function, we use the "logging" component of the contract to tell the thread token. It's not obvious to me where this is needed: is there an internal check in the runStep ...
Mihai Codescu's user avatar
1 vote
1 answer
64 views

How to make module Week07.EvenOdd fairer with player2 in case player2 wins the game

In week07 lecture Lars refers that Week07.EvenOdd contract is a bit unfair with player2 in the case of player2 wins . Why 😢 ? Well, player2 has to pay minAdaTxOut (2 ADA) to player1 in order to send ...
kindofdev's user avatar
  • 1,284
1 vote
0 answers
50 views

How Do I Deploy a Plutus Contract From the Browser?

I want the user to go to my website and enter some details into a form. This data should then be converted into an input for my parameterised smart contract (written in Plutus). I can do the website ...
KryptoKing's user avatar
0 votes
1 answer
30 views

mkSchemaDefinitions compilation error

Does someone know the what mkSchemaDefinitions accomplishes and how it accomplishes it? Lars calls it boilerplate code, but now that I'm having an issue with it I have no idea how to fix it. I'll ...
Kyle Murphy's user avatar
0 votes
1 answer
51 views

How do you Connect ATALA to Plutus Smart Contracts [closed]

I think they use diffrent programming languages, but how can I use DID inside my Plutus contracts?
KryptoKing's user avatar
0 votes
1 answer
15 views

Trying to understand import, browse, "as" and other terminology

I'm trying to understand at the lowest level exactly how Plutus/Haskell/Cabal works. I executed the following in the repl (inside nix): > import PlutusTx.Builtins.Internal as PTxBI Doing this ...
XiTouch's user avatar
  • 349
2 votes
3 answers
58 views

How to Make a Successful CIP?

I am finding the current state of Plutus is not suitable for my purposes, as such I wish to make a CIP. How do I make the CIP? What should I do to optimise the CIP and maximise the chances of it being ...
KryptoKing's user avatar
1 vote
1 answer
73 views

funding a wallet

I've created a wallet with create-wallet.sh and loaded it with load-wallet.sh, and its balance is 0: "balance":{"total":{"quantity":0,"unit":"lovelace"...
Mihai Codescu's user avatar
0 votes
2 answers
68 views

Can Queries To the Chain be made From Plutus Smart Contracts?

Considering that Plutus Smart Contracts have two parts (on chain and off chain) is there a way to make Queries to the Cardano Chain in the onchain part of the contract considering that the SC is ...
KryptoKing's user avatar
0 votes
2 answers
71 views

How can you use Ledger.Constraints in the Validator?

Hi i have noticed that you can get the unspent UTxOs in an wallet address using the Ledger. Constraints module. I want to know can I use it the same in the mkValidator as in the Endpoints? The general ...
KryptoKing's user avatar
1 vote
0 answers
59 views

How to use Endpoints and Schema

I doing the PPP but Lars does not cover Endpoints or schema declarations in sufficient detail. I imagine that this is a problem that Plutus devs must overcome, but I cannot find suitable documentation ...
KryptoKing's user avatar
0 votes
1 answer
62 views

unable to start plutus-playground-server after full rebuild --> /bin/plutus-playground-server: No such file or directory

After having to completely re-install an OS and setup a development environment. attempting to run the plutus-playground-server after building it wiht nix-build -A plutus-playground.server once in nix-...
Why_Is_This_Hard's user avatar
2 votes
0 answers
26 views

About Fees in the Plutus Playground

I had been reviewing sample codes that can be run in the Plutus Playground, particularly the Vesting.hs code in Cohort #3 Week #3 of PPP. So while trying several cases in the simulation, I sometimes ...
omegafer's user avatar
1 vote
1 answer
46 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
0 votes
1 answer
70 views

Error when minting with CLI

I tried to follow Lars' instructions on minting with CLI and I get the error below. I did not modify cabal.project. Any idea what goes wrong? ./mint-token-cli.sh ...
Mihai Codescu's user avatar
1 vote
0 answers
70 views

Exception from validator is not shown when using cardano-serialization-lib

I have this simple validator: newtype BreedConfig = BreedConfig { feeAddr :: PubKeyHash } deriving (Generic, ToJSON, FromJSON) PlutusTx.makeIsDataIndexed ''BreedConfig [('BreedConfig, 0)] ...
CryptoDinoAdamuso's user avatar
1 vote
1 answer
51 views

Referencing between scripts and application to state machines

(This is not related to CIP-33.) I want a validator to ensure another validator is also run. Naively I could construct one, get the hash, and hard code it into the other. Presumably two validators can'...
waalge's user avatar
  • 383
0 votes
1 answer
91 views

Plutus function TxSIgnedBy - transaction build Error: The Plutus script evaluation failed

I'm trying to use Plutus function txSignedBy with a transaction involving the usage of cardano-cli I first sent some UtxO to my script address, with a datum whose structure is like this: data ...
Jean-Sébastien Gonsette's user avatar
1 vote
1 answer
121 views

How can I configure and send a transaction to the Cardano chain using python

I have written some plutus contracts, but they use parameterisation and the params are gained through a REST API. I am using python3 to interface with the API, but would like to be able to script an ...
KryptoKing's user avatar
1 vote
1 answer
42 views

Is it possible to use recursion in onchain code?

I originally asked Working with BuiltinByteString One of the suggested solutions defined a recursive function in the on chain code. This did not work however and I've since been trying to determine if ...
Avatar33's user avatar
  • 201
1 vote
1 answer
109 views

How to log/trace/print messages from within the contract ON-chain code, while using cardano-cli?

I'm wondering how to log/print/trace any message during the execution of a contract when submitted to the blockchain via cardano-cli. So basically I hoped this very simple test script would show me ...
Jean-Sébastien Gonsette's user avatar
0 votes
1 answer
88 views

How Do you generate the Cabal and Nix files for a new project?

I built the plutus-apps repo from iohk, and then made a different folder to orgenise my projects. I want to know how to have the nix files needed to make the environment generated in the new project ...
KryptoKing's user avatar
0 votes
1 answer
33 views

Allowing for a weaker on-chain constraint. Week 05 Homework 2

In HW 2 of Week 5, we need to write a script that mints a token with empty ByteString. The minting policy code on the on-chain part (mkPolicy) could ensure that the token name is empty by defining ...
a_juggler's user avatar
0 votes
1 answer
103 views

Where is the actual NFT data stored

I'd like to create a unique set of NFTs of super high definition images. However they require sizable memories. These images must reside on a server so will transactions just point to this server ...
d_fajardo's user avatar
  • 198
1 vote
0 answers
92 views

Calculation cpu and memory exUnits on transaction submit is different then on transaction build?

I am trying to build a non-optimized script and during the cardano-cli build transaction I got an error: Command failed: transaction build Error: The following scripts have execution failures: the ...
zarej's user avatar
  • 439

1
2
3 4 5
8