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
1 vote
3 answers
107 views

How to convert Address type variable to get "addr_testXXX" format address?

In plutus endpoint, I want to convert Address type value to get addr_testXXX format address. I have try : import Cardano.Api ( SerialiseAddress (deserialiseAddress, serialiseAddress) ) ... -- here, ...
1 vote
1 answer
39 views

Failed to build atlas examples with cabal

I tried both in the main branch and in the atlas-0.3-update branch and get the same result. but when i run cabal build i get the same error fatal: Could not parse object '...
0 votes
1 answer
29 views

Plutus Playground - mustPayToTheScript - unexpected char escapes - 0 converted to \NUL, 1 to \SOH

I am having trouble with the mustPayToTheScript function - I am getting this error Contract instance stopped with error: "WalletError (InsufficientFunds \"Total: Value (Map [(,Map [(\\\"...
0 votes
1 answer
199 views

What is the correct way to compare two instances of Value data type?

Question What is the correct way to compare two instances of Value data type? Context I would like to check if outgoing transaction identified by PubKeyHash has the same Value as Value which was ...
0 votes
0 answers
19 views

To create a dead-end "burning mechanism" contract for a specific native token

I am not sure how this should, or could, be done on Cardano... I would like an address/script which, if a specific native token were submitted there, that token would become permanently irretrievable. ...
0 votes
3 answers
103 views

How Can You Prevent A Burn Address From Polluting The Cardano Ledger?

Making a Burn Address on the blockchain is currently done by using a script address with a validator that always returns False and so never validates. This ties up ADA and causes the size of the ...
0 votes
3 answers
112 views

Unlock NFT from smart contract by Cardano-serialization-library

I am trying to implement the Unlocking of NFT from an "always true" smart contract. I am using the Cardano serialization library for this. I can lock the NFT successfully, but when i unlock ...
0 votes
1 answer
42 views

Understanding Script Failure Error Relating to Order TxIds - (script hash not known)

trying to claim back the first player bet after deadline in the ZeroOneGame from ppbl gimbalabs course on pre-production_testnet I get an error when trying to build the claim transaction. I have this ...
1 vote
2 answers
127 views

Mutable NFT state by minting and burning in same transaction

The problem Please consider the following case: a token (NFT) needs to holds some state, ie {a: 234, b: "someState"}, which needs to be mutable and it needs to abide to specific rules. The ...
1 vote
1 answer
29 views

Mallet IELE Compiler crashes without Uncaught Error

I was able to get mallet running with the command ./mallet iele -d . I created a simple contract that works in Remix but when I try to compile the contract using iele I get a Uncaught 'Compiler error: ...
3 votes
1 answer
77 views

Access Control for my company's vehicle

I wish to delegate access control with a Phone-As-A-Key DApp for vehicles (for sharing the vehicle, P2P rentals and more). When delegating access control, the DApp will update a smart contract which ...
0 votes
1 answer
20 views

how to use ownPubKey and RedeemerType and DatumType

