Questions tagged [script]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
21 views

Unable to convert BuiltinString to JSON

I would like to include a BuiltinString in a datum but am unable to do so as BuiltinString has neither a FromJSON nor a ToJSON instance. Is there an alternative to implementing these instances by hand?...
  • 45
0 votes
1 answer
18 views

How to create Policy Id using cardano serlization lib?

I was wondering how to create the policy Id/script for the cardano assets. I am new to cardano blockchain but I have worked on Ethereum. I read the docs provided by the cardano officials but couldn't ...
  • 1
0 votes
1 answer
27 views

Whats the python script to check if an cardano address has a script flag?

I have a script to fetch asset name, address from a policy id with blockfrost API, now I need to see if the asset is in a smart contract script. I have no coding skills but followed a tutorial to get ...
  • 3
0 votes
2 answers
28 views

"The second data argument, does not decode to a context" when minting NFT with Mesh

This my script for minting NFT: {-# INLINABLE mkPolicy #-} mkPolicy :: BuiltinData -> PlutusV2.ScriptContext -> Bool mkPolicy _ ctx = traceIfFalse "wrong amount minted" checkNFTAmount ...
2 votes
1 answer
33 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 ...
0 votes
1 answer
45 views

Workaround for Plutus Scripts that excesses the max Tx Size. Framework or examples for splitted or modular validators?

Im very interested in how you can split the validation in several validator. There is any model or framework to follow? Any example around? Could somebody at least share some words of insights about ...
1 vote
3 answers
77 views

Is it possible to call the `mkValidator` inside the same / another `mkValidator` function for script composibility?

Supposed I have a validator below, checking only if the output value is locked by the same script. {-# INLINEABLE mkValidator #-} mkValidator :: TestingParam -> TestingDatum -> TestingRedeemer -&...
0 votes
1 answer
47 views

'No Corresponding Policy Script' Error when Script Was Provided

Following the Mintin NFTs IOHK tutorial I end up with the following error when crafting the transaction. Command failed: transaction build Error: The "--mint" flag specifies an asset with a ...
0 votes
1 answer
89 views

What happens if I omit a datum hash in a transaction to a script address?

When using a Trezor to sign a transaction with a script address as the receiver, I get the message "The following transaction output contains a script address, but does not contain a datum. ...
0 votes
1 answer
60 views

How to store scripts using blockfrost?

Greeting! I got that Blockfrost has API to get plutus script hash but how to store those scripts hashes? P.S. if I got script hash, can I build and send transaction using script's hash and Blockfrost?
0 votes
1 answer
47 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?
0 votes
0 answers
22 views

How can I make a minting contract that never closes?

I am trying to change some old contracts to take advantage of the reference scripts coming whenever vasil comes out. How can I make a contract that will mint new coins upon activation, I'm talking ...
2 votes
2 answers
52 views

Whats Your Mental Model For Monads?

I was asked by a friend trying to learn plutus what a monad was, so I began talking about category theory. It seems that this confused him further how would you explain monads to a noob? Whats your ...
1 vote
1 answer
52 views

"'Inputs do not conform to this spec or are otherwise invalid.'" - extract balance from smart contract

I'm implementing a smart-contract in Plutus and I'm with a doubt. For example, Ethereum has some function only to owners, that enables to implement a withdraw of balance for only owner addresses. I ...
  • 91
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 ...
  • 91
2 votes
1 answer
80 views

How to determine the order of transaction input (in the order of the TxIds)?

If I have the following transaction: cardano-cli transaction build \ --tx-in dd3dbc1cbd4627da3b74fae8c7bcc3f05f3b41ec36feb33f81cf885390b634d6#0 \ --tx-in ...
  • 439
0 votes
1 answer
502 views

How to Get Started with Cardano Native Script

What resources should you use to learn native script and in what order should you use them in?
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, ...
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?
1 vote
1 answer
30 views

Script to only accept payments in 100 Ada

How do i create a simple script that users can deposit ada into but only 100 ada per transactions , nothing less than that and nothing more. The transaction will not go through if it is not 100 Ada.
1 vote
2 answers
41 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 -> ...
1 vote
0 answers
33 views

How to get the address which locked the fund on a smart contract?

I have two users. The first user locks 1 ADA with a Datum at a script address. The second one unlocks the 1 ADA with the same Datum and should now send 5 ADA to user one. Can I now implement a logic ...
1 vote
1 answer
123 views

Script Witness Not Validating for Multisig

I'm getting the following error when trying to consume a UTxO sitting in a multisig script address: [ { "scriptWitnessNotValidating": [ "...
0 votes
2 answers
389 views

How to generate script address from plutus script cborhex

I want to generate the address from the plutus script's cborhex value, but so far without much luck. I am using the alwayssucceeds.plutus contract as an example for which the cborhex value is ...
  • 192
1 vote
2 answers
72 views

Plutus script execution at every end of epoch

I would like to develop a Plutus script that executes each time an epoch ends. What's the best way to achieve this behaviour?
1 vote
1 answer
70 views

How to PlutusTx.compile work with multiple arguments to mkPolicy

I'm on homework 5 of the pioneer program. If I check Signed.hs: {-# INLINABLE mkPolicy #-} mkPolicy :: PaymentPubKeyHash -> () -> ScriptContext -> Bool mkPolicy pkh () ctx = txSignedBy (...
  • 172
4 votes
3 answers
106 views

Discovering the script source based on address

How to find out what scripts / smart contracts are holding my assets and how could I recover these assets if the script allows? I have in my transactions log a transfer of 500 ADA to this script ...
1 vote
2 answers
69 views

Contract deployment in week03 is failing with "beneficiary signature missing"

When running the grab.sh script the following error occurs: ./grab.sh Command failed: transaction build Error: The following scripts have execution failures: the script for transaction input 0 (in ...
  • 31
6 votes
3 answers
698 views

Can ADA locked on a script be staked?

I am curious to know what happens to ADA when it gets locked to a script as far as staking goes. In other words, can ADA locked at a script address by staked?
  • 294
1 vote
0 answers
69 views

script for automation sending tokens [closed]

i just finished my first script and would love to share some ideas and also to listen your opinion for additional development. how the script works and what it does create Log file :) while (looping) ...
  • 321
0 votes
1 answer
108 views

How to build a script transaction if the validator expects it to be signed

Given the following smart contract: {-# INLINEABLE mkValidator #-} mkValidator :: PubKeyHash -> BuiltinData -> ScriptContext -> Bool mkValidator beneficiary _ ctx = traceIfFalse "tx ...
2 votes
5 answers
367 views

How to obtain wallet addresses of stake pool delegators?

I am trying to figure out how to write some scripts that will dish out rewards to delegators on my staking pool - I want to get the wallet addresses of delegators, and determine rewards based on the ...
3 votes
1 answer
86 views

Verifiying a digital signature in a Plutus script

Is there a function like signedBy that I can call in a Plutus script to verify a digital signature?
  • 45
0 votes
1 answer
269 views

How to split transaction into many different UTXOs?

Let's image I want to create a Plutus script, which takes Value as a parameter (ADA or any other coin with specific amount), and locks this value at script's output. How can I split this value into ...
  • 168
0 votes
1 answer
247 views

Hash script data

I want to understand a bit better the hash-script-data functionality from cardano-cli. I checked the source code but had no luck in understanding how this hash is made. From the examples, if we run: ...
  • 206
2 votes
3 answers
717 views

How to get Policy Script for a specific policy-ID

how can i get the script information for a given policyID. I am mostly interested in the "invalidAfter" Slot number. So far i could not find any option for example by using Blockfrost API. ...
  • 23
4 votes
1 answer
162 views

Script unlock cannot submit, budget overspent

I'm trying to unlock some token at a script address, so I create a tx with cardano-cli transaction build ... this passes successfully, then I sign the tx. It is now ready for submit but when I submit ...
3 votes
1 answer
43 views

nix-build alonzo mainnet

I've installed cardano-node via nix-build: git clone https://github.com/input-output-hk/cardano-node cd cardano-node git checkout tags/1.29.0 -b 1_29_0 nix-build -A scripts.mainnet.node -o mainnet-...
  • 433
4 votes
2 answers
110 views

Transaction Notification

is there any tool that sends a notification when a incoming transaction happening on your wallet? Or what is the best way to check it with a script
7 votes
1 answer
204 views

Convert Plutus Address Credential to real-net address

So in Plutus we have the Address type which has two constructors ScriptCredential which is a ValidatorHash or PubKeyCredential which is a PubKeyHash but all these are not encoded in the same way as ...
2 votes
0 answers
116 views

Weird behavior on validation of outputs

So I have a validator that, in particular, checks how many outputs are produced. os = txInfoOutputs info mkValidator :: ... mkValidator = traceIfFalse "Wrong outputs" checkOutput where ...
6 votes
1 answer
133 views

Re-Implementing Policy Hashing in Python

As the title says, I want to to reimplement the hashing part of a policy script in Python 3. I have already made a post over at forums.cardano.org, and someone has pointed me to the right direction of ...
  • 190
16 votes
5 answers
2k views

What is a Redeemer?

So I am currently on lecture 1 on the Plutus Pioneer Program. In the lecture they said the redeemer is the input information that the script uses to decide if a specific UTxO can be spent. I watched a ...