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
22 votes
1 answer
236 views

Randomness in a smart contract

Is it possible to get randomness in a smart contract? E.g. I would like the validator to randomly choose between two conditions to use to validate a transaction. Such a capability could be used for ...
user avatar
  • 1,275
20 votes
6 answers
945 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 ...
user avatar
  • 1,275
18 votes
2 answers
275 views

How can smart contracts interact each other?

If the "context" of a smart contract can see only the transaction where it sits and its inputs-outputs, how can a smart contract interact with other smart contracts living in different ...
user avatar
16 votes
5 answers
1k 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 ...
user avatar
15 votes
3 answers
400 views

What's the difference between "on-chain" and "off-chain" in plutus smart contracts?

Smart contracts written in Plutus can be divided in two: an on-chain part and an off-chain part. What's the main difference between these two?
user avatar
14 votes
2 answers
888 views

Where does a smart contract exist, in EUTxO?

In particular, I want to know whether the smart contract is somehow its own entity in the blockchain, or if a smart contract is just a property that EUTxOs may pick up. EUTxOs are bound by smart ...
user avatar
14 votes
6 answers
2k views

The Concurrency Issue

Are there any solutions to the concurrency issue so far without sacrificing decentralization? MinSwap testnet was experiencing this last night and just looking for some clarification, haven't seen ...
user avatar
  • 221
13 votes
1 answer
180 views

Transaction fees and smart contract complexity

I've read here and there, perhaps incorrectly, that the transaction fees depend on the size of the transaction (in bytes). However, with smart contracts, the difficulty to process a transaction is not ...
user avatar
  • 701
12 votes
1 answer
560 views

Where is stored off-chain code?

As I understand, a smart contract in Cardano contains on-chain code and off-chain code. On-chain code is executed by cardano nodes in order to validate transaction. Off-chain code builds a ...
user avatar
  • 1,644
12 votes
1 answer
78 views

Are the locked funds in a contract still considered as delegated to a wallet and can get staking rewards?

The question here is if script-locked outputs can still have a staking key associated with them (decided by the person creating the output) and whether this enables the funds to be delegated in a ...
user avatar
  • 1,072
11 votes
1 answer
145 views

How can I write unit tests for Plutus contracts?

I'm a member of Plutus Pioneer Program. I already know about the Plutus Playground and like it very much. However, clicking all the blockchain action scenarios each time is very time-consuming, ...
user avatar
  • 766
11 votes
2 answers
113 views

Where can I find design and documentation resources on Plutus Staking smartcontracts?

When I was exploring haddock of Plutus I have found that Plutus script can have Rewarding ScriptPurpose: data ScriptPurpose = Minting CurrencySymbol | Spending TxOutRef | Rewarding ...
user avatar
9 votes
3 answers
369 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?
user avatar
9 votes
2 answers
434 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 ...
user avatar
9 votes
3 answers
329 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 ...
user avatar
  • 516
9 votes
2 answers
342 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 ...
user avatar
  • 766
8 votes
4 answers
543 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 ...
user avatar
  • 103
8 votes
1 answer
110 views

When smart contracts launch, will every node on the network have to run every contract transaction?