My code is here. {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ...
2 votes
1 answer
25 views

Expecting one more argument to ‘RedeemerType’

My code is here marketConstraints :: Market -> TxConstraints (RedeemerType -> ScriptContext -> Bool) (DatumType, ()) marketConstraints market = mustValidateIn (to $ scriptAddress market) I ...
0 votes
1 answer
148 views

Select only one UTxO from script address

I need to get only one UTxO from the script address, where its datum hash matches the redeemer hash. For example I have locked two UTxO with 10 Ada and the DatumHash "house" at the script ...
1 vote
2 answers
74 views

Decompiling Plutus Core Binary Encoding

I'm working with Plutus Core smart contracts, and I have the binary encoding of a Plutus Core script. I'm curious to explore the higher-level Plutus code or any human-readable representation of the ...
0 votes
0 answers
19 views

Get live price for token across different Cardano DEXes

I am working on a small pet project and I need to get the live price data for a token across multiple Cardano DEXes. For instance, I need the live price of WMT on MinSwap, MuesliSwap, GeniusYield and ...
1 vote
1 answer
57 views

How to import Plutus.Contracts.Currency

I am trying to build an application that will make use of function mintContract under Plutus.Contracts.Currency, but i have difficulty importing this module. What can i do?
2 votes
1 answer
181 views

How do you make a faucet for native assets such as NFTS on cardano?

im trying to make an NFT faucet for a NFT drop. How do I make the basic faucet is there an example that I could build upon?
0 votes
1 answer
32 views

I want to mint an NFT using a JSON file using plu-ts, but I dont know how and where to start

I want to mint an NFT using a JSON file using plu-ts, but I don't know how and where to start. Do I need to create a Node? OR Do I need to write it in Haskel? I have read and performed everything from ...
1 vote
1 answer
29 views

Can I view a Plutus smart contract on the NFT marketplace?

Can I view a Plutus smart contract of an NFT from the marketplace like (JPG store) and what is PubKeyHash ?
0 votes
1 answer
25 views

How to build smart contract depending on trusted server for additional information

I am trying to build a smart contract that will need to rely on off-chain information from a trusted server in order to gather to the state of something which will impact on how the UTXO should be ...
3 votes
2 answers
235 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 ...
1 vote
1 answer
82 views

Cardano marketplace that allows selling a batch of NFTs

anyone aware of a cardano marketplace that allows us to mint NFTs in batches that will launch with smart contracts launch or at least close to the launch? So e.g. 1 policy ID, 10000 asset names that ...
0 votes
2 answers
80 views

playground-common package giving 'Failed to build scrypt-0.5.0' error

I'm trying to run my own little smart contract in the plutus-pioneer-program [fourth iteration] docker container and I'm having some problems. I've just added an extra folder alongside the other weeks....
0 votes
1 answer
30 views

Why does forgeContract receives a PubKeyHash?

The forgeContract is responsible for minting NFT's and in the arguments we have a token name and amount, why do we have a public hash key for minting NFT?
0 votes
0 answers
23 views

Is Plutus compiler backend producing code cheap enough for production purposes?

I have heard a couple of times, that is hard to make Plutus produce non-costly code, and one should consider writing scripts on a level with Plutarch's help instead. Still, I never get real reasons ...
0 votes
1 answer
184 views

How to resolve this "(FromAlonzoUtxoFail (UtxosFailure (ValidationTagMismatch (IsValid True)" transaction submission error on mesh library

I am getting this error on transaction submission. ""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (...
2 votes
3 answers
93 views

How to allow non deterministic spent output

I would like a validator (or a minting policy) to succeed always but only to spend the output if some conditions are met; an example use case of such behaviour is to allow burning token (kind of a &...
0 votes
0 answers
14 views

Coming from ethereum I am looking for the Cardano equivalent of https://remix.ethereum.org/ for quick development

I am coming from the Ethereum world, where I got started with https://remix.ethereum.org/ really fast. What is the equivalant in the Cardano world so that I can experiment fast just using my web ...
5 votes
1 answer
483 views

What tools do I have for building a Cardano Dapp right now?

I am building a Dapp in Cardano and I want it to build NFTs even if it's not possible right now, what tools can I use for it? I know that there is a testnet where I can run Plutus contract. How can I ...
1 vote
1 answer
80 views

Create a smart contract in Marlowe from A to Z

What is the process of building a smart contract in Marlowe from start to deployment and first main net transaction? I know that there's blockly and Marlowe playground. But I can't figure out the step-...
-1 votes
1 answer
47 views

Programmatically write and submit a smart contract

Title. Any ways to accomplish this? Preferrably in react/javascript Edit: downvote me to oblivion!!
0 votes
2 answers
99 views

Different types of Datums

I have a good understanding of the role of Datums in Cardano's Extended UTXO model, including their use in representing the state of a smart contract. However, I'm seeking further clarification on the ...
2 votes
1 answer
60 views

How to handle sensitive data in smart contracts?

I'm interested in creating an escrow smart contract using Plutus, where a seller stores an encryption key in the Datum and sells it for a price. The key should only be accessible to a buyer who pays ...
1 vote
2 answers
85 views

which programming language is predominantly used for writing smart contracts in Cardano now?

I am a newbie to blockchain in the Cardano ecosystem. I have been exploring the Cardano documentation, which mentions various programming languages for writing smart contracts on the platform. How do ...
0 votes
0 answers
42 views

How to get Daily Volume for an Cardano token by using Cardano-Db-Syncs database

Is there an way to query directly Cardano Db Syncs database to get withhold of the daily volume of an certain token ( For example via using multi_asset.fingerprint ) WITH ma_tx_ids AS ( SELECT ...
3 votes
2 answers
315 views

Which would be the future language for writing smart-contract?

As we might know well-known approaches for writing smart contracts on Cardano are using Plutus Tx or Marlowe based on specific requirements. However, according to the growth of the Cardano community, ...
3 votes
2 answers
435 views

Can a smart contract execute itself automatically?

I was wondering wether a smart contract can execute automatically or not. For example, let's say I have a vesting contract that, when a certain deadline passes, automatically executes and send some ...
0 votes
3 answers
129 views

"The second data argument, does not decode to a context" when minting NFT with Mesh

This my script for minting NFT: {-# INLINABLE mkPolicy #-} mkPolicy :: BuiltinData -> PlutusV2.ScriptContext -> Bool mkPolicy _ ctx = traceIfFalse "wrong amount minted" checkNFTAmount ...
1 vote
0 answers
20 views

PlutusTx TxInfo Type Mismatch

I am building a PlutusTx V1 Smart Contract for NFT Royalty distribution. Part of that requires totaling up the amount of Lovelace sent to the contract from the most recent tx. I came up with the ...
0 votes
1 answer
83 views

Limit the number for each Token (AssetName) within one Currency Symbol (Policy ID)

is there any way to limit number for each tokens within one minting policy, in Plutus validator? For example for policy ab12 I want to allow users minting tokens, in different transactions. Сan the ...
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 ...
0 votes
2 answers
76 views

How to generate CBOR hex of plutus smart contract

How can i generate the CBOR hex of a plutus smart contract. Does it requires to generate CBOR of onchain code only or both onchain and offchain? Also if have a smart contract which requires parameters ...
1 vote
2 answers
50 views

How do I design a dApp for 1000 NFTs minted per second

I am brainstorming on the architecture of a Cardano dApp that will be able to issue tickets as NFTs and can scale to around 1000 NFT tickets per second. From what I understand so far on UTXO, a ...
1 vote
0 answers
15 views

Comparing VALUES in a smart contract. How to know if they will be normalized or not?

I need to make VALUES comparisons on chain. I realized that if a use the (==) operator from Plutus it is very inefficient in matter of memory and cpu steps needed to compute. (https://github.com/input-...
2 votes
1 answer
163 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 ...
0 votes
2 answers
97 views

"Transaction submit error" while trying to unlock funds from script address using Mesh

This is my setup code. const wallet = await BrowserWallet.enable('Nami'); // this script always succeeds regardless of the datum or redeemer const script: PlutusScript = { code: '59079559079201......
3 votes
2 answers
276 views

Will Cardano ever have anything more than validators on-chain?

I have been looking into creating a blackjack game on the Cardano Blockchain. I started with learning Haskell, and writing a simple blackjack CLI game. It was heaps of fun and a bit of a learning ...
0 votes
1 answer
69 views

Need to Retrieve Info from (NFT)Assets in Policy ID to see if they are in a Plutus Contract (smart contract) or Not using Blockfrost API

I have a python script that retrieves the NFT asset name, and addresses of a specific policy ID using blockfrost API. Now I need to amend the script to add to the csv whether or not the specific asset ...
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 ...

1
2 3 4 5 6