Questions tagged [smart-contract]

A digital agreement that specifies where funds/tokens/assets should go, and under what conditions they will be sent, executing a deal only when all the conditions are met.

Filter by
Sorted by
Tagged with
1 vote
1 answer
14 views

How to convert Address type variable to get "addr_testXXX" format address?

In plutus endpoint, I want to convert Address type value to get addr_testXXX format address. I have try : import Cardano.Api ( SerialiseAddress (deserialiseAddress, serialiseAddress) ) ... -- here, ...
user avatar
0 votes
0 answers
9 views

How To Convert Old Plutus Scripts to Vasil Reference Scripts?

One of the fun things, the Vasil hardfork gives us is the ability to reduce the size of transactions and so put more of them into a block (speeding up the chain). My question is how to change the ...
user avatar
2 votes
1 answer
26 views

How to create an unspent UTXO with specific value

I want to create a script (smart-contract) utxo with a specific number of tokens (it can be an output of a transaction before) in cardano-serialization-lib - javascript. I need this utxo to be part of ...
user avatar
  • 69
0 votes
1 answer
28 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?
user avatar
0 votes
1 answer
30 views

How to Securely Serialise a Plutus Smart Contract Endpoint?

Assuming I made an arbitrary smart contract and want to serialise the endpoint after I have the validator hash and address hash, what should I do to ensure that the serialisation is as safe as ...
user avatar
1 vote
1 answer
29 views

Is possible to create a cNFT that depends on 'proof of ownership' in order to be own by a wallet?

I'm thinking on a way to create a cNFT that requires 'proof of ownership' to be minted and own by a wallet, by proof of ownership I refer to something the receipt owns and can pass to others or loss, ...
user avatar
  • 113
0 votes
1 answer
16 views

How can I check the origin of a Token?

A smart contract minted a Token and send it to my wallet, after a time has passed how can I check if that smart-contract in specific did mint the token?
user avatar
0 votes
1 answer
16 views

Where Do I Go To Find All The ScriptContexts Feilds and Functions?

Hi im getting lost in the documentation, I have found some things I was looking for but am failing to find the info and functions for script contents. Im using this link https://playground.plutus....
user avatar
0 votes
1 answer
25 views

Whats the function to get the current time in Plutus?

Im using the time module in the ledger class to do some custom validation logic, but everything is done as intervals and I cant find the function that gets the current time. What is it?
user avatar
0 votes
2 answers
39 views

How to securely call Blockfrost or other API service from Smart Contract?

