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
19 votes
2 answers
352 views

How can smart contracts interact each other?

If the "context" of a smart contract can see only the transaction where it sits and its inputs-outputs, how can a smart contract interact with other smart contracts living in different ...
Aron Neewart's user avatar
16 votes
4 answers
1k views

On-chain and off-chain for Plutus SCs

Hi I am currently at lecture 5 of the Plutus Pioneers Programm and I was wondering which part of the code is on chain and which is offchain. I know that the valididation script is onchain but the ...
Pierre Previsionz's user avatar
16 votes
3 answers
693 views

What's the difference between "on-chain" and "off-chain" in plutus smart contracts?

Smart contracts written in Plutus can be divided in two: an on-chain part and an off-chain part. What's the main difference between these two?
Aron Neewart's user avatar
15 votes
2 answers
344 views

Append metadata to transaction from Plutus code

Is there a way to append metadata to transactions that are send from plutus code? Right now we send transactions from the contracts like follows (or something alike): ledgerTx <- ...
AngelCastillo's user avatar
14 votes
2 answers
991 views

Where does a smart contract exist, in EUTxO?

In particular, I want to know whether the smart contract is somehow its own entity in the blockchain, or if a smart contract is just a property that EUTxOs may pick up. EUTxOs are bound by smart ...
Matthew Capps's user avatar
14 votes
6 answers
2k views

The Concurrency Issue

Are there any solutions to the concurrency issue so far without sacrificing decentralization? MinSwap testnet was experiencing this last night and just looking for some clarification, haven't seen ...
anonymous's user avatar
  • 231
14 votes
2 answers
551 views

Where is the on-chain code actually stored?

I've just read something that suggests Validators aren't actually kept on the blockchain. To save the space, only the hash of the Validator is kept at the UTxO and users willing to spend it must ...
emesik's user avatar
  • 886
14 votes
2 answers
605 views

How to emulate a multi-sig transaction?

I'm working on a Plutus contract that requires multiple signatures to unlock. To do so, I've been referencing the MultiSig.hs sample contract. Now, I'm looking to create traces for testing purposes, ...
bhindman's user avatar
  • 141
14 votes
1 answer
324 views

How do I build a debug configuration of a Plutus project?

When I try to set a breakpoint in a small Plutus project such as this, I always get the following error: :b Week05.Homework1.mkPolicy cannot set breakpoint on Week05.Homework1.mkPolicy: module Week05....
thebrandre's user avatar
13 votes
8 answers
2k views

As I front-end developer, how should I start learning more about blockchain and should I start with Plutus?

I'm currently a front-end dev - HTML, Javascript, CSS, PhP. I'd like to get into blockchain, but I don't know where to start. Any advice? Should I start by learning Plutus? If so, where should I start?...
Madmutt's user avatar
  • 153
13 votes
1 answer
136 views

Plutus Contracts Delegation

Is there or will there be such a thing where delegators can stake to a smart contract itself, rather than a pool?
KIJIRI's user avatar
  • 687
13 votes
2 answers
506 views

What is the difference between Plutus (Marlowe) and Glow?

What is the use case of Glow when you have Plutus and why a developer would use it instead of the other smart contract language which is natively supported by Cardano?
Petar Enchev's user avatar
11 votes
2 answers
222 views

How can I write unit tests for Plutus contracts?

I'm a member of Plutus Pioneer Program. I already know about the Plutus Playground and like it very much. However, clicking all the blockchain action scenarios each time is very time-consuming, ...
emesik's user avatar
  • 886
11 votes
2 answers
404 views

Poly Network attack - lessons for Plutus devs?

Over on Twitter, @kelvinfichter gave an analysis (included below) of the recent Poly Network hack. Without any of the benefits of hindsight, are there reasons why the exploit would have been less ...
isedwards's user avatar
  • 225
11 votes
2 answers
219 views

Plutus Pioneer Program - Lecture #4 Homework - Best practice for logging errors

Below is my attempt to implement the homework assignment. Is the way I call the endpoint twice in payTrace with minor differences appropriate? Since payTest2 would not execute properly without ...
Matthias Sieber's user avatar
10 votes
3 answers
353 views

How will DApps work on Cardano?

This may been too broad of a question but I was hoping to ask a few specific questions here rather than over multiple questions. I don't think DApps are available yet but I'm sure people have started ...
Cavenfish's user avatar
  • 526
10 votes
2 answers
433 views

Why do we need parameterized contracts? Can't we just use datum?

While writing validation as: mkValidator :: SomeContractParam -> SomeDatum -> () -> ScriptContext -> Bool Could't we pass the same thing to Datum instead of using Contract Parameter?
universal clinic'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
10 votes
3 answers
669 views

