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
4
votes
1answer
88 views

Canonical example of Smart Contract Verification?

Given that the chief benefit of Cardano Smart Contracts over Ethereum Smart Contracts is formal verification (and thus its implied validity, security, and robustness), is there a non-trivial example ...
0
votes
2answers
45 views

Is there any script or smart contract which send tokens?

I wondering if is there any script o smart contract example which when i send X ada to a wallet after i receive a native token
0
votes
1answer
29 views

How to deploy a marlowe smart contract on cardano

I'm a beginner, I have the haskell code and I wnat to know the following steps, I couldn't find specific information how can i deploy a smart contract on the mainet or testnet.
0
votes
1answer
41 views

The Plutus script evaluation failed

Running into this error when attempting to build a tx. Command failed: transaction build Error: The following scripts have execution failures: the script for transaction input 1 (in the order of the ...
2
votes
1answer
41 views

Will the size of transaction be affected if the same input script is provided multiple times for different utxos?

If there are multiple --tx-in-script-file for the same plutus script file only with different utxos is that means that multiple times will be sent plutus script and that will affect the size of a ...
0
votes
1answer
34 views

Cardano-cli errors when submitting

I can build and sign a tx with no errors using: cardano-cli transaction build --alonzo-era \ --testnet-magic 8 \ --tx-in 20445d5c68e1759f1371a86ecca773b76463fba3831f128fd2f7834de38ae6ec#0 \ --tx-in ...
1
vote
1answer
31 views

Getting Validator Hash

I'm checking the Value locked by certain ValidatorHash of another script that I deployed. Does anyone know how to get Ledger.Address or ValidatorHash from Plutus or cardano-cli? I know the "...
4
votes
5answers
462 views

Where can I find design and documentation resources for Cardano Smart Contracts?

I’d like to better understand the design and features of the upcoming Cardano smart contracts. Where is the design guidance & documentation posted for them, including their planned functionality, ...
3
votes
1answer
53 views

Do script addresses have a staking part? Is it possible to stake from smart contracts on Cardano?

I heard somewhere that staking from smart contracts may be possible on Cardano, and I wonder if that is because there is a staking part to script addresses on Cardano? CIP 19 discusses wallet ...
4
votes
0answers
110 views

Questioning Plutus API design decision

In Lecture 10 from the Plutus Pioneer Programm there is a replica of the Uniswap Smart Contract built on top of Plutus. It is actually part of the standard Plutus use cases Plutus Uniswap To have a ...
5
votes
2answers
314 views

How to run smart contracts in the Cardano Blockchain?

I know that since Alonzo was launched smart contracts can be published in the blockchain now, but I have no idea how to do it. I have read some articles about the Plutus Application Backend though, it'...
2
votes
1answer
70 views

How to generate the address of a plutus script using Cardano Serialization Lib?

I am sending some smart contracts using the Cardano Serialization Lib and the nami wallet for signing, everything works fine, but I am not able to get the script address of a Plutus Script. I have ...
0
votes
2answers
56 views

How Do I include MP3/Mp4s into my smart contract?

How Do I include MP3/Mp4 capabilities in my smart contract? Im interested in minting songs and short videos as CNFTs but I do not see any information online what so ever about how this can be done. ...
2
votes
1answer
28 views

Retrieve only digit from TokenName and use onchain

How can I make the following function to retrieve only digit portion from the TokenName and use it on chain? For example I want to retrieve the number 123 from "AAA123" (TokenName) {-# ...
1
vote
2answers
81 views

Airdrop Mechanism

I'm trying to find information about native token Airdrops. What is the mechanism? For example, the user send 5 ADA to the wallet of the project and the smart contract will send you back (2.5 x Amount ...
9
votes
3answers
287 views

What is the maximum number of contracts Cardano can store?

I see Ethereum (ETH) can store 2256 smart contracts, so is there any description about this for Cardano, i.e. how many contracts can Cardano store?
2
votes
1answer
57 views

How do I export my .hs contract to .Plutus?

How do I export my .hs contract to .Plutus? Please provide step by step guidance.
0
votes
1answer
12 views

How can I get a POSIXTime in the Contract monad?

I don't see any way to use IO in Contract and I don't see any functions for getting a POSIXTime from the things I can get within Contract.
20
votes
6answers
806 views

General approach for allowing multiple smart contract transactions per block

In some applications, multiple users interact with the same smart contract and may want to do it at about the same time. Such interaction involves updating the state of the smart contract as embodied ...
4
votes
1answer
166 views

Smart Contract NFT minting with Rarities

I'm trying to work out how an NFT collection might be sold on Cardano in the future, specifically by making use of smart contracts. Let's say that I am creating a 10k pfp collection or something of ...
8
votes
4answers
466 views

NFT Royalties before smart contracts

I want to receive royalties every time my NFT is sold. Since there is still no smart contract yet, is it pointless to mint my NFT right now? Is it possible to add the royalty functionality after ...
5
votes
3answers
226 views

What are technical differences in smart contract execution on Cardano in comparison to Ethereum?

In my understanding, smart contracts on Cardano are always provided to the blockchain via a transaction and there is no code that is stored at the blockchain, but just a hash (the public key address). ...
15
votes
5answers
761 views

What exactly 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 ...
2
votes
1answer
40 views

What is the use case of the mustSpendAtLeast constraint?

What I can figure out: mustSpendAtLeast is basically just a wrapper around MustSpendAtLeast. This gets processed here, by adding a required value to this thing. These values get turned into outputs in ...
5
votes
1answer
205 views

Is there a good tutorial to mint Cardano NFT using plutus script?

I used to mint Cardano NFT using "Time locking" following this guide https://developers.cardano.org/docs/native-tokens/minting-nfts/. But I know the more formal way is to use plutus script ...
3
votes
1answer
36 views

Is there a site (or one being developed) that contains a library of Plutus smart contracts?

Can someone direct me to a site where I can search for specific Plutus smart contracts? It would be useful both for inspiration, and also to reduce the amount of redundant work spent creating smart ...
1
vote
1answer
65 views

Pool Rewards distribution via SmartContract

For the Pool I run I would like to setup a SmartContract which automatically claims the rewards and sends a certain percentage to each of three organisation I support. Is such a thing possible with ...
2
votes
1answer
71 views

What is the relation of "ptr" with UTXO?

I am working on an app, I am using Nami wallet and cardano-serialization-lib. When I query UTxO and decode it using cardano-serialization-lib, I get an object with only attribute is something called &...
0
votes
1answer
78 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 ...
7
votes
2answers
169 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 ...
2
votes
1answer
77 views

How to return funds from a smart contract

If I have assets (can be just ADA for simplicity) locked in a contract, how can I release the funds to the previous owners most efficiently? Some more context regarding the question. I created a pay ...
4
votes
1answer
88 views

How to handle datum in a decentralized way?

What is the best practice of storing the local state of an UTXO to be publicly visible on-chain? Thinking about how application would function in the future I thought that in a good DeFi ecosystem all ...
4
votes
2answers
107 views

Is it possible to withdraw rewards with smart-contracts?

I would like to automatically withdraw my rewards and send it in different wallets. Is it already technically possible? Thanks, Regards, Anthony Edit - A Use Case for this: A possible use case for ...
5
votes
2answers
170 views

How to publish a smart contract on the blockchain?

Let's say I have a Plutus contract written up. How do I actually submit it to the blockchain and start interacting with it?
6
votes
3answers
232 views

Is there anyway to cancel payment or revert a payment

Recently I came across a situation: a payment was executed by a customer on a site but then the consumer changed his mind. What levels of transaction revert of such activity can be done? e.g. X ...
1
vote
1answer
24 views

Parse error on input ']' when running cabal build in my Plutus code

I have a code that compiles and runs well in the Plutus playground, but when I try to run cabal build I get an error when calling mkTypedValidator: offerValidator :: Scripts.TypedValidator Offer ...
7
votes
2answers
151 views

How can an oracle guarantee certain update rates respectively uptime?

After reading the question General approach for allowing multiple smart contract transactions per block I'm wondering how an oracle can guarantee update rates respectively uptime. If too many ...
0
votes
1answer
55 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 ...
2
votes
2answers
32 views

would anyone reply/share who is working on inventory and shipping solutions with Cardano?

would anyone reply/share who is working on inventory and shipping solutions with Cardano? storage shipping automation price quotes samples contracts distribution
2
votes
1answer
60 views

Getting the address of a parameterized contract from within the validator of another script

Suppose I have one contract, Contract 1, that is parameterized by type Contract1Params{ tokenName :: BuiltinByteString } and I have a minting policy that will only mint a token with tokenName tn ...
1
vote
0answers
85 views

Impossible to use extended keys with cardano-cli transaction build --required-signer flag

We are implementing the vesting contract from Plutus use cases via cardano-cli In the validator script we have the pubKeyHash of the pubKey authorized to retrieve the funds. When the owner of this key ...
0
votes
1answer
69 views

Deploy a smart Contract on Alonzo testnet

Hi I have written a contract in Plutus and test it with PAB and Playground simulations. The problem I am facing is I cannot find any proper documentation on how to deploy a contract on the test/main ...
0
votes
2answers
39 views

Advanced Payment Integration

I understand this is all new and still very early but I'm wondering if more advanced payment integration is possible. I went through the example of accepting payments, but I have an app releasing soon ...
1
vote
1answer
76 views

I have a smart contract in Ethereum. Is there a way to migrate it over to Cardano?

I have a smart contract for an NFT in Ethereum and I'd like to put it in the Cardano eco system as well. How can I do that? Is there any 'smart contract bridge' through which I can port it over?
5
votes
2answers
151 views

Documentation for smart contract deployment on testnet & mainnet

Can somebody point out where I can get the doc for smart contract deployment on testnet & mainnet? I am testing on plutus playground now and would deploy on testnet to try. Thanks in advance.
0
votes
1answer
99 views

How do I set up a smart contract?

I want to request a payment from a business via a smart contract, do I need to know how to code the contract myself? I’d also appreciate some guidance on the following; What do both parties need to ...
0
votes
0answers
41 views

Why canot deploy smart contracts to the KEVM testnet using mellat?

Recently I want to deploy a smart contract to the KEVM and EVM testnet using mellat, but after a few minutes of the deployment, I cannot find the transaction in the KEVM or EVM explorer using that ...
2
votes
1answer
164 views

How to create a programmable NFT?

Is it possible to create a gif or video NFT? For example, every time the user clicks on the image, an animation plays once or on repeat over the image. I do not see any guides on this and would ...
9
votes
3answers
280 views

How will DApps work on Cardano?

This may been too broad of a question but I was hoping to ask a few specific questions here rather than over multiple questions. I don't think DApps are available yet but I'm sure people have started ...
1
vote
1answer
100 views

Should I use Marlowe or Plutus to create my native token?

Should I use Marlowe or Plutus to create my token? I also want to create a TCG in which my token will have an utility. Where should i start? (tutorial, how-to, examples ...).