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
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 ...
19
votes
1answer
125 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 ...
18
votes
2answers
192 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 ...
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 ...
13
votes
3answers
236 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?
13
votes
1answer
152 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 ...
12
votes
6answers
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 ...
11
votes
2answers
695 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 ...
11
votes
1answer
64 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 ...
10
votes
1answer
114 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, ...
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?
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 ...
9
votes
1answer
388 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 ...
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 ...
8
votes
1answer
105 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 (...
8
votes
2answers
102 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 :: !...
8
votes
1answer
85 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. ...
7
votes
1answer
88 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
7
votes
2answers
840 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 ...
7
votes
1answer
147 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 ...
7
votes
2answers
107 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; ...
7
votes
1answer
222 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 ...
7
votes
2answers
170 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 ...
7
votes
1answer
135 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?
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 ...
6
votes
1answer
73 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?
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 ...
6
votes
1answer
50 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 ...
6
votes
3answers
230 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 ...
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?
5
votes
2answers
132 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?
5
votes
2answers
291 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 ...
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 ...
5
votes
2answers
140 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 = ...
5
votes
1answer
170 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 ...
5
votes
4answers
258 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 ...
5
votes
1answer
95 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 ...
5
votes
1answer
142 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 ...
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). ...
5
votes
1answer
60 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?
5
votes
1answer
118 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 ...
5
votes
1answer
68 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 ...
5
votes
1answer
91 views

Writing basic validator scripts

I need someone to explain to me line by line. The code is from plutu tutorials. https://docs.cardano.org/projects/plutus/en/latest/plutus/tutorials/basic-validators.html All the code in that page I ...
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.
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'...
4
votes
2answers
119 views

Can smart contracts be used to mint native assets?

Cardano doesn't need to use smart contracts to mint native assets. But is it possible to mint native assets using smart contracts? And if so, is there an example how this can be done?
4
votes
1answer
110 views

Can a smart contract read the presence of an NFT in the redeemers wallet?

I want to use an NFT as a form of authentication for a Plutus contract. I know I can attach the NFT in the Datum when constructing the transaction and return the NFT in the output however I am worried ...
4
votes
1answer
207 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 ...
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, ...
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 ...