When smart contracts launch, will every node (relay and producer) have to execute all contracts executions, and therefore all see the same increase in resource usage? My inkling is that they have to (...
user avatar
8 votes
2 answers
120 views

Why Strict Evaluation Operator "!" used in record definition implemented in Plutus Core?

While declaring records for use in Plutus strict operator is used like this: data Auction = Auction { aSeller :: !PubKeyHash , aDeadline :: !Slot , aMinBid :: !Integer , aCurrency :: !...
user avatar
  • 1,794
8 votes
1 answer
148 views

How to stake a smart contract's money?

Is it possible to delegate the money locked in a smart contract? And how? Using what haskell instructions?
user avatar
  • 701
8 votes
4 answers
339 views

Are there any plans to have a bridge between the Cardano and Cosmos blockchains?

Are there any plans to have a bridge between the Cardano and Cosmos blockchains? Cosmos is working on the gravity-bridge which is a bridge between Ethereum and Cosmos so I assume there must be some ...
user avatar
8 votes
1 answer
93 views

Cardano-Ethereum Bridge

What is the best way to write a smart contract that will work across both Cardano and Ethereum? It doesn't have to be released yet but preferably something that will be usable by the end of the year. ...
user avatar
7 votes
1 answer
109 views

Can Marlowe contracts involve native assets?

Can Marlowe contracts involve native assets? For example if I want to issue a bond denominated in USDC
user avatar
7 votes
2 answers
1k views

Creating Cardano Non-Fungible Tokens with royalties for newbies

I've been looking around since last week and I need directions to create my own non-fungible tokens with royalties. Do I need to learn how to create a smart contract for this myself? or are there ...
user avatar
7 votes
3 answers
247 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). ...
user avatar
7 votes
2 answers
133 views

Referencing onchain contract as 3rd party

In solidity and EVM, it is possible to reference external contracts by providing the address and interface to the contract: address ckAddress = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d; ...
user avatar
  • 161
7 votes
1 answer
206 views

Is there an equivalent to the Wallet Connect protocol in the Cardano ecosystem?

With the Alonzo update approaching, many teams seem to be working on DeFi projects that will go out along the Smart Contracts feature. On Ethereum, most DeFi projects use the Wallet Connect open ...
user avatar
  • 433
7 votes
1 answer
249 views

How are unused/outdated smart contracts handled on Cardano?

How will unused, outdated smart contracts be handled? Or say a developer makes a mistake in the contract and needs to redeploy it, what happens to that old contract? Would a lot of Unused contracts ...
user avatar
7 votes
1 answer
66 views

What is the maximum timeout for a contract that you can define in Marlowe?

We know that Marlowe contracts always end mandatorily because a maximum timeout is defined. I wonder what the maximum timeout is, it seems like you can put a huge epoch/slot in which would be ...
user avatar
  • 1,072
7 votes
1 answer
168 views

on multiple eUTxO and the validation proces

I have an in-depth question that needs good knowledge of the ledger rules. I was thinking about how to program efficiently and design apps such that they are parallelizable, a good practice for ...
user avatar
  • 886
7 votes
2 answers
174 views

Is it possible to make multiple transactions atomic?

A concrete example would be flash loans, where you could borrow some value from a lending script, do something interesting with it, and return the borrowed amount to the script with a fee, all in one ...
user avatar
7 votes
4 answers
249 views

What are the best solutions for randomness in Cardano?

I would like to create a gambling Dapp and for this I need a provably fair RNG. What are the best solutions for provably fair randomness in Cardano Will Cardano add Chainlink VRF in the future?
user avatar
  • 71
7 votes
4 answers
185 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 ...
user avatar
6 votes
2 answers
269 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?
user avatar
6 votes
1 answer
81 views

How to know if a transaction (tx) succeed or failed after awaitTxConfirmed?

How to know if a transaction (tx) succeed or fail after awaitTxConfirmed? Is there any function to get a tx on-chain by TxId?
user avatar
6 votes
1 answer
498 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 ...
user avatar
  • 61
6 votes
3 answers
366 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 ...
user avatar
  • 73
6 votes
2 answers
823 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'...
user avatar
6 votes
1 answer
250 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 ...
user avatar
5 votes
2 answers
142 views

Can you write dapps in C based languages?

Are there any good YouTube videos that are walk-through style for using a C-based language to write smart contracts, issue tokens and create NFTs?
user avatar
5 votes
2 answers
301 views

How can smart-contract disputes be addressed?

How will disputes in a smart-contract obligation be managed? How is fraud prevented if a party does not fulfil an obligation? When there are various jurisdictions, there may be different governing ...
user avatar
  • 51
5 votes
2 answers
161 views

Pioneer Lecture 4 recursion - how is it not infinite?

In the solution for the Lecture #4 (cohort 1 I guess, I'm following on Youtube) payContract :: Contract () PaySchema Text () payContract = do pp <- endpoint @"pay" let tx = ...
user avatar
  • 195
5 votes
1 answer
198 views

When actually a validator is deployed to the blockchain?

I'm re-watching the Plutus Pioneer Program and in the video #2 I don't exactly get it here: https://youtu.be/E5KRk5y9KjQ?t=1782 There's the same contract code used by Wallet1 and Wallet2. Each of them ...
user avatar
  • 766
5 votes
4 answers
340 views

Node.js - Plutus/Haskell Wrapper

Do you think a Node.js/JavaScript Wrapper for the Plutus programming language (I think it was Haskell?) is possible? This would bring millions of developers onto the Cardano ecosystem and their smart ...
user avatar
5 votes
1 answer
64 views

Logistics of Developing Contracts

We've done a lot of development on the Plutus Playground; in what ways will the logistics of developing and deploying contracts differ in Gougen?
user avatar
  • 677
5 votes
1 answer
101 views

Cardano Smart Contract Architecture Diagrams?

I am a "big picture" kind of person (yes, INTJ) and I am looking for a high-level overview of the Cardano Smart Contract Architecture. Did a preliminary google search and read a few articles ...
user avatar
5 votes
1 answer
243 views

What does two consecutive apostrophes mean in Haskell and Plutus?

I have noticed the frequent appearance of two consecutive apostrophes in Haskell code. Like this: newtype Date = Date Integer data EndDate = Fixed Integer | Never unstableMakeIsData ''Date ...
user avatar
  • 433
5 votes
5 answers
480 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, ...
user avatar
  • 51
5 votes
1 answer
179 views

Change minted tokens recepient

I am trying to create a dApp in which "accounts" are authenticated using a minting policy script. It should work by only allowing the minting of tokens if they are sent to an arbitrary ...
user avatar
  • 753
5 votes
1 answer
79 views

Should I hold ADA as company to pay fees and issue Native Tokens for my game?

As far I know Carano will allow to pay fees in Native Tokens, so fees will be on ADA + a reward. But I have questions about it after reading this blog post from IOHK. If I'm running the economy of my ...
user avatar

1
2 3 4 5