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
0
votes
1answer
24 views

Question about funds in the "burned" example

On the "burned" example*, do those burnt tokens go back to being available from the reserve and to be rewarded back to circulation or are they locked and lost forever ? If so, then is it ...
0
votes
1answer
18 views

How can I mint/sell bundles of NFTs as a pack?

There are many use cases for bundling NFTS. Example: If I am creating a Trading card game and have packs of multiple NFTs (6 cards). How do I make users purchase my packs of of 6 cards. I thought pre-...
6
votes
1answer
95 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 ...
-2
votes
0answers
17 views

Create Packs of 8 random NFT?

I want to send my users pack of 8 Random NFTs from my collection when they send X Ada to my wallet or to the Script address. Can You guide me what will be the best workflow to achieve this task?
3
votes
0answers
26 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 ...
3
votes
1answer
75 views

Does a script always have the same address forever?

When creating a script, the script is given a script address. If I would like to run multiple scripts in parallel, how to go about that? Do I have to define a nonce variable just to make the address ...
3
votes
1answer
79 views

Is eUTxO a generalisation of UTxO

To me it sounds like UTxO is a very specific implementation of the more general eUTxO protocol. So could eUTxO be (in theory) be used to implement UTxO? Not that one would - but just to understand the ...
0
votes
1answer
20 views

Does the redeemer have to be from a wallet address/contract?

Could a contract be programmed such that the redeemer seemingly comes from nowhere from what the node / someone monitoring the blockchain could tell? I am thinking if you gave the contract some ada ...
0
votes
1answer
29 views

How to create a smart contract constant variable?

I am using state machines to create a smart contract. How can I create a variable that will be defined by the user when it runs the first step of the state machine and that then can't be modified ...
0
votes
0answers
10 views

Exchange in local currency

How does Cardano wallet handle tokens and exchange in local currency? I am looking to establish a mobile money transfer wallet with Cardano, for the sub- Saharan Africa market where cash flow is king ...
0
votes
1answer
37 views

Errors when starting plutus-playground.server