Plutus Pioneer Program - Lecture #1- Cabal Build error

I started following the lectures on youtube and got this error when I try to build the English Auction Warning: The build command is a part of the legacy v1 style of cabal usage. Please switch to ...
Ramiro's user avatar
  • 101
10 votes
2 answers
111 views

Test-Focused EvaluatorTrace Monad?

Is there infrastructure for writing unit/integration tests for our contracts, without running the full playground? Is there a test-focused EvaluatorTrace monad, for example?
KIJIRI's user avatar
  • 687
9 votes
2 answers
651 views

Is there a good tutorial to mint Cardano NFT using plutus script?

I used to mint Cardano NFT using "Time locking" following this guide https://developers.cardano.org/docs/native-tokens/minting-nfts/. But I know the more formal way is to use plutus script ...
Tam Edward's user avatar
9 votes
1 answer
634 views

Hardcoding currency symbol and token name in validator script

I want to be able to make calls to my custom native token module inside the validator script as I do with the Ada.hs module, but if I try I get a "E042:Error: Unsupported feature: Type ...
AngelCastillo's user avatar
9 votes
1 answer
291 views

How to access the current slot in a Plutus validator script?

At the time the Plutus validator script runs, the transaction is not yet part of the blockchain. But the targeted slot of a transaction is known when a node processes the script. Is it possible to ...
thebrandre's user avatar
9 votes
2 answers
237 views

Where is the returning Contract Monad in the handleError function of Contract Monad?