I just spent a few days trying to find a way to access account data from a smart contract using only plutus. Turns out IOG has yet to put that functionality in (at least that's how I understand it) ...
user avatar
0 votes
1 answer
15 views

How to get transaction info of a pkh?

Given a PubKeyHash (pkh) how can I get the history of that pkh transactions from within a plutus contract?
user avatar
0 votes
1 answer
10 views

How To Get Address Transaction history into Smart Contract?

If I want the smart contract to alter functionality depending of the history of the signing address, how do I access the history from within the smart contract?
user avatar
0 votes
1 answer
10 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 ...
user avatar
1 vote
0 answers
16 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 ...
user avatar
2 votes
2 answers
43 views

Is there a place where we can find the Haskell library for Marlowe?

I investigated some Code examples, in haskell for Marlowe smart-contract, and used the "cabal repl" with the " :i " command, like this: *Main> :i ValueEQ type Observation :: * ...
user avatar
0 votes
0 answers
20 views

guess game stuck in "Waiting for script to have a UTxO of at least 1 lovelace"

I have this program which uses the guessGame example, in the testnet, which gets stuck at "Waiting for script to have a UTxO of at least 1 lovelace" when executing "guess": main=...
user avatar
0 votes
1 answer
27 views

How Long Can A Contract Stay On Chain After Validation?

So I have a smart contract that will validate and do some action X but I then require it to wait for user action for a time T and then perform action Y. Questions: What are the limits on T (how long ...
user avatar
2 votes
2 answers
39 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 ...
user avatar
0 votes
1 answer
53 views

valuepaidto - 3 tokens (plus existent) - how to limit the maximum

I'm trying to verify if X tokens are paid to the signer in a smartcontract. I'm using: numTokens = assetClassValueOf (valuePaidTo info (owner ustate)) (AssetClass(policyToken contractInfo, TokenName(...
user avatar
  • 69
0 votes
1 answer
14 views

Why does forgeContract receives a PubKeyHash?

The forgeContract is responsible for minting NFT's and in the arguments we have a token name and amount, why do we have a public hash key for minting NFT?
user avatar
0 votes
0 answers
8 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 ...
user avatar
0 votes
0 answers
10 views

How to Look Up a Token Policy ID from The Smart Contract Validator

I have attached a token to the datum and sent it to the smart contract, now I need the validator to check that the token has a certain policy ID before it allows the contract to proceed. How do I do ...
user avatar
2 votes
2 answers
33 views

ADA handle NFT royalty address

Is it possible to use an ADA handle as the address for NFT royalties? I’d like a way of changing the address that royalties get sent to if I decide to sell my project in the future. Maybe it would be ...
user avatar
  • 23
3 votes
2 answers
33 views

How to Get the Script Address of A Smart Contract?

Once I have written up the smart contract how to I get the script address value to be able to interact with the script whilst its on chain?
user avatar
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 ...
user avatar
0 votes
0 answers
10 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 ...
user avatar
0 votes
2 answers
21 views

What are the options for Bitcoin integration on Cardano?

What are the options for Bitcoin integration on Cardano? Is there a way to allow users to deposit BTC, have smart contract rules that adjust balances (based on signed app specific transactions), ...
user avatar
  • 101
1 vote
0 answers
12 views

How to Send A Token to an Smart Contract Alongside a Datum?

I asked another question (How to Make Sure A Contract Is Signed By a Certain Party?) and got the answer I expected. It raised the secondary Question of how to send a token with a datum to a smart ...
user avatar
3 votes
1 answer
57 views

Referencing (U)TxO's

When Vasil HF is here with the new plutus version, can we only reference unspent transaction outputs or even spent ones? Is there some documentation on these newly added functions? Preferably haddock ...
user avatar
  • 896
2 votes
1 answer
41 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 ...
user avatar
0 votes
1 answer
28 views

Can't create ```TokenName``` using ```tokenName``` with error ```GHC Core to PLC plugin: E042:Error: Unsupported feature: ...```

I'm not sure is relevant but the code in question is for a generic Validator (with Datums and Redeemers) used to get a forwarded minting policy the problem should be clear from the title, I can't get ...
user avatar
  • 392
1 vote
1 answer
22 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 ...
user avatar
  • 69
1 vote
0 answers
28 views

transaction build Error: Non-Ada assets are unbalanced (sending native asset to smart contract via cardano-cli 1.34.1)

I have a wallet with the following two UTXOs: a2e38168473ae7f42e86ac274733004b36a1e119b665a5dae9a799e3a6a9c47a#1 Contains pure ADA balance ...
user avatar
  • 111
0 votes
1 answer
55 views

Attaching Datum Value with CSL 10.x

I generate my datum like so: // Build datum const sellerAddressPKH = changeAddressValue.slice(2,58); const datumFields = CSL.PlutusList.new(); datumFields.add(CSL.PlutusData.new_integer(CSL.BigInt....
user avatar
  • 111
0 votes
0 answers
8 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 ...
user avatar
2 votes
1 answer
61 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 ...
user avatar
  • 753
1 vote
0 answers
22 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?
user avatar
0 votes
0 answers
3 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 ...
user avatar
4 votes
1 answer
142 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?
user avatar
1 vote
1 answer
40 views

How can a validator script be used to mint native tokens, in addition to perform other checks?

Suppose we want a smart contract (validator script) that locks a user' fund (e.g. ADA) that she deposits and releases it back if she withdraws it. Suppose when she deposits some fund into the ...
user avatar
  • 39
1 vote
2 answers
55 views

Can a contract update the metadata of the NFTs in an entire policy or does this have to be done by a node manually?

Given a policy with a list of non-fungible tokens, Could a smart contract update the metadata of all NFTs in the collection, under certain conditions? If not, could this be done "manually" ...
user avatar
0 votes
0 answers
19 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 ...
user avatar
1 vote
2 answers
31 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 -> ...
user avatar
1 vote
1 answer
51 views

How do you make a faucet for native assets such as NFTS on cardano?

im trying to make an NFT faucet for a NFT drop. How do I make the basic faucet is there an example that I could build upon?
user avatar
2 votes
1 answer
57 views

How expressive & secure is the Plutarch eDSL?

The Plutarch eDSL tries to control how plutus core is generated to create a smaller and thus a more efficient validator script (their GitHub). I am not an in depth user of this tool. Does its approach ...
user avatar
  • 896
1 vote
2 answers
47 views

How to allow non deterministic spent output

I would like a validator (or a minting policy) to succeed always but only to spend the output if some conditions are met; an example use case of such behaviour is to allow burning token (kind of a &...
user avatar
  • 392
2 votes
1 answer
41 views

How to take powers in validator

I was trying to implement some El Gamal cryptography in plutus, basic verification of statements. But while trying to implement an efficient modular exponential function I noticed that the current ...
user avatar
  • 896
0 votes
0 answers
16 views

What does collectFromScript return?

I am not very familiar with Haskell and can't figure out what this function returns. collectFromScript :: forall i o. Map TxOutRef ChainIndexTxOut -> i -> TxConstraints I o is it a list of ...
user avatar
2 votes
2 answers
65 views

can't understand which part of the code is not "PlutusTx"

I'm trying to write a very simple NFT minting policy myself and I can't get rid of the following error Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a ...
user avatar
  • 392
0 votes
1 answer
63 views

Select only one UTxO from script address

I need to get only one UTxO from the script address, where its datum hash matches the redeemer hash. For example I have locked two UTxO with 10 Ada and the DatumHash "house" at the script ...
user avatar

1
2 3 4 5