I have built, run, compiled, simulated, and evaluated on my local nix server/client env. I am running Ubuntu 21.04, Kernal 5.11.0-46lowlatency. Here is the terminal output: [Info] Running: (Nothing,...
1
vote
2answers
24 views

How to make certain script inputs available only to the script iself?

How can I approach a smart contract design that would allow me to encrypt inputs from multiple transactions and allow only the smart contract itself to be able to decrypt this data? Use case example: ...
0
votes
0answers
12 views

Is there an OpenZeppelin like library for Cardano?

Developers on EVM compatible blockchains can make use of battle-tested libraries of smart contracts using https://github.com/OpenZeppelin/openzeppelin-contracts I'm thinking about having a basic ...
0
votes
3answers
61 views

How to pass TxOutDatumNone when building a script transaction with cardano-cli

I'm trying to consume a UTxO from a script address. When querying the script address with cardano-cli query utxo, I have the following UTxO: TxHash ...
3
votes
1answer
60 views

Need Help finding error in my endpoint code

I cant seem to figure out whats going on? Ive been trying to create a transaction which sends ADA to a specified wallet address and can't seem to get it to work. type Schema = Endpoint "...
0
votes
1answer
36 views

How to get information about UTxOs which created locking transaction on the on-chain?

I would like to create a smartcontract which makes sure that only the same person who made specific locking transaction can unlock that same specific transaction or to put it into simpler terms if Bob ...
1
vote
0answers
22 views

How to mint mint NFT with StateMachine

I would like to mint an NFT in a particular state of the state machine Does anyone know where I can find some examples?
1
vote
1answer
51 views

Can you manually list an address in a Smart Contract

Can you manually list a wallet address in a smart contract transaction? For example lets say I create a smart contract that allows any user to send Ada to a specific address by sending it to the ...
0
votes
1answer
23 views

How to parse PubKeyHash hash into a Plutus Smart Contract for on Chain Validation

I am trying to use a PubKeyHash as a variable in my on-Chain code, something like this: pkh :: PubKeyHash pkh = "dca6035712f164db2f99c71404d392115d2bdde366fbbe359ae01f1d" But this does not ...
2
votes
1answer
49 views

What does the txOutValue refer to?

What is the txOutValue in reference to in a validator script? Is it the output value sent to the script by a wallet or is it the value sent by the script after compilation? Also what does the ...
0
votes
0answers
21 views

validation and minting policy script

I am trying to create transaction in which a user interacts with a validator script by sending it 30 ADA.I want the validator script to then send the user a native token while sending the creator of ...
0
votes
1answer
174 views

Error submiting Smart Contract with Nami, What does this error means?

I am running one smart contract with the Nami Wallet but I get this error: ""transaction submit error ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (...
0
votes
1answer
34 views

Question about Plutus smart contract which always succeeds

Can anyone explain in detail why this script, https://github.com/james-iohk/Alonzo-testnet/blob/update-cabal-1.29.0/resources/plutus-sources/plutus-alwayssucceeds/src/Cardano/PlutusExample/...
2
votes
1answer
64 views

Best practice for testing smart contract

Let's say you have your haskell code ready to test as a smart contract on the testnet, what is the best practice to go about testing if your smart contract works as intended? Does the same process ...
2
votes
2answers
57 views

Automatically send funds out using a smart contract

I'm looking for an example or tutorial for how to write a smart contract which locks all ADA sent to it until a threshold of at least 1,000 ADA is reached. Once 1,000 ADA is reached, as much ADA as ...
0
votes
1answer
74 views

How to calculate the collateral minimun required for a Smart Contract Transaction, is always needed a Colateral?

I was asking to myself in which scenarios do I have to add a collateral when consuming an UTXO in a Script Address. I have just read the basics, but do you know if there is minimum needed in each ...
0
votes
2answers
85 views

Nami wallet address format to addr_test1 format

lets say i have the following address for recieving funds: addr_test1qzu70xm8hsez6nvmpgk4gjf48ev0y2hw5w7nf8xaxc658lzwczusckqvzzg630pxnzwj3pqza5q4c8r504ffq6v2zh6qgznxt7 when i try and get the wallet ...
0
votes
1answer
39 views

NativeScript vs PlutusScript

In cardano serialization lib what is the difference between NativeScript and PlutusScript? Is there a way to convert from one to the other? I'm trying to load a minting policy script I made as a ...
2
votes
2answers
471 views

Can a smart contract only be interacted with once

Im confused if a eUTXO can only be interacted with and used up once how can you do a NFT sale? If I were to make a smart contract to distribute NFT's from a wallet can that be interacted with by ...
1
vote
2answers
59 views

Is it possible to make a NFT collection by having consumer mint the NFT's

I want to create a NFT collection in which the creator does not have to mint the NFT's but the consumer does through a smart contract that they interact with. Would this be possible to do while sill ...
1
vote
3answers
198 views

Building a transaction using Nami api wallet and cardano-client-lib

I am trying to build a transaction with the libary of cardano-client-lib (java sdk). Inorder to build a transaction one needs to provide an account object which can only be created with the mnemonic ...
0
votes
0answers
72 views

User interaction with smart contracts

I want my users to interact with my smart contracts. All transactions come from these users. There are no transactions - except for setting up - that come from my wallets. As entry point for this ...
1
vote
2answers
74 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
1
vote
2answers
77 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
128 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 ...
0
votes
1answer
53 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 ...
2
votes
1answer
52 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 ...
3
votes
1answer
63 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 ...
5
votes
1answer
199 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 ...
2
votes
1answer
49 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 "...
2
votes
1answer
44 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) {-# ...
2
votes
1answer
131 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
75 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. ...
1
vote
2answers
101 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 ...
2
votes
1answer
25 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.
6
votes
1answer
312 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 ...
2
votes
1answer
65 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.
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 ...
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 ...
0
votes
1answer
112 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 ...