Questions tagged [validator]
For questions about transaction validation. A validator ensures that a submitted transaction is correct and can be added to the ledger.
36 questions
0
votes
1
answer
204
views
Error submitting a transaction (Error: PPViewHashesDontMatch)
I hope I can get help from someone on here. I built a minting transaction on preprod using Lucid that uses a validator that always pass, and I am stuck with this error:
error: Uncaught (in promise) ...
0
votes
1
answer
42
views
UnsafeFromData instance for custom type
I want to use a custom type for one of my policy parameters, which will be applied by a tool like Lucid.
Example of param:
data CoinParams = CoinParams {
policyOwner :: PubKeyHash,
tokenName ::...
0
votes
2
answers
200
views
Lucid Error "End of input in bytes"
I am running the simple vesting script from PPP for the first time with Lucid and I continuosly get an error which doesn't give me much to understand what could realistically be the source of.
the ...
1
vote
1
answer
39
views
Are validator script parameters secure? (lobster challenge)
Since script params are compiled into the validator, this means that if you have the script cbor you can see what the param value is, right? Hence they would not be suitable to store data you don't ...
1
vote
1
answer
81
views
Creating a malicious validator script whose hash equals that of an existing validator script
what is preventing an adversary to find (in many hours) a nonce that would make a malicious validator script to have the same hash and address of my validator script, and then submit it with cardano-...
0
votes
1
answer
90
views
Limit the number for each Token (AssetName) within one Currency Symbol (Policy ID)
is there any way to limit number for each tokens within one minting policy, in Plutus validator?
For example for policy ab12 I want to allow users minting tokens, in different transactions. Сan the ...
0
votes
1
answer
49
views
Opportunity for theft of funds in Martify marketplace
I am some kinda embarrassed by "mkBuyValidator" in Martify Marketplace on-chain code . For buyer there is only one check for token transfer (on line 68):
(valueOf (valuePaidTo info sig) (...
1
vote
3
answers
109
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 -&...
4
votes
1
answer
264
views
Rising trend in blocks missing: what could be the reason? Should we worry?
I came across this fantastic real-time data-visualization site for Cardano: Cardano Blockchain Insights.
My question is: why have the missing blocks increased by so much? Epoch 347 is due to some ...
0
votes
1
answer
52
views
Can I Use TraceIfFalse in deployment?
So I use traceIfFalse to test a lot of my smart contracts now I'm ready to deploy some of then and I want to know if this is for development only or if its fine to have a smart contract use this ...
0
votes
1
answer
43
views
How to have a contract on chain for extended periods of time?
In PPP Larz explains that there's a limit to how long a contract can remain on chain, what is that limit and how do I go about extending it?
1
vote
1
answer
27
views
Do I Need A Contract Monad For a Burn Wallet?
If I make a script address to be a burn address, I end up having a validator that never validates i.e. returns false all the time. Does a Smart Contract that never can validate need an instance of the ...
2
votes
0
answers
41
views
Whats a Good Example of Interconnected Smart Contracts?
In the Contract Monad we have the use of w s e a. Now w is used to connect contracts is there a good example of how this is done, in particular how to validate a contract using the w of another ...
0
votes
3
answers
116
views
How Can You Prevent A Burn Address From Polluting The Cardano Ledger?
Making a Burn Address on the blockchain is currently done by using a script address with a validator that always returns False and so never validates.
This ties up ADA and causes the size of the ...
1
vote
0
answers
11
views
How to Validate A Smart Contract Twice?
I have a smart contract I want to validate at a certain date. Exacute its logic and then revalidate on a second date. The trick is I only want it to be signed once. How do I do this?
can I just add ...
2
votes
1
answer
51
views
How to Make Sure A Contract Is Signed By a Certain Party?
I'm thinking about making a parameterised contract between two users. User A can be anyone i.e. any customer, But User B should always be the company. I want to make it so that the validator only ...
0
votes
1
answer
92
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 ...
0
votes
1
answer
66
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
1
answer
75
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 ...
1
vote
1
answer
54
views
What are the ways to make a validator script start to "live" on-chain?
What are the scenarios in which a validator script will start to "live" on-chain? By "living" on-chain, I mean there is at least one UTxO sitting on the script address.
A trivial ...
0
votes
3
answers
61
views
Ways to ensure at any given time at most one UTxO sitting at the script address that can be consumed
I can think of one solution, which is the validator script checks if a specific NFT is locked by the script address. Because of the nature of the NFT, it ensures there is at most one UTxO sitting at ...
0
votes
2
answers
77
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 ...
2
votes
1
answer
45
views
Validator function in UTxO vs eUTxO model
I'm reading the paper which introduces the eUTxO model and I'm having trouble figuring one specific difference between the standard UTxO validator and the eUTxO validator.
It seems that the only ...
2
votes
0
answers
117
views
Optimising validators with `BuiltinData -> BuiltinData -> BuiltinData -> ()` and building tx with cardano-cli
In one of your previous classes you said that some teams are optimising their contracts with this type of validator BuiltinData -> BuiltinData -> BuiltinData -> () and I'll refer to those ...
1
vote
0
answers
52
views
How do I use Plutus to check that payment has been made to a native script?
If I want to check that payment has been made to a Plutus script, then I can use the function valueLockedBy txinfo vhash where vhash is the ValidatorHash of the Plutus script. Is there an analogous ...
1
vote
1
answer
116
views
Confusion regarding findOwnInput function with on-chain code
Context
I was looking for a simple way to get exact TxOut on on-chain code to validate if funds are to be unlocked to correct wallet address. While looking in plutus haddoc I have found this function:
...
1
vote
0
answers
90
views
Applycode to untyped validator, template Haskell
I am trying to learn the basics of the PlutusTx module. In this module is a function applyCode which maps the signatures CompiledCodeIn uni fun (a -> b) -> CompiledCodeIn uni fun a -> ...
1
vote
1
answer
63
views
How do I call the amount of ADA sent to a validator script in an Integer
I am trying to create a validator function that only lets the user send ADA to the creator of the script if the user sends x amount of ADA how to I find out the amount of ADA the user sent and then ...
4
votes
2
answers
136
views
Can we check signatures of arbitrary data in plutus validators?
I am looking for a function with a type like this:
verifySignature :: Datum -> Signature -> PubKey -> Bool
which is also INLINABLE to use it inside validator.
I know that we can check if the ...
3
votes
1
answer
97
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?
3
votes
0
answers
122
views
Is it possible to use a parameterised CurrencySymbol inside another validator script? Unsupported feature: Type constructor: GHC.Prim.ByteArray#
I am having trouble using a parameterised CurrencySymbol inside another validator script. It seems to work (not shown here) when the currency symbol is unparametrised but not otherwise:
GHC Core to ...
0
votes
1
answer
128
views
How to validate the correctness of another parameterized script address on-chain
I would like to write a factory script that can initialize another parameterized script address by sending it an NFT. The factory validator gets the parameters of the target script as redeemer and has ...
4
votes
1
answer
182
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
326
views
What's the difference between programmable validators and smart contracts?
Charles Hoskinson indicated in this tweet that he favors the term "programmable validator" to the term "smart contract" with regard to Cardano.
Quoting the tweet Charles Hoskinson ...
6
votes
1
answer
540
views
Are transaction witnesses stored on the blockchain?
According to Cardano's ledger spec (page 26), the purpose of witnessing is to make sure that the intended action is authorized by the holder
of the signing key, providing replay protection as a ...
13
votes
2
answers
575
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 ...