Questions tagged [validator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
30 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) (...
0 votes
0 answers
14 views

Plutus on chain validator can't reached after submitting transaction to unlock the fund at a script address

From this EvenOdd.hs of PPP week 07, I tried to modify and implement this use case User A set a number as target (aka targetKm) with amount of ADA locked User A submit another number (aka submittedKm)...
0 votes
3 answers
52 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 ...
1 vote
3 answers
56 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 -&...
1 vote
1 answer
34 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
1 answer
31 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 ...
0 votes
1 answer
53 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 ...
13 votes
2 answers
432 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 ...
1 vote
1 answer
18 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 ...
4 votes
1 answer
192 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
23 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
37 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?
0 votes
0 answers
18 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
0 answers
33 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 ...
1 vote
0 answers
9 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 ...
0 votes
0 answers
12 views

How to Sign a Smart Contract From a Smart Contract?

I want to run a smart contract (that the user signs) and then wait 10 days and send some ADA from the user's wallet to another address. I can do the waiting with POSXIT Time but if there is not ...
2 votes
1 answer
43 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
41 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 ...
3 votes
1 answer
78 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?
1 vote
1 answer
30 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
2 answers
61 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
32 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
101 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
1 answer
59 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 ...
1 vote
0 answers
37 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
63 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
61 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 -> ...
2 votes
2 answers
83 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
0 answers
88 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
87 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
0 answers
152 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
227 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 ...
5 votes
1 answer
260 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 ...