The type of handleError function is :: (e -> Contract w s e' a)-> Contract w s e a -> Contract w s e' a It takes two arguments a function which takes error and returns a Contract monad (...
raghu's user avatar
  • 1,834
9 votes
2 answers
172 views

How do nodes access the validator code?

As far as I know, script address is the hash of the validator script. (Or has the hash of the validator script. I don't know which). So when a node wants to validate that address, It needs to run the ...
Jelil Akjaly's user avatar
9 votes
1 answer
215 views

plutus starter course

So I am trying to start a plutus project from scratch, as we are always just editing the .hs source files in the plutus pioneering program homeworks, wondering what are the bare necessary files needed ...
Hud's user avatar
  • 433
9 votes
2 answers
752 views

What's the difference between `unstableMakeIsData` and `makeIsDataIndexed`?

In the docs about validators a function named unstableMakeIsData is used, but has the following comment: -- 'unstableMakeIsData' is a TemplateHaskell function that takes a type name and -- generates ...
Danny Tuppeny - CODER's user avatar
9 votes
1 answer
465 views

Generate random number in Plutus on-chain code

Is it possible to generate a random number in Plutus on-chain code? For example, if I would like to implement a smart contract that works like gambling game, where a person deposits ADA and bets on a ...
Piotr Gorzelany's user avatar
9 votes
1 answer
338 views

How can I get a fully built transaction from the PAB

According to the Plutus team, the standard way of generating signed transactions containing smart contracts is to have the off-chain code generate a so called unbalanced transaction that is then, in a ...
Jey's user avatar
  • 1,549
8 votes
3 answers
183 views

Deriving Show Compilation Error on Plutus Playground

I seem to be getting a compilation error when I try to compile any of the example files on my local host configuration for the Plutus Playground. The error is pictured here: And basically it seems ...
Conor Devlin's user avatar
8 votes
2 answers
165 views

Referencing onchain contract as 3rd party

In solidity and EVM, it is possible to reference external contracts by providing the address and interface to the contract: address ckAddress = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d; ...
Alan Saw's user avatar
  • 171
8 votes
1 answer
131 views

Confused by compilation message in plutus playground (week 5 pioneer program)

This is part of my attempt at solving the first homework assignment of week 5 in the plutus pioneer program. The rest of the unmodified file can be found here. {-# INLINABLE mkPolicy #-} -- This ...
Matthias Sieber's user avatar
8 votes
2 answers
142 views

Why Strict Evaluation Operator "!" used in record definition implemented in Plutus Core?

While declaring records for use in Plutus strict operator is used like this: data Auction = Auction { aSeller :: !PubKeyHash , aDeadline :: !Slot , aMinBid :: !Integer , aCurrency :: !...
raghu's user avatar
  • 1,834
8 votes
1 answer
128 views

How to get intellisense/auto suggestion working for Plutus in VSCode?

I've been seeing Lars get auto suggestions from his terminal when he's typing. I want the same in VSCode, how to get it? PS: I don't get auto suggestions in cabal repl too.
Shaan Sundar's user avatar
8 votes
3 answers
412 views

Building local Plutus documentation

I've been following this guide to build Plutus documentation locally. The key line is - [~/plutus] nix-build -A plutus-playground.haddock This works fine, but I'm following the Pioneer Program and ...
Phil Boltt's user avatar
8 votes
2 answers
343 views

Storing Secrets in Smart Contracts

I was wondering if there was an ability to store secrets, such as an API credential within a smart contract. When the contract gets executed it checks something remote. Maybe a weird example, but for ...
Rainer Zufall's user avatar
8 votes
1 answer
302 views

How does `submitTxConstraintsWith` make usage of the ScriptLookups?

submitTxConstraintsWith :: ScriptLookups a -> TxConstraints (RedeemerType a) (DatumType a) -> Contract w s e Tx How does submitTxConstraintsWith make usage of the ScriptLookups? I always see it ...
Attilah's user avatar
  • 431
8 votes
1 answer
431 views

How can token metadata be stored onchain?

I was wondering how to link additional (meta)data to a token. Consider a trading card game which allows a user to purchase a booster pack containing cards via smart contract. Those cards should have a ...
monolith's user avatar
  • 323
8 votes
1 answer
101 views

Cardano-Ethereum Bridge

What is the best way to write a smart contract that will work across both Cardano and Ethereum? It doesn't have to be released yet but preferably something that will be usable by the end of the year. ...
Eddy Schauman-Haigh's user avatar
7 votes
5 answers
3k views

How to convert a cardano address into a public key hash?

After spending some time learning Plutus with emulators, I decided to start learning how to actually deploy and use the scripts in the testnet. In this process, I installed cardano-cli and created ...
Mateus's user avatar
  • 988
7 votes
2 answers
541 views

How to convert posixTime to slot number on Cardano Testnet

I'd like to obtain the slot number corresponding to a posixtime on Cardano Testnet. For example, this might be useful if you need to set a slot number in cardano-cli, say building a transaction: ...
kindofdev's user avatar
  • 1,304
7 votes
1 answer
204 views

Plutus Pioneer Program - Lecture #1 Problem with cabal build

I ran into this dependencies error on Ubuntu when I try to build the English Auction, does anyone have an idea how to solve it ? Please switch to using either the new project style and the new-build ...
Hamza's user avatar
  • 150
7 votes
3 answers
137 views

When a UTxO becomes available for consumption?

In the Gift.hs example from the second lecture in Plutus Pioneers Program, when I give ada, a UTxO is produced. When I want to grab that ada in the same block, it fails (There is no input or output ...
Jelil Akjaly's user avatar
7 votes
2 answers
582 views

I'm having issues with nix-shell

I keep getting this error, any thoughts? I have re-downloaded nix 3 times now and it's the same error as before. Not sure if it's the profiles or channels but this is what it gives me: '''trying https:...
KIJIRI's user avatar
  • 687
7 votes
3 answers
1k views

Problem starting a plutus devcontainer in windows

After I upgraded my container to the commit from plutus pioneer programm lecture 3 the VsCode server won't spawn anymore in the dev container. VSCode tells could not fetch remote environment Failed ...
wutzebaer's user avatar
  • 691
7 votes
1 answer
143 views

Plutus tutorial similar to Ethereums "CryptoZombies"

Is anyone aware of a similar tutorial as Ethereum's "CryptoZombies" being built for Plutus on Cardano? I'm currently in the Pioneer program, and although we're incredibly lucky to have Lars ...
alpo's user avatar
  • 71
7 votes
2 answers
234 views

on multiple eUTxO and the validation proces

I have an in-depth question that needs good knowledge of the ledger rules. I was thinking about how to program efficiently and design apps such that they are parallelizable, a good practice for ...
Fermat's user avatar
  • 1,892
7 votes
2 answers
241 views

Is it possible to make multiple transactions atomic?

A concrete example would be flash loans, where you could borrow some value from a lending script, do something interesting with it, and return the borrowed amount to the script with a fee, all in one ...
Mitchell Turner's user avatar
7 votes
1 answer
78 views

DAO Smart Contract on Cardano

Are there any resources available specific to creating a DAO on Cardano? I am interested in seeing any examples of DAOs on Cardano or technical articles on this topic. Thanks
Deano's user avatar
  • 100
7 votes
1 answer
170 views

Good tutorials / resources for PAB (testnet)

Does anyone have good resources on the PAB connecting to the testnet? I know Lars Brünjes explained it in the pioneers program, but, at that time, we still had to rely on the emulator. I also know we ...
Mateus's user avatar
  • 988

1
2 3 4 5
13