Questions tagged [plutus]
A programming language based on Haskell used to write smart contracts on the Cardano blockchain.
631
questions
0
votes
0
answers
29
views
Can I forcefully run phase 2 validation in PAB locally?
Transaction validation happens in two phases:
https://docs.cardano.org/plutus/transaction-costs-determinism
https://iohk.io/en/blog/posts/2021/09/07/no-surprises-transaction-validation-part-2/
https://...
0
votes
1
answer
54
views
How to check if validator ran inside minting policy
I want to check within a minting policy whether a specific spending validator script is being run by checking if I can find an input that belongs to that spending validator's script address.
If there ...
1
vote
2
answers
49
views
Is there a precedent or example for using a cardano NFT for permission verification?
I would like to use ownership of a Cardano NFT as a requirement for editing an online document. i.e. if you own the nft then you will be capable of writing to the document,but if you do not own the ...
0
votes
0
answers
14
views
Can a json files keys and values be a prerequisite for a minting policy?
I was wondering if a policy script can mint CNT-20 tokens with a metadata.json TX.
Can Scripts take the JSONs keys and values as an added prerequisite before minting?
I know Plutus can be used too ...
0
votes
0
answers
17
views
Is there a way that I can use to deploy a liquidity pool on the testnet blockchain as plutus script using the uniswap example in plutus-use-case?
Is there a way that I can use to deploy a liquidity pool on the testnet blockchain as plutus script using the uniswap example in plutus-use-case. I have the node running on my local machine and I 've ...
2
votes
1
answer
83
views
Plutus Script Validation Metadata
I have a question but I cannot find a concrete answer for that. I have a smart contract developed in Plutus for managing locking and withdraw of Tokens/NFTs. I'm wondering if I can validate some ...
1
vote
1
answer
29
views
Why are some Plutus types defined multiple times in different packages?
I would like to know why certain types are defined multiple times in different packages and whether that's suppose to dictate which types to use for on-chain code and which for off-chain code?
Example:...
1
vote
1
answer
28
views
How to specify differerent inputs coming from a smart contract on Cardano Cli
I am currently testing a plutus script on cardano-cli, I need to use 2 inputs from a SC address that have different datum, how can I specify both --tx-in-datum-file for the transaction?
Thanks
1
vote
1
answer
96
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 ...
0
votes
1
answer
23
views
Contract is not stopping execution if validation script fails (happened after 2022-04-06 PAB Release)
Before the 2022-04-06 PAB Release Contracts used to stop execution after validation script failed the transaction sent by submitTxConstraintsWith, but after this release Contract is not stopping its ...
1
vote
0
answers
29
views
How to Count plutus transactions?
i'm connected to the cardano-db-sync, someone knows how to count the ammout of transactions that use plutus script?
i'm using two methods here
select block.epoch_no,
count(distinct tx.id) as ...
0
votes
0
answers
71
views
How to fix `cabal build` in Plutus Starter Dev Container
I have seen other people with this problem on Github.
Broken cabal build
Following these instructions, I am able to get to the line that says:
cabal build from the terminal should work (unless you ...
2
votes
1
answer
105
views
How precise is the time inside a plutus script?
It is a known fact that you can calculate time inside a plutus validator script by looking at the txInfoValidRange attribute. Now, since this value is a range and not an exact time, it makes me wonder ...
0
votes
1
answer
37
views
ConstraintResolutionError
I'm getting the following error during the ledgerTx line of code
"ConstraintResolutionError (TxOutRefNotFound (TxOutRef {txOutRefId = ...
1
vote
0
answers
33
views
How does the Fμω lambda calculus use C?
While poking around in the repositories I wondered how the sha2_256 algorithm was implemented in the PlutusTx module. I followed all the imports and got the following path
The sha2_256 function in ...
0
votes
2
answers
109
views
Can you include a minting policy in a transaction without minting or burning any tokens?
I want to use the minting policy to abstract the script logic away from the validator and only validate what's necessary for a specific transaction. Right now, I'm able to do this by minting a token I ...
0
votes
1
answer
51
views
Send Given Amount of Tokens From Script to Wallet
Which TxConstraints i o method should I use to create a transaction where the script pays a specified amount to the wallet? The mustSpendScriptOutput is the only one I can find that sends tokens from ...
0
votes
1
answer
39
views
start-cluster - Command failed: genesis create - */genesis.alonzo.spec.json: openBinaryFile: does not exist (No such file or directory)
After cloning latest cardano-node and running nix-shell successfully I get an error running start-cluster and different error if I run with sudo:
Do I need to download the latest genesis jason file? ...
0
votes
0
answers
36
views
How do I confirm that PAB is connecting to testnet?
How can I confirm that PAB server is connecting to testnet? I am running local cardano node with NETWORK=testnet but how do I know what PAB Server is connecting with and confirm this is working? Also ...
1
vote
1
answer
39
views
Can I use Blockfrost to call custom endpoints of my Plutus offchain contract?
Blockcfrost-related question. Can we expose our own custom endpoints in our off-chain Plutus contract, and use your API to send requests from our own frontend client? For example, if I expose an ...
1
vote
2
answers
218
views
How to provide Datum value using serialization lib
I am consuming a script output and also create a new one at the same script address. The validator script requires the output producer to provide the datum value due to making assertions on it.
...
7
votes
1
answer
73
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
1
vote
0
answers
34
views
chain-index does not connect
I'm trying to run the cardano node, the cardano wallet and the chain index in three different docker images, but the chain index does not connect. The docker-compose file is below and the chain-index ...
0
votes
1
answer
74
views
Plutus-Starter Starter PAB backend server does not return wallet id
Server seems to have built ok:
[nix-shell:~/plutus/plutus-starter]$ cabal build plutus-starter-pab
Resolving dependencies...
Up to date
I am using Plutus-Starter project on Macbook Monterey M1 but ...
1
vote
0
answers
69
views
Compatible Plutonomy cabal.project for plutus-apps
I want to use Plutonomy , but it only (currently) works with two Plutus versions as per https://github.com/well-typed/plutonomy#flags.
How can I get a compatible cabal.project -- especially one that ...
2
votes
0
answers
112
views
How to link custom API endpoints with Plutus script? (Without Blockfrost or PAB)
I have a few questions, which I think might interest a lot of folks here.
Me and my team we are developing an app on Cardano and we want to avoid using PAB or Blockfrost for our infrastructure. We are ...
2
votes
1
answer
87
views
Is it possible to not compile data constructors with plutus-tx?
I'm having a newtype VerificationKey = HydraVerificationKey (VerKeyDSIGN Ed25519DSIGN) and I would love to be able to use that type directly in our plutus scripts. While I can implement PlutusTx....
1
vote
1
answer
166
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 ...
0
votes
1
answer
223
views
Plutus Starter nix-shell build errors on MacOS Monterey M1 - ghc-cabal: Encountered missing or private dependencies
MacOS Monterey, Apple M1
Installed latest GHC via https://www.haskell.org/ghcup/ but not Stack.
Installed nix 2.8.0 multiuser
Set Cache in /etc/nix/nix.conf as below:
UPDATE: I have since updated nix....
1
vote
1
answer
44
views
Convert a script address to Shelley address using Plutus
I have this script address of the type Plutus.V1.Ledger.Address.Address.
Address {addressCredential = ScriptCredential 31559888de4dd413f20557ff39f616eb3e8a52d36528f88e6aef2f8d,
...
0
votes
1
answer
39
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 ...
1
vote
1
answer
53
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 ...
0
votes
1
answer
40
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: "\"...
1
vote
1
answer
108
views
Why do we need the ```plutus-chain-index``` to run and why does it take so long to sync
I'm trying to set up a PAB in order to test my contracts
Currently I have:
fully synced a cardano-node running on testnet
fully synced cardano-wallet tracking one wallet
a plutus-chain-index syncing ...
0
votes
1
answer
49
views
How to achieve a minting policy script that locks after certain number of images (assets) have been minted on the fly
Let's say I want to run an NFT campaign, where the minting policy only allows minting of 100 NFTs (each one is different), and then the policy should lock.
If this minting policy were a Plutus script, ...
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?
0
votes
0
answers
32
views
Why does Plutus need GHC 8.10.4?
Plutus needs GHC 8.10.4 to compile. Apparently there is an issue in the newer versions of the compiler. What is this issue and when can we expect later versions of GHC to be compatible with Plutus ?
0
votes
2
answers
74
views
Using custom datum for `mustPayToOtherScript` in off-chain code
Lets say I on-chain i have a Datum like so:
data RandomDatum = RandomDatum {
{ tn :: !TokenName
, cs :: !CurrencySymbol
, nn :: !Integer
} deriving (Show)
Off chain I'm trying to form and ...
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 ./...
0
votes
2
answers
72
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}
...
1
vote
0
answers
67
views
Whats the Diffrance between Plutus scripts and Cardano Native Scripts?
What are the key differences between Cardano native scripts and Plutus scripts, from a developer's perspective?
0
votes
1
answer
171
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 . ...
0
votes
1
answer
54
views
What is the data type returned from the function utxosAt scriptAddress
I want to use the value returned from the function utxosAt scriptAddress. What is the value that this function will return ? Is it going to be in a list , json etc.....
0
votes
0
answers
9
views
Side Chian Interactions on Cardono?
How do I connect a Side chain to the cardano main chain using smart contracts?
According to How do I make a Sidechian The main idea is to mint tokens on the main chain and burn them according to the ...
4
votes
1
answer
205
views
How do I make a Sidechain
I want to make a side chain on Cardano to so something that the protocol says should be done on a sidechain, but how do I make one?
Can I use Plutus or am I limited to the CLI?
1
vote
2
answers
65
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, ...
2
votes
2
answers
152
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 ...
0
votes
0
answers
28
views
Deploying a Contract Problem
I know this is probably the fifth post about deploying smart contracts, but I seem to not succeed doing it.
Here is what I tried:
Installed Cardano Tesnet Alozo with Docker
Synced Testnet with docker ...
2
votes
1
answer
52
views
What can certificate scripts do?
While looking through the options of the cardano-cli transaction build options I saw the options,
--certificate-file CERTIFICATEFILE
Filepath of the certificate. This ...
1
vote
0
answers
18
views
How convert TxOut CtxUtxo era to Plutus Map TxOutRef TxOut
At least can someone give a hint how to convert TxOut CtxUtxo era to TxOut Ctx era.
I found that it's possible to convert to Ledger.UTxO and then ...