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
25 votes
1 answer
341 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 ...
Joshua Chia's user avatar
  • 1,335
20 votes
6 answers
1k 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 ...
Joshua Chia's user avatar
  • 1,335
19 votes
2 answers
344 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 ...
Aron Neewart's user avatar
17 votes
5 answers
2k views

What 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 ...
szhang9921's user avatar
16 votes
4 answers
1k views

On-chain and off-chain for Plutus SCs

Hi I am currently at lecture 5 of the Plutus Pioneers Programm and I was wondering which part of the code is on chain and which is offchain. I know that the valididation script is onchain but the ...
Pierre Previsionz's user avatar
16 votes
3 answers
657 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?
Aron Neewart's user avatar
14 votes
2 answers
988 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 ...
Matthew Capps's 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 ...
anonymous's user avatar
  • 231
14 votes
2 answers
540 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 ...
emesik's user avatar
  • 876
13 votes
1 answer
663 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 ...
georgeos's user avatar
  • 1,764
13 votes
1 answer
195 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 ...
Distic's user avatar
  • 701
12 votes
2 answers
181 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 ...
KugisMugis's user avatar
12 votes
1 answer
81 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 ...
adatainment's user avatar
  • 1,092
11 votes
2 answers
218 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, ...
emesik's user avatar
  • 876
10 votes
3 answers
352 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 ...
Cavenfish's user avatar
  • 526
10 votes
3 answers
285 views

How to properly start a new Plutus project, from scratch

I'm from ETH's ecosystem and recently just decided to get into Cardano development, specifically Plutus dev work thanks to Demeter.Run, and after going through the Plutus starters on there, I noticed ...
0xDaito's user avatar
  • 101
9 votes
2 answers
463 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?
Rong Nguyen's user avatar
9 votes
2 answers
642 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 ...
Tam Edward's user avatar
8 votes
2 answers
505 views

I am completely new to Cardano eco system. To learn it from the absolute basic, where do I start?

This is a broad question but I am sure many might have this in their mind. I am an upcoming blockchain engineer and my exposure to Cardano eco system is limited to buying the ADA cryptocurrency and ...
Goodguy Charlie's user avatar
8 votes
4 answers
649 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 ...
Rom's user avatar
  • 103
8 votes
3 answers
270 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). ...
Johannes Sirsch's user avatar
8 votes
1 answer
112 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 (...
Danny Tuppeny - CODER's user avatar
8 votes
2 answers
164 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; ...
Alan Saw's user avatar
  • 171
8 votes
1 answer
273 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 ...
LaX's user avatar
  • 443
8 votes
2 answers
141 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 :: !...
raghu's user avatar
  • 1,834
8 votes
4 answers
358 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?
Hanno's user avatar
  • 81
8 votes
1 answer
165 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?
Distic's user avatar
  • 701
8 votes
4 answers
378 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 ...
Eddy Schauman-Haigh's user avatar
8 votes
1 answer
99 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. ...
Eddy Schauman-Haigh's user avatar
7 votes
1 answer
132 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 ...
notvitalik's user avatar
7 votes
1 answer
280 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 ...
Mitchell Malinin's user avatar
7 votes
1 answer
92 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 ...
adatainment's user avatar
  • 1,092
7 votes
2 answers
231 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 ...
Fermat's user avatar
  • 1,872
7 votes
2 answers
232 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 ...
Mitchell Turner's user avatar
7 votes
1 answer
107 views

I am looking for a practical example of a smart contract with three parties

I would like to know if the following scenario involving three parties could make sense in the context of a smart contract. I am new to blockchain and smart contracts, I have come across some standard ...
Ancientone's user avatar
7 votes
4 answers
203 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 ...
Johannes Sirsch's user avatar
7 votes
1 answer
287 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 ...
Marco Jakob's user avatar
6 votes
2 answers
340 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?
Blake Brown's user avatar
6 votes
1 answer
228 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 ...
emesik's user avatar
  • 876
6 votes
1 answer
638 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 ...
Michael's user avatar
  • 61
6 votes
1 answer
307 views

How do I deploy a smart contract from another smart contract?

If I want to create one top level contract for creating a bunch of other, similar contracts, lets say a top level Uniswap contract that creates liquidity pool contracts and keeps track of the total ...
yoyobigmanyo's user avatar
6 votes
1 answer
88 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?
Nguyen Le Vu Long's user avatar
6 votes
4 answers
405 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 ...
Stanislav H.'s user avatar
6 votes
3 answers
466 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 ...
Amit's user avatar
  • 73
6 votes
2 answers
1k 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'...
Oscar Hasan Putra's user avatar
5 votes
2 answers
149 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?
ChannelJuanNews's user avatar
5 votes
2 answers
306 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 ...
Steve G's user avatar
  • 51
5 votes
2 answers
181 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 = ...
marcel_g's user avatar
  • 239
5 votes
1 answer
65 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?
KIJIRI's user avatar
  • 687

1
2 3 4 5 6