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
0 votes
1 answer
13 views

How to reduce tx size using typed Plutus script with Vasil fork PlutusV2?

With the recent Vasil fork script references allow to reduce transaction size. Even though Vasil has been already launched on the testnet I could not find information on how to reduce the size of ...
user avatar
0 votes
1 answer
26 views

Cannot wrap my head on NFTs

I am running through the Plutus Pioneer Program and I have reached week 5. Also as a reference, I will use the LobsterChallenge repository. I am a bit confused about how NFTs work for the Cardano ...
user avatar
0 votes
1 answer
28 views

Is there a way to see which Plutus code is deployed on a specific script address?

On Ethereum, for example, there is a way to see the Solidity code that is deployed in a specific address (as long as the code gets verified). Is there a way to achieve this same behaviour in Cardano?
user avatar
1 vote
1 answer
23 views

How does valuePaidTo work?

How does valuePaidTo work ? Does it give the value paid by the script to the pubkeyhash or is it the total value of the pubkeyhash for the pending transactions ? Consider the following TxOut txOutputs ...
user avatar
  • 13
0 votes
1 answer
12 views

Did I update Plutus Apps Repo Wrong?

I just did a git pull updating my plutus repos from the one used in plutus pioneers 3 to the full state. I did not choose to move the HEAD to the commit mentioned and wanted to see what happens if I ...
user avatar
0 votes
0 answers
18 views

Using `curSymbol` function in Validator script

supposed I have a mintingpolicy script (simple one time minting policy, parameterizing TxOutRef) and a validator script. I want to validate if the token with correct CurrencySymbol is spent in a ...
user avatar
0 votes
1 answer
28 views

Can't create ```TokenName``` using ```tokenName``` with error ```GHC Core to PLC plugin: E042:Error: Unsupported feature: ...```

I'm not sure is relevant but the code in question is for a generic Validator (with Datums and Redeemers) used to get a forwarded minting policy the problem should be clear from the title, I can't get ...
user avatar
  • 392
0 votes
2 answers
65 views

problem setting up the plutus environment

Noob here. I am basically just trying to learn plutus on my own I am on week01. When I ran the following command: [nix-shell:~/plutus-apps/plutus-playground-client]$ npm run start (or even just npm ...
user avatar
1 vote
1 answer
22 views

Where does the PAB run?

I understand that PAB is a backend that: provides a standardized environment in which Plutus applications run provides disciplined state management presents discoverable interfaces to the external ...
user avatar
1 vote
1 answer
73 views

Using Endpoints in a PAB Schema

I am trying to find a way to integrate endpoints from a native token staking contract and implement them into the PAB. I am assuming I will heavily be using the getSchema instance. Like so: instance ...
user avatar
1 vote
1 answer
62 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 ...
user avatar
  • 90
0 votes
1 answer
28 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 ...
user avatar
  • 69
1 vote
1 answer
22 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 ...
user avatar
  • 896
0 votes
1 answer
24 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: "\"...
user avatar
1 vote
0 answers
39 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 ...
user avatar
  • 896
0 votes
1 answer
44 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?
user avatar
1 vote
0 answers
33 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 ./...
user avatar
  • 392
0 votes
2 answers
41 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} ...
user avatar
  • 333
0 votes
1 answer
65 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 . ...
user avatar
  • 896
1 vote
1 answer
93 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 ...
user avatar
0 votes
2 answers
40 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, ...
user avatar
  • 333
0 votes
0 answers
29 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 ...
user avatar
1 vote
2 answers
68 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 ...
user avatar
1 vote
2 answers
31 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 -> ...
user avatar
2 votes
1 answer
41 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 ...
user avatar
  • 896
2 votes
2 answers
65 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 ...
user avatar
  • 392
0 votes
1 answer
53 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 ...
user avatar
  • 392
0 votes
1 answer
33 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 ...
user avatar
  • 177
2 votes
1 answer
57 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?
user avatar
0 votes
0 answers
18 views

Fold emulator log on ContractInstanceTag WITHOUT Contract?

I am trying to test a parameterized contract. The parameters are determined by the results of other contracts. I want to, for example, create a predicate using assertContractError. I would have ...
user avatar
  • 333
0 votes
0 answers
22 views

How does ThreadToken work in State Machines?

Quick question on Week07. Can someone explain how the NFT token minting/burning is handled by the State machine exactly? Also, in the conditions of the transition function, looks like nftToFirst is ...
user avatar
1 vote
2 answers
54 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 ...
user avatar
  • 177
3 votes
0 answers
37 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 ...
user avatar
1 vote
1 answer
87 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 ...
user avatar
0 votes
0 answers
42 views

How to validate payment and staking address in Plutus script?

Lars mentioned in week 7 that valuePaidTo checks if value is paid to PaymentPubKeyHash of the user, but some malicious actor could spend utxo paying to users Payment address but using his (not users) ...
user avatar
  • 148
1 vote
1 answer
63 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 ...
user avatar
2 votes
1 answer
50 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 ...
user avatar
  • 183
2 votes
0 answers
67 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 ...
user avatar
1 vote
1 answer
32 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 ...
user avatar
1 vote
1 answer
54 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 ...
user avatar
  • 1,196
1 vote
0 answers
34 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 ...
user avatar
0 votes
0 answers
16 views

Week 7 not building

I just downloaded (git pull) week 7, did the checkout, entered the nix shell, did cabal update, and then cabal build. I get this error. $ cabal build HEAD is now at ee59880 Don't use the unsafe ...
user avatar
  • 177
0 votes
1 answer
27 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 ...
user avatar
0 votes
1 answer
39 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?
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 ...
user avatar
  • 177
2 votes
3 answers
51 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 ...
user avatar
1 vote
1 answer
69 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"...
user avatar
0 votes
2 answers
52 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 ...
user avatar
0 votes
2 answers
53 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 ...
user avatar
1 vote
0 answers
46 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 ...
user avatar

1
2 3 4 5
8